Class: OrigenARMDebug::DAPController

Inherits:
Object
  • Object
show all
Includes:
Origen::Controller, Helpers
Defined in:
lib/origen_arm_debug/dap_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#extract_address, #extract_data, #log

Instance Attribute Details

#dpObject

Returns the currently enabled DP (or the only DP if only one of them). If no dp is enabled before calling this, it will choose the SW_DP by default.



7
8
9
# File 'lib/origen_arm_debug/dap_controller.rb', line 7

def dp
  @dp
end

Instance Method Details

#is_jtag?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/origen_arm_debug/dap_controller.rb', line 36

def is_jtag?
  dp.is_jtag?
end

#is_swd?Boolean Also known as: is_sw?

Returns:

  • (Boolean)


40
41
42
# File 'lib/origen_arm_debug/dap_controller.rb', line 40

def is_swd?
  dp.is_swd?
end

#reset_dpObject



32
33
34
# File 'lib/origen_arm_debug/dap_controller.rb', line 32

def reset_dp
  @dp = nil
end

#set_dp(dp) ⇒ Object

rubocop:enable Lint/DuplicateMethods



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/origen_arm_debug/dap_controller.rb', line 18

def set_dp(dp)
  if dps.size > 1
    if dp == :swd || dp == :sw
      @dp = dps.first
    elsif dp == :jtag
      @dp = dps.last
    else
      Origen.log.error 'origen_arm_debug: Only SWD and JTAG DP available'
    end
  else
    Origen.log.warn 'origen_arm_debug: Ignoring set_dp call since only one DP is available'
  end
end