Class: OrigenARMDebug::DAPController
- Inherits:
-
Object
- Object
- OrigenARMDebug::DAPController
- Includes:
- Origen::Controller, Helpers
- Defined in:
- lib/origen_arm_debug/dap_controller.rb
Instance Attribute Summary collapse
-
#dp ⇒ Object
Returns the currently enabled DP (or the only DP if only one of them).
Instance Method Summary collapse
- #is_jtag? ⇒ Boolean
- #is_swd? ⇒ Boolean (also: #is_sw?)
- #reset_dp ⇒ Object
-
#set_dp(dp) ⇒ Object
rubocop:enable Lint/DuplicateMethods.
Methods included from Helpers
#extract_address, #extract_data, #log
Instance Attribute Details
#dp ⇒ Object
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
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?
40 41 42 |
# File 'lib/origen_arm_debug/dap_controller.rb', line 40 def is_swd? dp.is_swd? end |
#reset_dp ⇒ Object
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 |