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/job.rb,
lib/origen_testers/igxl_based_tester/base/edge.rb,
lib/origen_testers/igxl_based_tester/base/flow.rb,
lib/origen_testers/igxl_based_tester/base/jobs.rb,
lib/origen_testers/igxl_based_tester/base/edges.rb,
lib/origen_testers/igxl_based_tester/base/levels.rb,
lib/origen_testers/igxl_based_tester/base/patset.rb,
lib/origen_testers/igxl_based_tester/base/pinmap.rb,
lib/origen_testers/igxl_based_tester/base/edgeset.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/timeset.rb,
lib/origen_testers/igxl_based_tester/base/edgesets.rb,
lib/origen_testers/igxl_based_tester/base/levelset.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/timesets.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/references.rb,
lib/origen_testers/igxl_based_tester/base/ac_specsets.rb,
lib/origen_testers/igxl_based_tester/base/dc_specsets.rb,
lib/origen_testers/igxl_based_tester/base/level_io_se.rb,
lib/origen_testers/igxl_based_tester/base/global_specs.rb,
lib/origen_testers/igxl_based_tester/base/level_supply.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/timesets_basic.rb,
lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb,
lib/origen_testers/igxl_based_tester/base/test_instance_group.rb,
lib/origen_testers/igxl_based_tester/base/custom_test_instance.rb,
lib/origen_testers/igxl_based_tester/base/test_instances/custom_til.rb
Overview
This is the base class of all IGXL-based testers
Defined Under Namespace
Modules: Generator Classes: ACSpecsets, CustomTestInstance, DCSpecsets, Edge, Edges, Edgeset, Edgesets, Flow, FlowLine, GlobalSpecs, Job, Jobs, Levels, Levelset, Patgroup, Patgroups, Patset, PatsetPattern, Patsets, Patsubr, PatsubrPattern, Patsubrs, PinLevelSingle, Pinmap, References, SupplyLevel, TestInstance, TestInstanceGroup, TestInstances, Timeset, Timesets, TimesetsBasic
Instance Attribute Summary collapse
-
#channelmap ⇒ Object
Returns the value of attribute channelmap.
-
#default_channelmap ⇒ Object
Returns the value of attribute default_channelmap.
-
#default_testerconfig ⇒ Object
Returns the value of attribute default_testerconfig.
-
#literal_enables ⇒ Object
whether enables should be exactly as indicated.
-
#literal_flags ⇒ Object
Control literal flag definitions.
-
#max_site ⇒ Object
Returns the value of attribute max_site.
-
#memory_test_en ⇒ Object
Returns the value of attribute memory_test_en.
-
#min_repeat_loop ⇒ Object
(also: #min_repeat_count)
permit modification of minimum repeat count.
-
#pattern_compiler_pinmap ⇒ Object
Returns the value of attribute pattern_compiler_pinmap.
-
#software_version ⇒ Object
Returns the value of attribute software_version.
-
#testerconfig ⇒ Object
Returns the value of attribute testerconfig.
Attributes included from API
#capture_style, #comment_level, #generating, #includes, #overlay_style
Attributes included from Timing
#level_period, #timing_toggled_pins
Attributes included from VectorGenerator
#compress, #expand_repeats, #vector_comments
Instance Method Summary collapse
- #apply_digcap_settings(options = {}) ⇒ Object
- #apply_digsrc_settings(options = {}) ⇒ Object
- #assign_dc_instr_pins(dc_pins) ⇒ Object
- #assign_digcap_pins(digcap_pins) ⇒ Object
- #assign_digsrc_pins(digsrc_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
-
#digcap_store(pins) ⇒ Object
Call this method before each tester cycle to inser the digcap overlay microcode.
-
#digsrc_overlay(options = {}) ⇒ Object
Perform digsrc overlay (called by tester.cycle).
-
#digsrc_send(pins) ⇒ Object
Call this method before each tester cycle to insert the digsrc overlay microcode.
-
#digsrc_skip_start(pin_or_group) ⇒ Object
Disable the automatic addition of the digsrc start command at the beginning of the pattern.
-
#digsrc_start(pins, options = {}) ⇒ Object
Call this method at the start of any digsrc overlay operations, this method takes care of all the microcodes and delays that's needed for digsrc overlay Required arguments: pins Optionsal arguments: options = :single or :dual, anything else wil be treated as if it's operating in :quad mode.
-
#digsrc_stop(pins, options = {}) ⇒ Object
Call this method at the end of each digscr overlay operation to clear the pattern memory pipeline, so that the pattern is ready to do the next digsrc overlay operation.
- #enable_flag(options = {}) ⇒ Object
-
#end_subroutine(cond = false, options = {}) ⇒ Object
End a subroutine.
- #flows ⇒ Object
-
#format_multiple_instrument_pins(pins, options = {}) ⇒ Object
Call this method if there are more than one pin/pin groups used with an instrument, this method will format an array of pins into the correct format required by igxl pattern microcodes.
-
#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
- #get_digcap_pins ⇒ Object
- #get_digsrc_pins ⇒ Object
-
#get_instrument_slots(testconfigname, instrument) ⇒ Object
testconfigname example “WT”, “FT”, “Production”.
- #get_tester_channel(chanmapname, pinname, sitenum) ⇒ Object
- #get_tester_instrument(testconfigname, slot) ⇒ Object
- #ignore_fails(*pins) ⇒ Object
- #igxl_based? ⇒ Boolean
- #import_chanmap(chanmapname, fullchanmappath) ⇒ Object
- #import_tester_config(testconfigname, fullconfigpath) ⇒ Object
-
#initialize(options = {}) ⇒ 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.
-
#is_hexvs_plus(testconfigname, slot) ⇒ Object
Check if a specific HexVS supply is HexVS+ variety, which has /-2mV accuracy as opposed to /-7mV accuracy.
-
#is_vhdvs_hc(chanmapname, pinname, sitenum) ⇒ Object
Check if a specific VHDVS (UVS256) channel assignment is _HC variety (high-current) If the specific VHDVS channel is _HC variety, returns a “_HC” string, otherwise nil.
-
#is_vhdvs_plus(testconfigname, slot) ⇒ Object
Check if a specific VHDVS (UVS256) supply is High-Accuracy (HA) variety, which has /-5mV0.1%*SUPPLY accuracy as opposed to /-10mV0.1%*SUPPLY accuracy.
-
#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 *.
-
-
#merged_channels(chanmapname, pinname, sitenum) ⇒ Object
Check if a specific pin for a given channelmap for a given site number is using merged channel.
-
#overlay_style_warn(overlay_str, options) ⇒ Object
Warn user of unsupported overlay style.
-
#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_instrument(pin_spec, instrument_def) ⇒ Object
Similar to push_microcode, but for the instrument statement in the pattern header.
-
#push_microcode(code) ⇒ Object
(also: #microcode)
Override this to force the formatting to match the v1 J750 model (easier diffs).
- #remove_store_from_vector(vector) ⇒ Object private
-
#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, options = {}) ⇒ 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.
-
#subroutine_overlay(sub_name, options = {}) ⇒ Object
Implement subroutine overlay, called by tester.cycle.
Methods included from VectorBasedTester
Methods included from API
#annotate, #any_clocks_running?, #c1, #c2, #capture_memory, #capture_memory_config, #clocks_running, #comment_char, #comment_char=, #d10?, #diff_friendly_output=, #diff_friendly_output?, #doc?, #generate?, #generating_pattern?, #generating_program?, #igxl?, #import_test_time, #inhibit_vectors_and_comments, #is_command_based?, #is_vector_based?, #j750?, #j750_hpt?, #link?, #name, #pat_extension, #pattern_section, #pins_need_toggling, #pop_running_clock, #program_comment_char, #program_comment_char=, #push_running_clock, #pxie6570?, #slice_repeats, #smt7?, #smt8?, #snip, #source_memory, #source_memory_config, #ss, #step_comment_prefix, #stil?, #transaction, #ultraflex?, #update_running_clocks, #v93k?
Methods included from Timing
_set_timeset_, called_timesets, called_timesets_by_name, current_period_in_ns, current_timeset, lookup_or_register_timeset, min_period_timeset, period_in_ns, period_in_secs, reset!, set_timeset, timeset, timeset?, timeset_changed, timesets, timesets!
Methods included from Timing::TimingAPI
#before_timeset_change, #called_timesets, #called_timesets_by_name, #count, #current_period_in_ns, #current_timeset, #cycles_to_time, #delay, #max_repeat_loop, #min_period_timeset, #period_in_ns, #period_in_secs, #set_timeset, #timeset?, #timesets, #timing_toggled_pins, #wait
Methods included from VectorGenerator
#_render, #add_microcode_to_last_or_cycle, #align, #align_to_last, #before_write_pattern_line, #current_pin_vals, #cycle_count, #dec_vec_count, #dont_compress, #dont_compress=, #execution_time_in_ns, #expand_vector, #format, #format_pin_state, #get_pingroup, #inc_cycle_count, #inc_vec_count, #inhibit_pin, #inhibited_pins, #last_object, #last_vector, #ordered_pins, #ordered_pins_cache, #ordered_pins_name, #pingroup_map, #pipeline, #preset_next_vector, #push_comment, #push_vector, #regex_for_pin, #regex_for_pin_sub, #render, #render_body, #render_footer, #render_header, #render_template, #reset_cycle_count, #stage, #track_and_format_comment, #track_and_format_vector, #update_pin_from_formatted_state, #update_vector, #update_vector_pin_val, #vec_count, #vector_group_size, #vector_group_size=, #with_vector_group_size
Constructor Details
#initialize(options = {}) ⇒ 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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 36 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 = OrigenTesters::IGXLBasedTester.pat_extension @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?) @testerconfig ||= {} @channelmap ||= {} @pushed_instrument_configs = {} @overlay_style = :subroutine # default to use subroutine for overlay @capture_style = :hram # default to use hram for capture @overlay_history = {} # used to track labels, subroutines, digsrc pins used etc @overlay_subr = nil @capture_history = {} if [:literal_flags] @literal_flags = true end if [:literal_enables] @literal_enables = true end end |
Instance Attribute Details
#channelmap ⇒ Object
Returns the value of attribute channelmap.
18 19 20 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 18 def channelmap @channelmap end |
#default_channelmap ⇒ Object
Returns the value of attribute default_channelmap.
19 20 21 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 19 def default_channelmap @default_channelmap end |
#default_testerconfig ⇒ Object
Returns the value of attribute default_testerconfig.
20 21 22 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 20 def default_testerconfig @default_testerconfig end |
#literal_enables ⇒ Object
whether enables should be exactly as indicated
29 30 31 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 29 def literal_enables @literal_enables end |
#literal_flags ⇒ Object
Control literal flag definitions
28 29 30 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 28 def literal_flags @literal_flags end |
#max_site ⇒ Object
Returns the value of attribute max_site.
21 22 23 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 21 def max_site @max_site end |
#memory_test_en ⇒ Object
Returns the value of attribute memory_test_en.
16 17 18 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 16 def memory_test_en @memory_test_en end |
#min_repeat_loop ⇒ Object Also known as: min_repeat_count
permit modification of minimum repeat count
23 24 25 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 23 def min_repeat_loop @min_repeat_loop end |
#pattern_compiler_pinmap ⇒ Object
Returns the value of attribute pattern_compiler_pinmap.
15 16 17 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 15 def pattern_compiler_pinmap @pattern_compiler_pinmap end |
#software_version ⇒ Object
Returns the value of attribute software_version.
14 15 16 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 14 def software_version @software_version end |
#testerconfig ⇒ Object
Returns the value of attribute testerconfig.
17 18 19 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 17 def testerconfig @testerconfig end |
Instance Method Details
#apply_digcap_settings(options = {}) ⇒ Object
985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 985 def apply_digcap_settings( = {}) .merge!(digcap_width: 8) if [:digcap_width].nil? # default to digcap 8 .merge!(digcap_bit_order: :lsb) if [:digcap_bit_order].nil? # default to lsb .merge!(digcap_mode: :serial) if [:digcap_mode].nil? # default to serial mode .merge!(digcap_site_uniqueness: :unique_sites) if [:digcap_site_uniqueness].nil? # default to unique sites .merge!(digcap_format: :binary) if [:digcap_format].nil? # default to binary .merge!(digcap_data_type: :default) if [:digcap_data_type].nil? # default to default .merge!(digcap_auto_cond: :auto_cond_disable) if [:digcap_auto_cond].nil? # default to disable .merge!(digcap_auto_trig_enable: :auto_trig_disable) if [:digcap_auto_trig_enable].nil? # default to disable .merge!(digcap_store_stv: :store_stv_disable) if [:digcap_store_stv].nil? # default to disable .merge!(digcap_receive_data: :store_stv_disable) if [:digcap_receive_data].nil? # default to logic @digcap_settings = end |
#apply_digsrc_settings(options = {}) ⇒ Object
974 975 976 977 978 979 980 981 982 983 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 974 def apply_digsrc_settings( = {}) .merge!(digsrc_width: 1) if [:digsrc_width].nil? # default to digsrc 1 .merge!(digsrc_bit_order: :lsb) if [:digsrc_bit_order].nil? # default to lsb .merge!(digsrc_mode: :serial) if [:digsrc_mode].nil? # default to serial mode .merge!(digsrc_format: :binary) if [:digsrc_format].nil? # default to binary .merge!(digsrc_site_uniqueness: :unique_sites) if [:digsrc_site_uniqueness].nil? # default to unique sites .merge!(digsrc_data_type: :default) if [:digsrc_data_type].nil? # default to default .merge!(digsrc_auto_cond: :auto_cond_disable) if [:digsrc_auto_cond].nil? # default to disable @digsrc_settings = end |
#assign_dc_instr_pins(dc_pins) ⇒ Object
220 221 222 223 224 225 226 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 220 def assign_dc_instr_pins(dc_pins) if !dc_pins.is_a?(Array) @dc_pins = [] << dc_pins else @dc_pins = dc_pins end end |
#assign_digcap_pins(digcap_pins) ⇒ Object
236 237 238 239 240 241 242 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 236 def assign_digcap_pins(digcap_pins) if !digcap_pins.is_a?(Array) @digcap_pins = [] << digcap_pins else @digcap_pins = digcap_pins end end |
#assign_digsrc_pins(digsrc_pins) ⇒ Object
228 229 230 231 232 233 234 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 228 def assign_digsrc_pins(digsrc_pins) if !digsrc_pins.is_a?(Array) @digsrc_pins = [] << digsrc_pins else @digsrc_pins = digsrc_pins end 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")
631 632 633 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 631 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
590 591 592 593 594 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 590 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)
347 348 349 350 351 352 353 354 355 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 347 def call_subroutine(name, = {}) = { offset: 0 }.merge() unless @inhibit_vectors called_subroutines << name.to_s.chomp unless called_subroutines.include?(name.to_s.chomp) || @inhibit_vectors update_vector microcode: "call #{name}", offset: [:offset] end end |
#called_subroutines ⇒ Object
Returns an array of subroutines called while generating the current pattern
787 788 789 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 787 def called_subroutines @called_subroutines ||= [] end |
#cycle(options = {}) ⇒ Object
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 868 def cycle( = {}) # handle overlay if requested ovly_style = nil if .key?(:overlay) ovly_style = [:overlay][:overlay_style].nil? ? @overlay_style : [:overlay][:overlay_style] = [:overlay][:overlay_str] # route the overlay request to the appropriate method case ovly_style when :subroutine, :default (, ) ovly_style = :subroutine when :label, :global_label [:dont_compress] = true unless @overlay_history.key?() # J750 behavior is local label not global label "#{}", (ovly_style == :global_label) @overlay_history[] = { is_label: true } end when :digsrc if ultraflex? cur_pin_state = [:overlay][:pins].state.to_sym [:overlay][:pins].drive_mem = () else ovly_style = ([:overlay][:overlay_str], ) end else ovly_style = ([:overlay][:overlay_str], ) end # case ovly_style else @overlay_subr = nil end # of handle overlay = .delete(:overlay) if .key?(:overlay) unless ovly_style == :subroutine if @mask_vector # tack on masking opcodes super(.merge(microcode: "#{[:microcode]} #{@microcode[:mask_vector]}")) else super() end end # unless ovly_style unless .nil? [:pins].state = cur_pin_state if ovly_style == :digsrc # stage = :body if ovly_style == :subroutine # always set stage back to body in case subr overlay was selected end end |
#digcap_store(pins) ⇒ Object
Call this method before each tester cycle to inser the digcap overlay microcode
970 971 972 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 970 def digcap_store(pins) microcode "((#{format_multiple_instrument_pins(pins)}):DigCap = STORE)" end |
#digsrc_overlay(options = {}) ⇒ Object
Perform digsrc overlay (called by tester.cycle)
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1071 def ( = {}) [:overlay] = { change_data: true }.merge([:overlay]) pin_name = dut.pin([:overlay][:pins]).name repeat_count = [:repeat].nil? ? 1 : [:repeat] if [:overlay][:change_data] # add the send microcode microcode "((#{pin_name}):DigSrc = SEND)" # keep track of amount of digsrc used for header comment if @overlay_history[pin_name].nil? @overlay_history[pin_name] = { count: repeat_count, is_digsrc: true } else @overlay_history[pin_name][:count] += repeat_count end # ensure no unwanted repeats on the send vector [:dont_compress] = true # ensure start microcode is placed at the beginning of the pattern if @overlay_history[pin_name][:start_applied].nil? # insert start microcode at the beginning of the pattern stage.insert_from_start "((#{pin_name}):DigSrc = Start)", 0 @overlay_history[pin_name][:start_applied] = true # get the first vector of the pattern i = 0 i += 1 until stage.bank[i].is_a?(OrigenTesters::Vector) first_vector = stage.bank[i] # insert a copy of the first vector with no repeats unless first_vector.inline_comment == 'added for digsrc start opcode' v = OrigenTesters::Vector.new v.pin_vals = stage.bank[i].pin_vals v.timeset = stage.bank[i].timeset v.inline_comment = 'added for digsrc start opcode' v.dont_compress = true stage.insert_from_start v, i # decrement repeat count of previous first vector if > 1 first_vector.repeat -= 1 if first_vector.repeat > 1 end # get cycle count up to this point, add repeat to beginning if needed cycle_count = -1 stage.bank.each { |v| cycle_count += v.repeat if v.is_a?(OrigenTesters::Vector) } if cycle_count < @dssc_send_delay d = OrigenTesters::Vector.new d.pin_vals = first_vector.pin_vals d.timeset = first_vector.timeset d.inline_comment = 'added for dssc start to send delay' d.repeat = @dssc_send_delay - cycle_count # get the first vector of the pattern i = 0 i += 1 until stage.bank[i].is_a?(OrigenTesters::Vector) # insert new vector after the first vector stage.insert_from_start d, i + 1 end end # of place start microcode end # if options[:change_data] end |
#digsrc_send(pins) ⇒ Object
Call this method before each tester cycle to insert the digsrc overlay microcode
965 966 967 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 965 def digsrc_send(pins) microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = SEND)" end |
#digsrc_skip_start(pin_or_group) ⇒ Object
Disable the automatic addition of the digsrc start command at the beginning of the pattern
1061 1062 1063 1064 1065 1066 1067 1068 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1061 def digsrc_skip_start(pin_or_group) pin_or_group = dut.pin(pin_or_group).name if @overlay_history[pin_or_group].nil? @overlay_history[pin_or_group] = { count: 0, is_digsrc: true, start_applied: true } else Origen.log.warn 'tester.digsrc_skip_start must be called before any overlay actions on the pin' end end |
#digsrc_start(pins, options = {}) ⇒ Object
Call this method at the start of any digsrc overlay operations, this method takes care of all the microcodes and delays that's needed for digsrc overlay Required arguments:
pins
Optionsal arguments:
options[:dssc_mode] = :single or :dual, anything else wil be
treated as if it's operating in :quad mode
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 934 def digsrc_start(pins, = {}) = { dssc_mode: :single # defaults dssc_mode to single mode }.merge() if pins.size > 1 microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = Start)" else microcode "((#{pin}):DigSrc = Start)" end if [:dssc_mode] == :single $tester.cycle(repeat: 145) # minimum of 144 cycles, adding 1 for safey measures elsif [:dssc_mode] == :dual $tester.cycle(repeat: 289) # minimum of 288 cycles, adding 1 for safety measures else $tester.cycle(repeat: 577) # minimum of 577 cycles, adding 1 for safety measures end end |
#digsrc_stop(pins, options = {}) ⇒ Object
Call this method at the end of each digscr overlay operation to clear the pattern memory pipeline, so that the pattern is ready to do the next digsrc overlay operation. Required arguments:
pins
956 957 958 959 960 961 962 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 956 def digsrc_stop(pins, = {}) if pins.size > 1 microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = Stop)" else microcode "((#{pins}):DigSrc = Stop)" end end |
#enable_flag(options = {}) ⇒ Object
846 847 848 849 850 851 852 853 854 855 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 846 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, options = {}) ⇒ 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)
386 387 388 389 390 391 392 393 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 386 def end_subroutine(cond = false, = {}) (cond, ) = false, cond if cond.is_a?(Hash) if cond update_vector microcode: 'if (flag) return' else update_vector microcode: 'return' end end |
#flows ⇒ Object
256 257 258 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 256 def flows parser.flows end |
#format_multiple_instrument_pins(pins, options = {}) ⇒ Object
Call this method if there are more than one pin/pin groups used with an instrument, this method will format an array of pins into the correct format required by igxl pattern microcodes.
1002 1003 1004 1005 1006 1007 1008 1009 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1002 def format_multiple_instrument_pins(pins, = {}) return_value = '' pins.each do |pin| return_value += "#{pin}" return_value += ',' unless pins.last == pin end return_value 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
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 798 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)
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 403 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
244 245 246 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 244 def get_dc_instr_pins @dc_pins end |
#get_digcap_pins ⇒ Object
252 253 254 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 252 def get_digcap_pins @digcap_pins end |
#get_digsrc_pins ⇒ Object
248 249 250 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 248 def get_digsrc_pins @digsrc_pins end |
#get_instrument_slots(testconfigname, instrument) ⇒ Object
testconfigname example “WT”, “FT”, “Production”
115 116 117 118 119 120 121 122 123 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 115 def get_instrument_slots(testconfigname, instrument) # testconfigname example "WT", "FT", "Production" @slots = [] @testerconfig[testconfigname].each_with_index do |element, index| if instrument.to_s == element[1][:instrument].to_s @slots << element[0].to_i end end @slots # if no corresponding slot end |
#get_tester_channel(chanmapname, pinname, sitenum) ⇒ Object
161 162 163 164 165 166 167 168 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 161 def get_tester_channel(chanmapname, pinname, sitenum) if sitenum <= @max_site @testerchannel = @channelmap[chanmapname][sitenum][pinname].channel return @testerchannel else return nil end end |
#get_tester_instrument(testconfigname, slot) ⇒ Object
106 107 108 109 110 111 112 113 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 106 def get_tester_instrument(testconfigname, slot) @testerconfig[testconfigname].each_with_index do |element, index| if slot.to_s == element[0].to_s return element[1][:instrument] end end nil # if no corresponding slot end |
#ignore_fails(*pins) ⇒ Object
840 841 842 843 844 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 840 def ignore_fails(*pins) pins.each(&:suspend) yield pins.each(&:resume) end |
#igxl_based? ⇒ Boolean
81 82 83 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 81 def igxl_based? true end |
#import_chanmap(chanmapname, fullchanmappath) ⇒ Object
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 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 125 def import_chanmap(chanmapname, fullchanmappath) # This function reads IG-XL ChannelMap file # chanmapname example ==> "FT", "WT", "FTX2" # fullchanmappath example ==> "/product_folder/Chans_FT.txt" puts "importing ChannelMap #{fullchanmappath}..." chanassignment = Struct.new(:pinname, :site, :channel, :type, :packagepin) chanmap_file = Pathname.new(fullchanmappath) @channelmap[chanmapname] ||= {} File.open(chanmap_file, 'r').each_line.with_index do |line, index| if index == 0 unless line =~ /DTChanMap/ puts "#{fullchanmappath} is not a valid IG-XL ChannelMap!" break end end if index == 5 siteloc = line.strip.split(/\t/).size - 1 # strip all white spaces and grab second to last @max_site_s = line.split(/\t/)[siteloc].strip.split(/\s/)[1] @max_site = @max_site_s.to_i (0..@max_site).each do |sitenum| @channelmap[chanmapname][sitenum] ||= {} end end if index > 5 (blank1, pinname, packagepin, type) = line.split(/\t/) (0..@max_site).each do |sitenum| channel = line.split(/\t/)[4 + sitenum].to_s @channelmap[chanmapname][sitenum][pinname.downcase.intern] = chanassignment.new(pinname.downcase.intern, sitenum, channel.chomp, type.chomp, packagepin) end end end @default_channelmap ||= chanmapname # Default Channelmap gets set if it's not nil end |
#import_tester_config(testconfigname, fullconfigpath) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 85 def import_tester_config(testconfigname, fullconfigpath) # This function reads in CurrentConfig.txt file generated by IG-XL. # testconfigname example ==> "FT", "WT", "Production" # fullconfigpath example ==> "/product_folder/CurrentConfig.txt" puts "importing Testerconfig #{testconfigname}..." slotnum = Struct.new(:slot, :instrument, :idprom) @testerconfig[testconfigname] ||= {} current_config_file = Pathname.new(fullconfigpath) File.open(current_config_file, 'r').each_line do |line| if line =~ /^\d*.0/ (slot, blank1, instrument, blank2, idprom) = line.split(/\t/) if (!slot.nil?) && (!instrument.nil?) && (!idprom.nil?) @testerconfig[testconfigname][slot.split('.').first.to_i] = slotnum.new(slot.split('.').first.to_i, instrument, idprom.chomp) end end end @default_testerconfig ||= testconfigname # Default TesterConfig gets set if it's not nil end |
#is_hexvs_plus(testconfigname, slot) ⇒ Object
Check if a specific HexVS supply is HexVS+ variety, which has /-2mV accuracy as opposed to /-7mV accuracy. If the specific HexVS is HexVS+ variety, returns a “+” string, otherwise nil.
186 187 188 189 190 191 192 193 194 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 186 def is_hexvs_plus(testconfigname, slot) if @testerconfig[testconfigname][slot][:instrument].to_s == 'HexVS' @productnum = @testerconfig[testconfigname][slot][:idprom].split(' ')[0] if (@productnum.include?('974-294-')) && (@productnum.split('-')[2].to_i >= 20) return '+' end end nil # if nothing matched end |
#is_vhdvs_hc(chanmapname, pinname, sitenum) ⇒ Object
Check if a specific VHDVS (UVS256) channel assignment is _HC variety (high-current) If the specific VHDVS channel is _HC variety, returns a “_HC” string, otherwise nil.
211 212 213 214 215 216 217 218 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 211 def is_vhdvs_hc(chanmapname, pinname, sitenum) if sitenum <= @max_site if @channelmap[chanmapname][sitenum][pinname].channel.downcase.include?('hc') return '_HC' end end nil # if nothing matched end |
#is_vhdvs_plus(testconfigname, slot) ⇒ Object
Check if a specific VHDVS (UVS256) supply is High-Accuracy (HA) variety, which has /-5mV0.1%*SUPPLY accuracy as opposed to /-10mV0.1%*SUPPLY accuracy. If the specific VHDVS is of High-Accuracy variety, returns a “+” string, otherwise nil.
199 200 201 202 203 204 205 206 207 208 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 199 def is_vhdvs_plus(testconfigname, slot) if @testerconfig[testconfigname][slot][:instrument].to_s == 'VHDVS' @productnum = @testerconfig[testconfigname][slot][:idprom].split(' ')[0] # binding.pry if (@productnum.include?('805-052-')) && (@productnum.split('-')[2].to_i >= 05) return '+' end end nil # if nothing matched 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
606 607 608 609 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 606 def label(name, global = false) global_opt = (global) ? 'global ' : '' microcode global_opt + name + ':' unless @inhibit_vectors end |
#local_subroutines ⇒ Object
Returns an array of subroutines created by the current pattern
792 793 794 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 792 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
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 649 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
1011 1012 1013 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1011 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)
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 527 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() [:on_block_match_goto] ||= .delete(:on_pin_match_goto) 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
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 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 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 428 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 |
#merged_channels(chanmapname, pinname, sitenum) ⇒ Object
Check if a specific pin for a given channelmap for a given site number is using merged channel. If yes, return x2 for Merged2, x4 for Merged4, etc. If no, return nil.
172 173 174 175 176 177 178 179 180 181 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 172 def merged_channels(chanmapname, pinname, sitenum) if sitenum <= @max_site if @channelmap[chanmapname][sitenum][pinname].type.include?('Merged') @merged_channels = @channelmap[chanmapname][sitenum][pinname].type.split('Merged')[1] return 'x' + @merged_channels end else return nil end end |
#overlay_style_warn(overlay_str, options) ⇒ Object
Warn user of unsupported overlay style
919 920 921 922 923 924 925 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 919 def (, ) Origen.log.warn("Unrecognized overlay style :#{@overlay_style}, defaulting to subroutine") Origen.log.warn('Available overlay styles :label, :global_label, :subroutine') if j750? || j750_hpt? Origen.log.warn('Available overlay styles :digsrc, :digsrc_subroutine, :label, :global_label, :subroutine') if ultraflex? (, ) @overlay_style = :subroutine # Just give 1 warning 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
262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 262 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
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 761 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] 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
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 676 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 if tester.j750? && [:freq_counter] # pin setup type => freq_counter is only for the J750. # UltraFLEX has frequency counter capability behind every pin. # need to make sure the pin_setup freq_count is defined after opcode_mode extended since freq count only work in extended mode if @opcode_mode == :extended microcode "pin_setup = {#{[:freq_counter]} freq_count;}" else fail 'pin_setup freq_count can only work in extended mode' end end # Take care of any instruments [:instruments] = [:instruments].merge(@pushed_instrument_configs) if [:instruments].length > 0 microcode 'instruments = {' [:instruments].each do |pins, instrument| if "#{pins}" == 'nil' microcode " #{instrument};" elsif instrument == 'digsrc' microcode " #{pins}:#{instrument} #{[:digsrc_width]}:#{[:digsrc_bit_order]}:#{[:digsrc_mode]}:format=#{[:digsrc_format]}:#{[:digsrc_site_uniqueness]}:#{[:digsrc_auto_cond]};" elsif instrument == 'digcap' microcode " #{pins}:#{instrument} #{[:digcap_width]}:#{[:digcap_bit_order]}:#{[:digcap_mode]}:format=#{[:digcap_format]}:data_type=#{[:digcap_data_type]}:#{[:digcap_auto_cond]}:#{[:digcap_auto_trig_enable]}:#{[:digcap_store_stv]}:#{[:digcap_receive_data]};" else microcode " #{pins}:#{instrument};" end end microcode '}' end [:high_voltage] = @use_hv_pin microcode "pin_setup = {#{[:high_voltage]} high_voltage;}" if [:high_voltage] 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_instrument(pin_spec, instrument_def) ⇒ Object
Similar to push_microcode, but for the instrument statement in the pattern header
1023 1024 1025 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1023 def push_instrument(pin_spec, instrument_def) @pushed_instrument_configs[pin_spec] = instrument_def end |
#push_microcode(code) ⇒ Object Also known as: microcode
Override this to force the formatting to match the v1 J750 model (easier diffs)
816 817 818 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 816 def push_microcode(code) # :nodoc: stage.store(code.ljust(65) + ''.ljust(31)) unless @inhibit_vectors end |
#remove_store_from_vector(vector) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
328 329 330 331 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 328 def remove_store_from_vector(vector) super vector.microcode = nil 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
833 834 835 836 837 838 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 833 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)
620 621 622 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 620 def set_code(code) cycle(microcode: "set_code #{code}") end |
#set_flag(options = {}) ⇒ Object
857 858 859 860 861 862 863 864 865 866 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 857 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, options = {}) ⇒ 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
366 367 368 369 370 371 372 373 374 375 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 366 def start_subroutine(name, = {}) unless @inhibit_vectors local_subroutines << name.to_s.chomp unless local_subroutines.include?(name.to_s.chomp) || @inhibit_vectors if $tester.ultraflex? && (name =~ /keep_?alive/ || [:keep_alive]) microcode "keepalive subr #{name}:" else microcode "global subr #{name}:" end end 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.
294 295 296 297 298 299 300 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 294 def store(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { offset: 0 }.merge() update_vector microcode: 'stv', offset: [:offset] last_vector([:offset]).contains_capture = true unless @inhibit_vectors 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.
314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 314 def store_next_cycle(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { }.merge() unless @inhibit_vectors preset_next_vector microcode: 'stv' do |vector| vector.contains_capture = true end end end |
#subroutine_overlay(sub_name, options = {}) ⇒ Object
Implement subroutine overlay, called by tester.cycle
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 |
# File 'lib/origen_testers/igxl_based_tester/base.rb', line 1028 def (sub_name, = {}) if @overlay_subr != sub_name # unless last staged vector already has the subr call do the following i = -1 i -= 1 until stage.bank[i].is_a?(OrigenTesters::Vector) if stage.bank[i].microcode !~ /call #{sub_name}/ # check for repeat on new last vector, unroll 1 if needed if stage.bank[i].repeat > 1 v = OrigenTesters::Vector.new v.pin_vals = stage.bank[i].pin_vals v.timeset = stage.bank[i].timeset stage.bank[i].repeat -= 1 stage.store(v) i = -1 end # mark last vector as dont_compress stage.bank[i].dont_compress = true # insert subroutine call call_subroutine sub_name end # if microcode not placed @overlay_subr = sub_name end # stage = sub_name end |