Sha256: 375b197ab8482434818292078c6b532609113d53109beba24d1139f7c44dcc77

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

module OrigenSWDDev
  # This is a dummy DUT model which is used
  # to instantiate and test the SWD locally
  # during development.
  #
  # It is not included when this library is imported.
  class DUT
    include Origen::TopLevel
    include OrigenSWD

    # Initializes simple dut model with test register and required swd pins
    #
    # @param [Hash] options Options to customize the operation
    #
    # @example
    #   $dut = OrigenSWD::DUT.new
    #
    def initialize(options = {})
      # Sample DPACC register
      add_reg :test, 0x04, 32, data: { pos: 0, bits: 32 },
                               bit:  { pos: 2 }

      # Sample DPACC register
      add_reg :select, 0x08, 32, data: { pos: 0, bits: 32 }

      # Sample APACC register
      add_reg :stat, 0x00, 32, data: { pos: 0, bits: 32 }
      add_reg :control, 0x01, 32, data: { pos: 0, bits: 32 }

      add_pin :swd_clk
      add_pin :swd_dio
    end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
origen_swd-1.1.3 lib/origen_swd_dev/dut.rb
origen_swd-1.1.2 lib/origen_swd_dev/dut.rb
origen_swd-1.1.1 lib/origen_swd_dev/dut.rb
origen_swd-1.1.0 lib/origen_swd_dev/dut.rb
origen_swd-1.0.0 lib/origen_swd_dev/dut.rb