Class: OrigenARMDebugDev::DUT

Inherits:
Object
  • Object
show all
Includes:
Origen::TopLevel, OrigenARMDebug
Defined in:
lib/origen_arm_debug_dev/dut.rb

Overview

This is a dummy DUT model which is used to instantiate and test the ARMDebug locally during development.

It is not included when this library is imported.

Direct Known Subclasses

DUAL_DP_DUT, JTAG_AXI_DUT, JTAG_DUT, SWD_DUT

Constant Summary

Constants included from OrigenARMDebug

OrigenARMDebug::Driver

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DUT

Initializes simple dut model with test register and required jtag/swd pins

Examples:

$dut = OrigenARMDebugDev::DUT.new


16
17
18
19
20
21
22
23
24
# File 'lib/origen_arm_debug_dev/dut.rb', line 16

def initialize(options = {})
  add_reg :test, 0

  reg :test2, 0 do |reg|
    reg.bit 31, :msb
    reg.bit 30..1, :data
    reg.bit 0, :lsb
  end
end

Instance Method Details

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

Read data from a register

Parameters:

  • reg (Register)

    Register name or address value

  • options (Hash) (defaults to: {})

    Options to customize the operation



37
38
39
# File 'lib/origen_arm_debug_dev/dut.rb', line 37

def read_register(reg, options = {})
  arm_debug.mem_ap.read_register(reg, options)
end

#startup(options) ⇒ Object

Add any custom startup business here.

Parameters:

  • options (Hash)

    Options to customize the operation



29
30
31
# File 'lib/origen_arm_debug_dev/dut.rb', line 29

def startup(options)
  tester.set_timeset('arm_debug', 40)
end

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

Write data to a register

Parameters:

  • reg (Register)

    Register name or address value

  • options (Hash) (defaults to: {})

    Options to customize the operation



45
46
47
# File 'lib/origen_arm_debug_dev/dut.rb', line 45

def write_register(reg, options = {})
  arm_debug.mem_ap.write_register(reg, options)
end