Class: OrigenLink::Test::TopLevel

Inherits:
Object
  • Object
show all
Includes:
Origen::TopLevel
Defined in:
lib/origen_link/test/top_level.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ TopLevel

Returns a new instance of TopLevel.



6
7
8
9
10
# File 'lib/origen_link/test/top_level.rb', line 6

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

Instance Method Details

#instantiate_pins(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/origen_link/test/top_level.rb', line 12

def instantiate_pins(options = {})
  options = {
    jtag_comm_config:			     false,
    invalid_pin_number_test:	false,
    missing_pinmap_test:		   false
  }.merge(options)
  add_pin :tclk, meta: { link_io: 119 }
  add_pin :tdi, meta: { link_io: 116 }
  add_pin :tdo, meta: { link_io: 124 }
  add_pin :tms, meta: { link_io: 6 }
  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

#instantiate_registers(options = {}) ⇒ Object



38
39
40
41
42
# File 'lib/origen_link/test/top_level.rb', line 38

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

#instantiate_sub_blocks(options = {}) ⇒ Object



44
45
# File 'lib/origen_link/test/top_level.rb', line 44

def instantiate_sub_blocks(options = {})
end