Class: OrigenTesters::IGXLBasedTester::Base
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Base
- Includes:
- VectorBasedTester
- Defined in:
- lib/origen_testers/igxl_based_tester/base.rb,
lib/origen_testers/igxl_based_tester/base/flow.rb,
lib/origen_testers/igxl_based_tester/base/patset.rb,
lib/origen_testers/igxl_based_tester/base/patsets.rb,
lib/origen_testers/igxl_based_tester/base/patsubr.rb,
lib/origen_testers/igxl_based_tester/base/patgroup.rb,
lib/origen_testers/igxl_based_tester/base/patsubrs.rb,
lib/origen_testers/igxl_based_tester/base/flow_line.rb,
lib/origen_testers/igxl_based_tester/base/generator.rb,
lib/origen_testers/igxl_based_tester/base/patgroups.rb,
lib/origen_testers/igxl_based_tester/base/test_instance.rb,
lib/origen_testers/igxl_based_tester/base/patset_pattern.rb,
lib/origen_testers/igxl_based_tester/base/test_instances.rb,
lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb,
lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
Overview
This is the base class of all IGXL-based testers
Defined Under Namespace
Modules: Generator Classes: Flow, FlowLine, Patgroup, Patgroups, Patset, PatsetPattern, Patsets, Patsubr, PatsubrPattern, Patsubrs, TestInstance, TestInstanceGroup, TestInstances
Instance Attribute Summary collapse
-
#memory_test_en ⇒ Object
Returns the value of attribute memory_test_en.
-
#pattern_compiler_pinmap ⇒ Object
Returns the value of attribute pattern_compiler_pinmap.
-
#software_version ⇒ Object
Returns the value of attribute software_version.
Instance Method Summary collapse
- #assign_dc_instr_pins(dc_pins) ⇒ Object
-
#branch_to(label) ⇒ Object
(also: #branch)
Branch execution to the given point.
-
#call_match ⇒ Object
Call a match loop.
-
#call_subroutine(name, options = {}) ⇒ Object
Call a subroutine.
-
#called_subroutines ⇒ Object
Returns an array of subroutines called while generating the current pattern.
- #cycle(options = {}) ⇒ Object
- #enable_flag(options = {}) ⇒ Object
-
#end_subroutine(cond = false) ⇒ Object
End a subroutine.
- #flows ⇒ Object
-
#format_vector(vec) ⇒ Object
This is an internal method use by Origen which returns a fully formatted vector You can override this if you wish to change the output formatting at vector level.
-
#freq_count(pin, options = {}) ⇒ Object
Do a frequency measure.
- #get_dc_instr_pins ⇒ Object
- #ignore_fails(*pins) ⇒ Object
-
#initialize ⇒ Base
constructor
Returns a new IGXLBasedTester instance, normally there would only ever be one of these assigned to the global variable such as $tester by your target.
-
#label(name, global = false) ⇒ Object
Apply a label to the pattern.
-
#local_subroutines ⇒ Object
Returns an array of subroutines created by the current pattern.
-
#loop_vectors(name, number_of_loops, global = false, label_first = false) ⇒ Object
(also: #loop_vector)
Add loop to the pattern.
- #mask_fails(setclr) ⇒ Object
-
#match(pin, state, timeout, options = {}) ⇒ Object
Generates a match loop on up to two pins.
-
#memory_test(options = {}) ⇒ Object
-
J750 Specific *.
-
-
#parser(prog_dir = Origen.config.test_program_output_directory) ⇒ Object
Main accessor to all content parsed from existing test program sheets found in the supplied directory or in Origen.config.test_program_output_directory.
-
#pattern_footer(options = {}) ⇒ Object
An internal method called by Origen to generate the pattern footer.
-
#pattern_header(options = {}) {|pin_list| ... } ⇒ Object
An internal method called by Origen Pattern Create to create the pattern header.
-
#push_microcode(code) ⇒ Object
(also: #microcode)
Override this to force the formatting to match the v1 J750 model (easier diffs).
-
#repeat_previous ⇒ Object
All vectors generated with the supplied block will have all pins set to the repeat previous state.
-
#set_code(code) ⇒ Object
-
J750 Specific *.
-
- #set_flag(options = {}) ⇒ Object
-
#start_subroutine(name) ⇒ Object
Start a subroutine.
-
#store(*pins) ⇒ Object
(also: #to_hram, #capture)
Capture a vector to the tester HRAM.
-
#store_next_cycle(*pins) ⇒ Object
(also: #store!)
Capture the next vector generated to HRAM.
Methods included from VectorBasedTester
Constructor Details
#initialize ⇒ Base
Returns a new IGXLBasedTester instance, normally there would only ever be one of these assigned to the global variable such as $tester by your target.
16 17 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 43 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 16 def initialize @unique_counter = 0 @counter_lsb_bits = 0 @counter_msb_bits = 0 @max_repeat_loop = 65_535 # 16 bits @min_repeat_loop = 2 @pat_extension = 'atp' @active_loads = true @pipeline_depth = 34 @software_version = '' @compress = true @support_repeat_previous = true @match_entries = 10 @name = '' @program_comment_char = ['logprint', "'"] @opcode_mode = :extended @flags = %w(cpuA cpuB cpuC cpuD) @microcode = {} @microcode[:enable] = 'enable' @microcode[:set_flag] = 'set_cpu' @microcode[:mask_vector] = 'ign ifc icc' @mask_vector = false # sticky option to mask all subsequent vectors @min_pattern_vectors = 0 # no minimum @memory_test_en = false # memory test enabled (for all patterns?) end |
Instance Attribute Details
#memory_test_en ⇒ Object
Returns the value of attribute memory_test_en.
9 10 11 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 9 def memory_test_en @memory_test_en end |
#pattern_compiler_pinmap ⇒ Object
Returns the value of attribute pattern_compiler_pinmap.
8 9 10 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 8 def pattern_compiler_pinmap @pattern_compiler_pinmap end |
#software_version ⇒ Object
Returns the value of attribute software_version.
7 8 9 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 7 def software_version @software_version end |
Instance Method Details
#assign_dc_instr_pins(dc_pins) ⇒ Object
45 46 47 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 45 def assign_dc_instr_pins(dc_pins) @dc_pins = dc_pins end |
#branch_to(label) ⇒ Object Also known as: branch
Branch execution to the given point.
This generates a new vector with a jump instruction to a given label. This method will generate an additional vector.
Examples
$tester.branch_to("something_significant")
406 407 408 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 406 def branch_to(label) cycle(microcode: "jump #{label}") end |
#call_match ⇒ Object
Call a match loop.
Normally you would put your match loop in a global subs pattern, then you can call it via this method. This method automatically syncs match loop naming with the match generation flow, no arguments required.
This is an IGXLBasedTester specific API.
Examples
$tester.cycle
$tester.call_match # Calls the match loop, or the first entry point if you have multiple
$tester.cycle
$tester.call_match # Calls the match loop, or the second entry point if you have multiple
365 366 367 368 369 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 365 def call_match @match_counter = @match_counter || 0 call_subroutine("match_done_#{@match_counter}") @match_counter += 1 unless @match_counter == (@match_entries || 1) - 1 end |
#call_subroutine(name, options = {}) ⇒ Object
Call a subroutine.
This method applies a call subroutine opcode to the previous vector, it does not generate a new vector.
Subroutines should always be called through this method as it ensures a running log of called subroutines is maintained and which then gets output in the pattern header to import the right dependencies.
An offset option is available to make the call on earlier vectors.
Examples
$tester.call_subroutine("mysub")
$tester.call_subroutine("my_other_sub", :offset => -1)
132 133 134 135 136 137 138 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 132 def call_subroutine(name, = {}) = { offset: 0 }.merge() called_subroutines << name.to_s.chomp unless called_subroutines.include?(name.to_s.chomp) || @inhibit_vectors update_vector microcode: "call #{name}", offset: [:offset] end |
#called_subroutines ⇒ Object
Returns an array of subroutines called while generating the current pattern
548 549 550 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 548 def called_subroutines @called_subroutines ||= [] end |
#cycle(options = {}) ⇒ Object
629 630 631 632 633 634 635 636 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 629 def cycle( = {}) if @mask_vector # tack on masking opcodes super(.merge(microcode: "#{[:microcode]} #{@microcode[:mask_vector]}")) else super() end end |
#enable_flag(options = {}) ⇒ Object
607 608 609 610 611 612 613 614 615 616 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 607 def enable_flag( = {}) = { flagnum: 4, # default flag to use }.merge() if [:flagnum] > @flags.length abort "ERROR! Invalid flag value passed to 'enable_flag' method!\n" end flagname = @flags[[:flagnum] - 1] update_vector(microcode: "#{@microcode[:enable]}(#{flagname})") end |
#end_subroutine(cond = false) ⇒ Object
End a subroutine.
Generates a return opcode on the last vector.
Examples
$tester.start_subroutine("wait_for_done")
< generate your subroutine vectors here >
$tester.end_subroutine
cond: whether return is conditional on a flag (to permit to mix subrs together)
163 164 165 166 167 168 169 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 163 def end_subroutine(cond = false) if cond update_vector microcode: 'if (flag) return' else update_vector microcode: 'return' end end |
#flows ⇒ Object
53 54 55 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 53 def flows parser.flows end |
#format_vector(vec) ⇒ Object
This is an internal method use by Origen which returns a fully formatted vector You can override this if you wish to change the output formatting at vector level
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 559 def format_vector(vec) timeset = vec.timeset ? "> #{vec.timeset.name}" : '' pin_vals = vec.pin_vals ? "#{vec.pin_vals} ;" : '' if vec.repeat > 1 microcode = "repeat #{vec.repeat}" else microcode = vec.microcode ? vec.microcode : '' end if vec.pin_vals && ($_testers_enable_vector_comments || vector_comments) comment = " // #{vec.number}:#{vec.cycle} #{vec.inline_comment}" else comment = vec.inline_comment.empty? ? '' : " // #{vec.inline_comment}" end "#{microcode.ljust(65)}#{timeset.ljust(31)}#{pin_vals}#{comment}" end |
#freq_count(pin, options = {}) ⇒ Object
Do a frequency measure.
Write the necessary micro code to do a frequency measure on the given pin, optionally supply a read code to pass information to the tester.
Examples
$tester.freq_count($top.pin(:d_out)) # Freq measure on pin "d_out"
$tester.freq_count($top.pin(:d_out):readcode => 10)
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 179 def freq_count(pin, = {}) = { readcode: false }.merge() set_code([:readcode]) if [:readcode] cycle(microcode: "#{@microcode[:set_flag]} (cpuA)") cycle(microcode: "#{@microcode[:set_flag]} (cpuA)") cycle(microcode: "#{@microcode[:set_flag]} (cpuB)") cycle(microcode: "#{@microcode[:set_flag]} (cpuC)") cycle(microcode: 'freq_loop_1:') cycle(microcode: 'if (cpuA) jump freq_loop_1') pin.drive_lo delay(2000) pin.dont_care cycle(microcode: "freq_loop_2: #{@microcode[:enable]} (#{@flags[1]})") cycle(microcode: 'if (flag) jump freq_loop_2') cycle(microcode: "#{@microcode[:enable]} (#{@flags[2]})") cycle(microcode: 'if (flag) jump freq_loop_1') end |
#get_dc_instr_pins ⇒ Object
49 50 51 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 49 def get_dc_instr_pins @dc_pins end |
#ignore_fails(*pins) ⇒ Object
601 602 603 604 605 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 601 def ignore_fails(*pins) pins.each(&:suspend) yield pins.each(&:resume) end |
#label(name, global = false) ⇒ Object
Apply a label to the pattern.
No additional vector is generated. Arguments:
name : label name
global : (optional) whether to apply global label, default=false
Examples
$tester.label("something_significant")
$tester.label("something_significant",true) # apply global label
381 382 383 384 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 381 def label(name, global = false) global_opt = (global) ? 'global ' : '' microcode global_opt + name + ':' end |
#local_subroutines ⇒ Object
Returns an array of subroutines created by the current pattern
553 554 555 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 553 def local_subroutines # :nodoc: @local_subroutines ||= [] end |
#loop_vectors(name, number_of_loops, global = false, label_first = false) ⇒ Object Also known as: loop_vector
Add loop to the pattern.
Pass in a name for the loop and the number of times to execute it, all vectors generated by the given block will be captured in the loop.
Optional arguments: global - whether to apply global label (default=false)
label_first - whether to apply loop label before loop vector or not
Examples
$tester.loop_vectors("pulse_loop", 3) do # Do this 3 times...
$tester.cycle
some_other_method_to_generate_vectors
end
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 424 def loop_vectors(name, number_of_loops, global = false, label_first = false) if number_of_loops > 1 @loop_counters ||= {} if @loop_counters[name] @loop_counters[name] += 1 else @loop_counters[name] = 0 end loop_name = @loop_counters[name] == 0 ? name : "#{name}_#{@loop_counters[name]}" if label_first global_opt = (global) ? 'global ' : '' microcode "#{global_opt}#{loop_name}: " end cycle(microcode: "loopA #{number_of_loops}") unless label_first global_opt = (global) ? 'global ' : '' cycle(microcode: "#{global_opt}#{loop_name}: ") end yield cycle(microcode: "end_loopA #{loop_name}") else yield end end |
#mask_fails(setclr) ⇒ Object
638 639 640 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 638 def mask_fails(setclr) @mask_vector = setclr end |
#match(pin, state, timeout, options = {}) ⇒ Object
Generates a match loop on up to two pins.
This method is not really intended to be called directly, rather you should call via Tester#wait e.g. $tester.wait(:match => true).
The timeout should be provided in cycles, however when called via the wait method the time-based helpers (time_in_us, etc) will be converted to cycles for you. The following options are available to tailor the match loop behavior, defaults in parenthesis:
-
:pin - The pin object to match on (required)
-
:state - The pin state to match on, :low or :high (required)
-
:pin2 (nil) - Optionally supply a second pin to match on
-
:state2 (nil) - State for the second pin (required if :pin2 is supplied)
-
:check_for_fails (false) - Flushes the pipeline and handshakes with the tester (passing readcode 100) prior to the match (to allow binout of fails encountered before the match)
-
:force_fail_on_timeout (true) - Force a vector mis-compare if the match loop times out
-
:on_timeout_goto (“”) - Optionally supply a label to branch to on timeout, by default will continue from the end of the match loop
-
:on_pin_match_goto (“”) - Optionally supply a label to branch to when pin 1 matches, by default will continue from the end of the match loop
-
:on_pin2_match_goto (“”) - Optionally supply a label to branch to when pin 2 matches, by default will continue from the end of the match loop
-
:multiple_entries (false) - Supply an integer to generate multiple entries into the match (each with a unique readcode), this can be useful when debugging patterns with multiple matches
-
:force_fail_on_timeout (true) - force pattern to fail if timeout occurs
-
:global_loops (false) - whether match loop loops should use global labels
-
:manual_stop (false) - whether to use extra cpuB flag to resolve IG-XL v.3.50.xx bug where VBT clears cpuA immediately
at start of PatFlagFunc instead of at end. Use will have to manually clear cpuB to resume this pattern.
Examples
$tester.wait(:match => true, :time_in_us => 5000, :pin => $top.pin(:done), :state => :high)
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 303 def match(pin, state, timeout, = {}) = { check_for_fails: false, on_timeout_goto: false, pin2: false, state2: false, on_pin_match_goto: false, multiple_entries: false, force_fail_on_timeout: true, global_loops: false, manual_stop: false, clr_fail_post_match: false }.merge() match_block(timeout, ) do |match_conditions, fail_conditions| # Define match conditions match_conditions.add do state == :low ? pin.expect_lo : pin.expect_hi cc "Check if #{pin.name} is #{state == :low ? 'low' : 'high'}" cycle pin.dont_care end if [:pin2] match_conditions.add do state == :low ? pin.expect_hi : pin.expect_lo [:state2] == :low ? [:pin2].expect_lo : [:pin2].expect_hi cc "Check if #{[:pin2].name} is #{[:state2] == :low ? 'low' : 'high'}" cycle [:pin2].dont_care pin.dont_care end end # Define fail conditions fail_conditions.add do state == :low ? pin.expect_lo : pin.expect_hi cc "Check if #{pin.name} is #{state == :low ? 'low' : 'high'}" if [:pin2] [:state2] == :low ? [:pin2].expect_lo : [:pin2].expect_hi cc "Check if #{[:pin2].name} is #{[:state2] == :low ? 'low' : 'high'}" end cycle pin.dont_care [:pin2].dont_care if [:pin2] end end end |
#memory_test(options = {}) ⇒ Object
-
J750 Specific *
Generates a single MTO opcode line for J750
Codes implemented: xa load_preset, xa inc, ya load_preset, ya inc, stv_m0, stv_m1, stv_c
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 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 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 204 def memory_test( = {}) = { gen_vector: true, # Default generate vector not just MTO opcode init_counter_x: false, # initialize counter X inc_counter_x: false, # increment counter X init_counter_y: false, # initialize counter X inc_counter_y: false, # increment counter X capture_vector: false, # capture vector to memory using all mem types capture_vector_mem0: false, # capture vector to memory type 0, here for J750 will be stv_m0 capture_vector_mem1: false, # capture vector to memory type 1, here for J750 will be stv_m1 capture_vector_mem2: false, # capture vector to memory type 2, here for J750 will be stv_c pin: false, # pin on which to drive or expect data, pass pin object here! pin_data: false, # pin data (:none, :drive, :expect) }.merge() mto_opcode = '' if [:init_counter_x] mto_opcode += ' xa load_preset' end if [:inc_counter_x] mto_opcode += ' xa inc' end if [:init_counter_y] mto_opcode += ' ya load_preset' end if [:inc_counter_y] mto_opcode += ' ya inc' end if [:capture_vector] mto_opcode += ' stv_m0 stv_m1 stv_c' end if [:capture_vector_mem0] mto_opcode += ' stv_m0' end if [:capture_vector_mem1] mto_opcode += ' stv_m1' end if [:capture_vector_mem2] mto_opcode += ' stv_c' end unless mto_opcode.eql?('') mto_opcode = '(mto:' + mto_opcode + ')' end if [:gen_vector] if [:pin] case [:pin_data] when :drive # store current pin state cur_pin_state = [:pin].state.to_sym [:pin].drive_mem when :expect # store current pin state cur_pin_state = [:pin].state.to_sym [:pin].expect_mem end end cycle(microcode: "#{mto_opcode}") if [:pin] # restore previous pin state case [:pin_data] when :drive [:pin].state = cur_pin_state when :expect [:pin].state = cur_pin_state end end else microcode "#{mto_opcode}" end end |
#parser(prog_dir = Origen.config.test_program_output_directory) ⇒ Object
Main accessor to all content parsed from existing test program sheets found in the supplied directory or in Origen.config.test_program_output_directory
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 59 def parser(prog_dir = Origen.config.test_program_output_directory) unless prog_dir fail 'You must supply the directory containing the test program sheets, or define it via Origen.config.test_program_output_directory' end @parser ||= IGXLBasedTester::Parser.new @parsed_dir ||= false if @parsed_dir != prog_dir @parser.parse(prog_dir) @parsed_dir = prog_dir end @parser end |
#pattern_footer(options = {}) ⇒ Object
An internal method called by Origen to generate the pattern footer
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 522 def ( = {}) = { subroutine_pat: false, end_in_ka: false, end_with_halt: false, end_module: true }.merge() $tester.align_to_last # cycle(:microcode => "#{$dut.end_of_pattern_label}:") if $dut.end_of_pattern_label if [:end_in_ka] $tester.cycle microcode: 'keep_alive' else if [:end_with_halt] $tester.cycle microcode: 'halt' else if [:end_module] $tester.cycle microcode: 'end_module' unless [:subroutine_pat] else $tester.cycle end end end microcode '}' end |
#pattern_header(options = {}) {|pin_list| ... } ⇒ Object
An internal method called by Origen Pattern Create to create the pattern header
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 451 def pattern_header( = {}) = { instruments: {}, # Provide instruments here if desired as a hash (e.g. "mto" => "dgen_2bit") subroutine_pat: false, svm_only: true, # Whether 'svm_only' can be specified group: false, # If true the end pattern is intended to run within a pattern group high_voltage: false, # Supply a pin name here to declare it as an HV instrument (not yet defined) freq_counter: false, # Supply a pin name here to declare it as a frequency counter memory_test: false, # If true, define 2-bit MTO DGEN as instrument }.merge() if level_period? microcode "import tset #{min_period_timeset.name};" else called_timesets.each do |timeset| microcode "import tset #{timeset.name};" end end unless [:group] # Withhold imports for pattern groups, is this correct? called_subroutines.each do |sub_name| # Don't import any called subroutines that are declared in the current pattern microcode "import svm_subr #{sub_name};" unless local_subroutines.include?(sub_name) end end # If memory test, then add to instruments hash if [:memory_test] [:instruments].merge!('mto' => 'dgen_2bit') end if [:svm_only] microcode "svm_only_file = #{[:subroutine_pat] ? 'yes' : 'no'};" end microcode "opcode_mode = #{@opcode_mode};" microcode "digital_inst = #{[:digital_inst]};" if [:digital_inst] microcode 'compressed = yes;' # if $dut.gzip_patterns # Take care of any instruments if [:instruments].length > 0 microcode 'instruments = {' [:instruments].each do |instrument, setting| if "#{setting}" == 'nil' microcode " #{instrument};" else microcode " #{instrument}:#{setting};" end end microcode '}' end [:high_voltage] = @use_hv_pin microcode "pin_setup = {#{[:high_voltage]} high_voltage;}" if [:high_voltage] microcode "pin_setup = {#{[:freq_counter]} freq_count;}" if [:freq_counter] microcode '' pin_list = ordered_pins.map(&:name).join(', ') # here indicate pattern header specific stuff yield pin_list if ordered_pins.size > 0 max_pin_name_length = ordered_pins.map(&:name).max { |a, b| a.length <=> b.length }.length pin_widths = ordered_pins.map { |p| p.size - 1 } max_pin_name_length.times do |i| cc((' ' * 93) + ordered_pins.map.with_index { |p, x| ((p.name[i] || ' ') + ' ' * pin_widths[x]).gsub('_', '-') }.join(' ')) end end end |
#push_microcode(code) ⇒ Object Also known as: microcode
Override this to force the formatting to match the v1 J750 model (easier diffs)
577 578 579 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 577 def push_microcode(code) # :nodoc: stage.store(code.ljust(65) + ''.ljust(31)) end |
#repeat_previous ⇒ Object
All vectors generated with the supplied block will have all pins set to the repeat previous state. Any pins that are changed state within the block will still update to the supplied value.
Example
# All pins except invoke will be assigned the repeat previous code
# in the generated vector. On completion of the block they will
# return to their previous state, except for invoke which will
# retain the value assigned within the block.
$tester.repeat_previous do
$top.pin(:invoke).drive(1)
$tester.cycle
end
594 595 596 597 598 599 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 594 def repeat_previous pinmap = Origen.pin_bank.pins pinmap.each { |id, pin| pin.repeat_previous = true } yield pinmap.each { |id, pin| pin.repeat_previous = false } end |
#set_code(code) ⇒ Object
-
J750 Specific *
Set a readcode.
Use the set an explicit readcode for communicating with the tester. This method will generate an additional vector.
Examples
$tester.set_code(55)
395 396 397 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 395 def set_code(code) cycle(microcode: "set_code #{code}") end |
#set_flag(options = {}) ⇒ Object
618 619 620 621 622 623 624 625 626 627 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 618 def set_flag( = {}) = { flagnum: 4, # default flag to use }.merge() if [:flagnum] > @flags.length abort "ERROR! Invalid flag value passed to 'set_flag' method!\n" end flagname = @flags[[:flagnum] - 1] update_vector(microcode: "#{@microcode[:set_flag]}(#{flagname})") end |
#start_subroutine(name) ⇒ Object
Start a subroutine.
Generates a global subroutine label. Global is used to adhere to the best practice of containing all subroutines in dedicated patterns, e.g. global_subs.atp
Examples
$tester.start_subroutine("wait_for_done")
< generate your subroutine vectors here >
$tester.end_subroutine
149 150 151 152 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 149 def start_subroutine(name) local_subroutines << name.to_s.chomp unless local_subroutines.include?(name.to_s.chomp) || @inhibit_vectors microcode "global subr #{name}:" end |
#store(*pins) ⇒ Object Also known as: to_hram, capture
Capture a vector to the tester HRAM.
This method applies a store vector (stv) opcode to the previous vector, note that is does not actually generate a new vector.
Sometimes when generating vectors within a loop you may want to apply a stv opcode retrospectively to a previous vector, passing in an offset option will allow you to do this.
On J750 the pins argument is ignored since the tester only supports whole vector capture.
91 92 93 94 95 96 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 91 def store(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { offset: 0 }.merge() update_vector microcode: 'stv', offset: [:offset] end |
#store_next_cycle(*pins) ⇒ Object Also known as: store!
Capture the next vector generated to HRAM
This method applies a store vector (stv) opcode to the next vector to be generated, note that is does not actually generate a new vector.
On J750 the pins argument is ignored since the tester only supports whole vector capture.
110 111 112 113 114 115 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 110 def store_next_cycle(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { }.merge() preset_next_vector microcode: 'stv' end |