Class: OrigenTesters::Test::DUT
- Inherits:
-
Object
- Object
- OrigenTesters::Test::DUT
- Includes:
- Origen::TopLevel, OrigenARMDebug, OrigenJTAG
- Defined in:
- lib/origen_testers/test/dut.rb
Instance Attribute Summary collapse
-
#blocks ⇒ Object
Simple DUT using Nexus interface.
-
#digcap_pins ⇒ Object
Returns the value of attribute digcap_pins.
-
#digcap_settings ⇒ Object
Returns the value of attribute digcap_settings.
-
#digsrc_pins ⇒ Object
Returns the value of attribute digsrc_pins.
-
#digsrc_settings ⇒ Object
Returns the value of attribute digsrc_settings.
-
#hv_supply_pin ⇒ Object
Returns the value of attribute hv_supply_pin.
-
#lv_supply_pin ⇒ Object
Returns the value of attribute lv_supply_pin.
Instance Method Summary collapse
- #digsrc_overlay(options = {}) ⇒ Object
- #execute(options = {}) ⇒ Object
- #find_block_by_id(id) ⇒ Object
- #freq_count(options = {}) ⇒ Object
- #handshake(options = {}) ⇒ Object
-
#has_margin0_bug? ⇒ Boolean
dummy flag to check for a particular design bug for this DUT.
-
#initialize(options = {}) ⇒ DUT
constructor
A new instance of DUT.
- #keepalive(options = {}) ⇒ Object (also: #keep_alive)
-
#match(options = {}) ⇒ Object
Match loop functionality.
- #memory_test(options = {}) ⇒ Object
- #on_create ⇒ Object
- #read_register(reg, options = {}) ⇒ Object
- #startup(options) ⇒ Object
- #write_register(reg, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ DUT
Returns a new instance of DUT.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/origen_testers/test/dut.rb', line 18 def initialize( = {}) add_pin :tclk add_pin :tdi add_pin :tdo add_pin :tms # add_pin_group :jtag, :tdi, :tdo, :tms add_power_pin_group :vdd1 add_power_pin_group :vdd2 add_virtual_pin :virtual1, type: :virtual_pin add_virtual_pin :virtual2, type: :ate_ch reg :testme32, 0x007a do |reg| reg.bits 31..16, :portB reg.bits 15..8, :portA reg.bits 1, :done reg.bits 0, :enable end @hv_supply_pin = 'VDDHV' @lv_supply_pin = 'VDDLV' @digsrc_pins = [:tdi, :tms] @digsrc_settings = { digsrc_mode: :parallel, digsrc_bit_order: :msb } @digcap_pins = :tdo @digcap_settings = { digcap_format: :twos_complement } @blocks = [Block.new(0, self), Block.new(1, self), Block.new(2, self)] end |
Instance Attribute Details
#blocks ⇒ Object
Simple DUT using Nexus interface
6 7 8 |
# File 'lib/origen_testers/test/dut.rb', line 6 def blocks @blocks end |
#digcap_pins ⇒ Object
Returns the value of attribute digcap_pins.
10 11 12 |
# File 'lib/origen_testers/test/dut.rb', line 10 def digcap_pins @digcap_pins end |
#digcap_settings ⇒ Object
Returns the value of attribute digcap_settings.
12 13 14 |
# File 'lib/origen_testers/test/dut.rb', line 12 def digcap_settings @digcap_settings end |
#digsrc_pins ⇒ Object
Returns the value of attribute digsrc_pins.
9 10 11 |
# File 'lib/origen_testers/test/dut.rb', line 9 def digsrc_pins @digsrc_pins end |
#digsrc_settings ⇒ Object
Returns the value of attribute digsrc_settings.
11 12 13 |
# File 'lib/origen_testers/test/dut.rb', line 11 def digsrc_settings @digsrc_settings end |
#hv_supply_pin ⇒ Object
Returns the value of attribute hv_supply_pin.
7 8 9 |
# File 'lib/origen_testers/test/dut.rb', line 7 def hv_supply_pin @hv_supply_pin end |
#lv_supply_pin ⇒ Object
Returns the value of attribute lv_supply_pin.
8 9 10 |
# File 'lib/origen_testers/test/dut.rb', line 8 def lv_supply_pin @lv_supply_pin end |
Instance Method Details
#digsrc_overlay(options = {}) ⇒ Object
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/origen_testers/test/dut.rb', line 221 def ( = {}) = { define: false, # whether to define subr or call it subr_name: false, # default use match type as subr name digsrc_pins: @digsrc_pins, # defaults to what's defined in $dut overlay_reg: nil, # defaults to testme32 register overlay_cycle_num: 32, # Only needed if overlay_reg is NOT nil, this specificies how many clk cycles to overlay. }.merge() if [:define] $tester.start_subroutine([:subr_name]) # Start subroutine digsrc_pins = $tester.assign_digsrc_pins([:digsrc_pins]) $tester.digsrc_start(digsrc_pins, dssc_mode: :single) original_pin_states = {} digsrc_pins.each do |pin| original_pin_states.merge!(pin => pin(pin).data) pin(pin).drive_mem end if [:overlay_reg].nil? [:overlay_cycle_num].times do $tester.digsrc_send(digsrc_pins) $tester.cycle end else $tester.dont_compress = true [:overlay_reg].size.times do $tester.digsrc_send(digsrc_pins) $tester.cycle end end original_pin_states.each do |pin, state| pin(pin).drive(state) end $tester.digsrc_stop(digsrc_pins) $tester.cycle $tester.end_subroutine # end subroutine else $tester.cycle $tester.call_subroutine([:subr_name]) end end |
#execute(options = {}) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/origen_testers/test/dut.rb', line 67 def execute( = {}) = { define: false, # whether to define subr or call it name: 'executefunc1', onemodsub: false # whether to expects subr to be in single module }.merge() if [:define] # define subroutine $tester.start_subroutine([:name], onemodsub: [:onemodsub]) $tester.cycle $tester.end_subroutine(onemodsub: [:onemodsub]) $tester.cycle unless [:onemodsub] else # call subroutine $tester.cycle $tester.call_subroutine([:name]) $tester.cycle end end |
#find_block_by_id(id) ⇒ Object
290 291 292 |
# File 'lib/origen_testers/test/dut.rb', line 290 def find_block_by_id(id) @blocks.find { |block| block.id == id } end |
#freq_count(options = {}) ⇒ Object
278 279 280 281 282 283 |
# File 'lib/origen_testers/test/dut.rb', line 278 def freq_count( = {}) = { }.merge() $tester.freq_count($dut.pin(:tdo), readcode: 73) end |
#handshake(options = {}) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/origen_testers/test/dut.rb', line 185 def handshake( = {}) = { define: false, # whether to define subr or call it }.merge() if [:define] $tester.start_subroutine('handshake') $tester.handshake(readcode: 100) $tester.cycle $tester.cycle $tester.cycle $tester.end_subroutine else $tester.cycle $tester.call_subroutine('handshake') end end |
#has_margin0_bug? ⇒ Boolean
dummy flag to check for a particular design bug for this DUT
286 287 288 |
# File 'lib/origen_testers/test/dut.rb', line 286 def has_margin0_bug? false end |
#keepalive(options = {}) ⇒ Object Also known as: keep_alive
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/origen_testers/test/dut.rb', line 203 def keepalive( = {}) = { define: false, # whether to define subr or call it allow_subroutine: false, subroutine_pat: true }.merge() if [:define] $tester.start_subroutine('keep_alive') $tester.keep_alive() $tester.end_subroutine else $tester.cycle $tester.call_subroutine('keep_alive') end end |
#match(options = {}) ⇒ Object
Match loop functionality
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/origen_testers/test/dut.rb', line 88 def match( = {}) = { type: :match_pin, # whether to match DONE bit in register or match pin # :match_done # :match_2pins delay_in_us: 5, # match loop delay define: false, # whether to define subr or call it subr_name: false, # default use match type as subr name }.merge() subr_name = [:subr_name] ? [:subr_name] : [:type].to_s if [:define] $tester.start_subroutine(subr_name) $tester.cycle if [:type] == :match_done # Match DONE bit in register $tester.wait(match: true, time_in_us: [:delay_in_us], global_loops: true, check_for_fails: true, force_fail_on_timeout: true, clr_fail_post_match: true, manual_stop: true) do # Match on reading done bit reg(:testme32).bits(:done).write(1) reg(:testme32).bits(:done).read! end elsif [:type] == :match_pin # Match on TDO pin state $tester.wait(match: true, pin: pin(:tdo), state: :high, time_in_us: [:delay_in_us], global_loops: true, check_for_fails: true, force_fail_on_timeout: true, clr_fail_post_match: true, manual_stop: true) elsif [:type] == :match_2pins # Match on TDO pin state $tester.wait(match: true, pin: pin(:tdo), state: :high, pin2: pin(:tms), state2: :high, time_in_us: [:delay_in_us], global_loops: true, check_for_fails: true, force_fail_on_timeout: true, clr_fail_post_match: true, manual_stop: true) elsif [:type] == :match_2pins_custom_jump # Match on TDO pin state $tester.wait(match: true, pin: pin(:tdo), state: :high, pin2: pin(:tms), state2: :high, time_in_us: [:delay_in_us], on_pin_match_goto: { 0 => 'no_fails_found' }, on_timeout_goto: 'no_fails_found', global_loops: true, check_for_fails: true, force_fail_on_timeout: true, clr_fail_post_match: true, manual_stop: true) $tester.cycle $tester.set_code(200) $tester.branch('match_done') $tester.label('no_fails_found') $tester.set_code(201) $tester.label('match_done') elsif [:type] == :multiple_entries # Match on TDO pin state, with multiple subr entry points $tester.wait(match: true, pin: pin(:tdo), state: :high, time_in_us: [:delay_in_us], global_loops: true, multiple_entries: true, check_for_fails: true, force_fail_on_timeout: true, clr_fail_post_match: true, manual_stop: true) end $tester.cycle $tester.end_subroutine $tester.cycle else # call subroutine $tester.cycle $tester.call_subroutine(subr_name) $tester.cycle end end |
#memory_test(options = {}) ⇒ Object
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/origen_testers/test/dut.rb', line 261 def memory_test( = {}) = { }.merge() $tester.memory_test(inc_counter_x: true, gen_vector: true) $tester.memory_test(inc_counter_y: true, gen_vector: true) $tester.memory_test(init_counter_x: true) $tester.memory_test(inc_counter_x: true, init_counter_y: true) $tester.memory_test(inc_counter_y: true, capture_vector: true) $tester.memory_test(pin: pin(:tdo), pin_data: :expect) end |
#on_create ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/origen_testers/test/dut.rb', line 44 def on_create if tester && tester.uflex? tester.assign_dc_instr_pins([hv_supply_pin, lv_supply_pin]) tester.assign_digsrc_pins(digsrc_pins) tester.apply_digsrc_settings(digsrc_settings) tester.assign_digcap_pins(digcap_pins) tester.apply_digcap_settings(digcap_settings) tester.memory_test_en = true end end |
#read_register(reg, options = {}) ⇒ Object
63 64 65 |
# File 'lib/origen_testers/test/dut.rb', line 63 def read_register(reg, = {}) arm_debug.write_register(reg, ) end |
#startup(options) ⇒ Object
55 56 57 |
# File 'lib/origen_testers/test/dut.rb', line 55 def startup() $tester.set_timeset('tp0', 60) end |
#write_register(reg, options = {}) ⇒ Object
59 60 61 |
# File 'lib/origen_testers/test/dut.rb', line 59 def write_register(reg, = {}) arm_debug.write_register(reg, ) end |