Sha256: ba8bc6de5d29bfc82d0fa08529a774d68200b01d1934618a21c5e9f6ce5a21d5

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

module OrigenARMDebugDev
  # 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 = OrigenARMDebugDev::DUT.new
    #
    def initialize
      add_reg :test, 0

      reg :test2, 0 do |reg|
        reg.bit 31, :msb
        reg.bit 30..1, :data
        reg.bit 0, :lsb
      end
    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.mem_ap.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.mem_ap.write_register(reg, options)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
origen_arm_debug-1.0.2 lib/origen_arm_debug_dev/dut.rb
origen_arm_debug-1.0.1 lib/origen_arm_debug_dev/dut.rb
origen_arm_debug-1.0.0 lib/origen_arm_debug_dev/dut.rb
origen_arm_debug-1.0.0.pre1 lib/origen_arm_debug_dev/dut.rb