Class: OrigenTesters::LabVIEWBasedTester::Pxie6570
- Inherits:
-
Object
- Object
- OrigenTesters::LabVIEWBasedTester::Pxie6570
- Includes:
- VectorBasedTester
- Defined in:
- lib/origen_testers/labview_based_tester/pxie6570.rb
Instance Attribute Summary collapse
-
#default_capture_wave_name ⇒ Object
Returns the value of attribute default_capture_wave_name.
-
#default_source_wave_name ⇒ Object
Returns the value of attribute default_source_wave_name.
Instance Method Summary collapse
-
#add_capture_start(pins, options = {}) ⇒ Object
internal method to avoid needless code duplication.
- #add_microcode_to_first_vec(statement) ⇒ Object
-
#call_subroutine(name, options = {}) ⇒ Object
insert a subroutine call provide optional argument to implement as jump instead of call:.
- #cycle(options = {}) ⇒ Object
- #end_subroutine ⇒ Object
-
#format_pin_state(pin) ⇒ Object
change the capture state character.
-
#format_vector(vec) ⇒ Object
Internal method called by Origen.
-
#initialize ⇒ Pxie6570
constructor
A new instance of Pxie6570.
-
#label(name, global = false) ⇒ Object
add a label to the output pattern.
-
#pattern_footer(options = {}) ⇒ Object
Internal method called by Origen.
-
#pattern_header(options = {}) ⇒ Object
Internal method called by Origen.
- #start_subroutine(name, options = {}) ⇒ Object
-
#store(*pins) ⇒ Object
(also: #to_hram, #capture)
store/capture the state of the provided pins.
-
#store_next_cycle(*pins) ⇒ Object
(also: #store!)
store/capture the provided pins on the next cycle.
Methods included from VectorBasedTester
Constructor Details
#initialize ⇒ Pxie6570
Returns a new instance of Pxie6570.
8 9 10 11 12 13 14 15 16 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 8 def initialize @pat_extension = 'digipatsrc' @capture_started = {} @source_started = {} @global_label_export = [] @called_subroutines = [] @default_capture_wave_name = 'default_capture_waveform' @default_source_wave_name = 'default_source_waveform' end |
Instance Attribute Details
#default_capture_wave_name ⇒ Object
Returns the value of attribute default_capture_wave_name.
6 7 8 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 6 def default_capture_wave_name @default_capture_wave_name end |
#default_source_wave_name ⇒ Object
Returns the value of attribute default_source_wave_name.
6 7 8 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 6 def default_source_wave_name @default_source_wave_name end |
Instance Method Details
#add_capture_start(pins, options = {}) ⇒ Object
internal method to avoid needless code duplication
171 172 173 174 175 176 177 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 171 def add_capture_start(pins, = {}) unless @capture_started[:default] # add the capture start opcode to the top of the pattern add_microcode_to_first_vec "capture_start(#{@default_capture_wave_name})" @capture_started[:default] = true end end |
#add_microcode_to_first_vec(statement) ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 116 def add_microcode_to_first_vec(statement) # find the first vector i = 0 i += 1 until stage.bank[i].is_a?(OrigenTesters::Vector) first_vector = stage.bank[i] if first_vector.has_microcode? || first_vector.repeat > 1 v = OrigenTesters::Vector.new v.pin_vals = first_vector.pin_vals v.timeset = first_vector.timeset v.inline_comment = 'added line for opcode insert' v.dont_compress = true v.microcode = statement stage.insert_from_start v, i # decrement repeat count of previous first vector if > 1 first_vector.repeat -= 1 if first_vector.repeat > 1 else first_vector.microcode = statement end end |
#call_subroutine(name, options = {}) ⇒ Object
insert a subroutine call provide optional argument to implement as jump instead of call:
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 73 def call_subroutine(name, = {}) = { jump: false }.merge() @called_subroutines << name.to_s.chomp unless @called_subroutines.include?(name.to_s.chomp) local_microcode = '' if [:jump] local_microcode = "jump #{name}" else local_microcode = "call #{name}" end update_vector microcode: local_microcode, offset: [:offset] end |
#cycle(options = {}) ⇒ Object
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 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 138 def cycle( = {}) # handle overlay if requested = .key?(:overlay) ? .delete(:overlay) : {} cur_pin_state = nil if .key?(:pins) = { change_data: true }.merge() unless @source_started[:default] add_microcode_to_first_vec "source_start(#{@default_source_wave_name})" @source_started[:default] = true end # ensure no unwanted repeats on the source line [:dont_compress] = true if [:change_data] if [:microcode].nil? [:microcode] = 'source' else [:microcode] = [:microcode] + ', source' end [:microcode] = [:microcode] + ", repeat (#{[:repeat]})" unless [:repeat].nil? .delete(:repeat) end # set pins to drive data cur_pin_state = [:pins].state.to_sym [:pins].drive_mem end super() [:pins].state = cur_pin_state if .key?(:pins) end |
#end_subroutine ⇒ Object
90 91 92 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 90 def end_subroutine update_vector microcode: 'return' end |
#format_pin_state(pin) ⇒ Object
change the capture state character
202 203 204 205 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 202 def format_pin_state(pin) response = super(pin) response.sub('C', 'V') end |
#format_vector(vec) ⇒ Object
Internal method called by Origen
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 50 def format_vector(vec) timeset = vec.timeset ? " #{vec.timeset.name}" : '' pin_vals = vec.pin_vals ? "#{vec.pin_vals} ;" : '' microcode = vec.microcode ? vec.microcode : '' 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 |
#label(name, global = false) ⇒ Object
add a label to the output pattern
196 197 198 199 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 196 def label(name, global = false) microcode name + ':' @global_label_export << name if global end |
#pattern_footer(options = {}) ⇒ Object
Internal method called by Origen
42 43 44 45 46 47 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 42 def ( = {}) # add capture/source stop to the end of the pattern cycle microcode: 'capture_stop' if @capture_started[:default] cycle microcode: 'halt' microcode '}' end |
#pattern_header(options = {}) ⇒ Object
Internal method called by Origen
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 19 def pattern_header( = {}) microcode 'file_format_version 1.0;' start_label = "#{[:pattern]}_st" microcode "export #{start_label};" @global_label_export.each { |label| microcode "export #{label};" } @called_subroutines.each { |sub| microcode "import #{sub};" } called_timesets.each do |timeset| microcode "timeset #{timeset.name};" end pin_list = ordered_pins.map(&:name).join(',') microcode "pattern #{[:pattern]} (#{pin_list})" microcode '{' microcode "#{start_label}:" # Remove any leading comments before first vector data unless [:subroutine_pat] stage.with_bank(:body) do # find the first vector stage.bank.delete_at(0) until stage.bank[0].is_a?(OrigenTesters::Vector) end end end |
#start_subroutine(name, options = {}) ⇒ Object
85 86 87 88 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 85 def start_subroutine(name, = {}) = { global: false }.merge() label name, [:global] end |
#store(*pins) ⇒ Object Also known as: to_hram, capture
store/capture the state of the provided pins
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 95 def store(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { offset: 0 }.merge() pins = pins.flatten.compact fail 'For the PXIE6570 you must supply the pins to store/capture' if pins.empty? add_capture_start pins, pins.each do |pin| pin.restore_state do pin.capture update_vector_pin_val pin, offset: [:offset] last_vector([:offset]).dont_compress = true end end update_vector microcode: 'capture', offset: [:offset] end |
#store_next_cycle(*pins) ⇒ Object Also known as: store!
store/capture the provided pins on the next cycle
180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/origen_testers/labview_based_tester/pxie6570.rb', line 180 def store_next_cycle(*pins) = pins.last.is_a?(Hash) ? pins.pop : {} = { offset: 0 }.merge() pins = pins.flatten.compact fail 'For the PXIE6570 you must supply the pins to store/capture' if pins.empty? add_capture_start pins, pins.each { |pin| pin.save; pin.capture } preset_next_vector(microcode: 'capture') do pins.each(&:restore) end end |