Sha256: 9f8742ae2d0ce87df716fe1f578f7142c32eb0d283d98c8ba12744d23e7af381

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

module OrigenARMDebug
  # 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.
  class DUT
    include Origen::TopLevel
    include OrigenARMDebug

    # Initializes simple dut model with test register and required jtag/swd pins
    #
    # @example
    #   $dut = OrigenARMDebug::DUT.new
    #
    def initialize
      add_reg :dap,  0x0, 35, data: { pos: 0, bits: 35 }

      add_reg :test, 0x0, 32, data: { pos: 0, bits: 32 },
                              bit:  { pos: 0 }

      sub_block :arm_debug, class_name: 'OrigenARMDebug::Driver', aps: { mem_ap: 0x00000000, mdm_ap: 0x01000000 }
      arm_debug.add_mem_ap('alt_ahbapi', 0x02000000)

      # arm_debug.add_mem_ap('mem_ap', 0x00000000)
      # arm_debug.add_mem_ap('mdm_ap', 0x01000000)
      # arm_debug.add_mem_ap('alt_ahbapi', 0x02000000)
    end

    # Add any custom startup business here.
    #
    # @param [Hash] options Options to customize the operation
    def startup(options)
      $tester.set_timeset('arm_debug', 40)
    end

    # Read data from a register
    #
    # @param [Register] reg Register name or address value
    # @param [Hash] options Options to customize the operation
    def read_register(reg, options = {})
      arm_debug.read_register(reg, options)
    end

    # Write data to a register
    #
    # @param [Register] reg Register name or address value
    # @param [Hash] options Options to customize the operation
    def write_register(reg, options = {})
      arm_debug.write_register(reg, options)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
origen_arm_debug-0.10.0 lib/origen_arm_debug/dut.rb
origen_arm_debug-0.10.0.pre0 lib/origen_arm_debug/dut.rb
origen_arm_debug-0.9.0 lib/origen_arm_debug/dut.rb