Class: OrigenARMDebug::APController

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

Direct Known Subclasses

JTAGAPController, MemAPController

Instance Method Summary collapse

Methods included from Helpers

#extract_address, #extract_data, #log

Instance Method Details

#base_addressObject



27
28
29
# File 'lib/origen_arm_debug/ap_controller.rb', line 27

def base_address
  model.base_address
end

#read_register(reg_or_val, options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/origen_arm_debug/ap_controller.rb', line 17

def read_register(reg_or_val, options = {})
  if reg_or_val.try(:owner) == model
    log "Read AP (#{model.name}) register #{reg_or_val.name.to_s.upcase}: #{Origen::Utility.read_hex(reg_or_val)}" do
      parent.dp.read_register(reg_or_val, apacc_wait_states: apreg_access_wait)
    end
  else
    fail 'No Resource-specific transport defined for MDM-AP (#model.name})'
  end
end

#write_register(reg_or_val, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/origen_arm_debug/ap_controller.rb', line 6

def write_register(reg_or_val, options = {})
  if reg_or_val.try(:owner) == model
    log "Write AP (#{model.name}) register #{reg_or_val.name.to_s.upcase}: #{reg_or_val.data.to_hex}" do
      parent.dp.write_register(reg_or_val)
      apreg_access_wait.cycles
    end
  else
    fail 'No Resource-specific transport defined for MDM-AP (#model.name})'
  end
end