Module: OrigenDebuggers::PEmicro::JTAG_API

Included in:
OrigenDebuggers::PEmicro
Defined in:
lib/origen_debuggers/p_and_e.rb

Overview

If the debugger supports JTAG definitely add these methods, this provides instant compatibility with any application that uses a JTAG based protocol

Instance Method Summary collapse

Instance Method Details

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

Read the given value, register or bit collection from the data register



251
252
253
# File 'lib/origen_debuggers/p_and_e.rb', line 251

def read_dr(reg_or_val, options = {})
  # Can't read the DR
end

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

Read the given value, register or bit collection from the instruction register



269
270
271
# File 'lib/origen_debuggers/p_and_e.rb', line 269

def read_ir(reg_or_val, options = {})
  # Can't read the IR
end

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

Write the given value, register or bit collection to the data register



237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/origen_debuggers/p_and_e.rb', line 237

def write_dr(reg_or_val, options = {})
  dw 'jtag_start' unless @in_jtag
  @in_jtag = true
  if reg_or_val.respond_to?(:data)
    data = reg_or_val.data
    size = options[:size] || reg_or_val.size
  else
    data = reg_or_val
    size = options[:size]
  end
  dw "jtag_dr #{size}t #{data.to_s(16).downcase}"
end

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

Write the given value, register or bit collection to the instruction register



256
257
258
259
260
261
262
263
264
265
266
# File 'lib/origen_debuggers/p_and_e.rb', line 256

def write_ir(reg_or_val, options = {})
  dw 'jtag_start' unless @in_jtag
  @in_jtag = true
  size = options[:size] || 4 # Used to be hardcoded to 4 with no override capability
  if reg_or_val.respond_to?(:data)
    data = reg_or_val.data
  else
    data = reg_or_val
  end
  dw "jtag_ir #{size}t #{data.to_s(16).downcase}"
end