Sha256: 22e6a19c9ca3384e9675bdf10096513f9ca95bee01ed0b447c19812b3adc1de5

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

module OrigenLink
  module Test
    class TopLevel
      include Origen::TopLevel

      def initialize(options = {})
        instantiate_pins(options)
        instantiate_registers(options)
        instantiate_sub_blocks(options)
      end

      def instantiate_pins(options = {})
        options = {
          jtag_comm_config:			     false,
          invalid_pin_number_test:	false,
          missing_pinmap_test:		   false
        }.merge(options)
        add_pin :tclk
        add_pin :tdi
        add_pin :tdo
        add_pin :tms
        add_pin :resetb
        add_pins :port_a, size: 8

        pin_pattern_order :tclk, :tms, :tdi, :tdo, only: true if options[:jtag_comm_config]

        # if tester.link? #.to_s == 'OrigenLink::VectorBased'
        if tester.to_s == 'OrigenLink::VectorBased'
          if options[:invalid_pin_number_test]
            tester.pinmap = 'tclk,119,tms,1900,tdi,116,tdo,124'
          else
            tester.pinmap = 'tclk,119,tms,6,tdi,116,tdo,124' unless options[:missing_pinmap_test]
          end
          tester.pinorder = 'tclk,tms,tdi,tdo'
        end
      end

      def instantiate_registers(options = {})
        reg :testreg, 0 do |reg|
          reg.bits 31..0,		:value
        end
      end

      def instantiate_sub_blocks(options = {})
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
origen_link-0.2.0 lib/origen_link/test/top_level.rb