Class: OrigenTesters::IGXLBasedTester::Base::FlowLine
- Inherits:
-
Object
- Object
- OrigenTesters::IGXLBasedTester::Base::FlowLine
- Defined in:
- lib/origen_testers/igxl_based_tester/base/flow_line.rb
Direct Known Subclasses
Constant Summary collapse
- ALIASES =
Map any aliases to the official names here, multiple aliases for a given attribute are allowed
{ bin: :bin_fail, softbin: :sort_fail, soft_bin: :sort_fail, sbin: :sort_fail, name: :tname, number: :tnum, if_enable: :enable, if_enabled: :enable, enabled: :enable, hi_limit: :hilim, hi: :hilim, lo_limit: :lolim, lo: :lolim, # Aliases can also be used to set defaults on multiple attributes like this, # use :value to refer to the value passed in to the given alias flag_false: { device_condition: 'flag-false', device_name: :value }, flag_true: { device_condition: 'flag-true', device_name: :value }, flag_false_any: { group_specifier: 'any-active', group_condition: 'flag-false', group_name: :value }, flag_false_all: { group_specifier: 'all-active', group_condition: 'flag-false', group_name: :value }, flag_true_any: { group_specifier: 'any-active', group_condition: 'flag-true', group_name: :value }, flag_true_all: { group_specifier: 'all-active', group_condition: 'flag-true', group_name: :value }, flag_clear: { device_condition: 'flag-clear', device_name: :value } }
- DEFAULTS =
Assign attribute defaults here, generally this should match whatever defaults Teradyne has set whenever you create a new test instance, etc.
{ test: { opcode: 'Test', result: 'Fail' }, test_defer_limits: { opcode: 'Test-defer-limits', result: 'Fail' }, cz: { opcode: 'characterize', result: 'None' }, goto: { opcode: 'goto' }, nop: { opcode: 'nop' }, set_device: { opcode: 'set-device' }, set_error_bin: { opcode: 'set-error-bin' }, enable_flow_word: { opcode: 'enable-flow-word' }, disable_flow_word: { opcode: 'disable-flow-word' }, logprint: { opcode: 'logprint' }, use_limit: { opcode: 'Use-Limit', result: 'Fail' }, flag_false: { opcode: 'flag-false' }, flag_false_all: { opcode: 'flag-false-all' }, flag_true: { opcode: 'flag-true' }, flag_true_all: { opcode: 'flag-true-all' }, defaults: { opcode: 'defaults' } }
Instance Attribute Summary collapse
-
#cz_setup ⇒ Object
cz_setup is a virtual attrib since it is not part of the regular flow line.
-
#id ⇒ Object
rubocop:disable Lint/DuplicateMethods.
-
#type ⇒ Object
cz_setup is a virtual attrib since it is not part of the regular flow line.
Class Method Summary collapse
Instance Method Summary collapse
- #continue_pass ⇒ Object
- #debug_assume_fail ⇒ Object
- #debug_assume_pass ⇒ Object
-
#initialize(type, attrs = {}) ⇒ FlowLine
constructor
A new instance of FlowLine.
- #parameter ⇒ Object
- #parameter=(value) ⇒ Object
- #run_if_all_(args) ⇒ Object
- #run_if_all_failed(parent) ⇒ Object
- #run_if_all_passed(parent) ⇒ Object
- #run_if_any_failed(parent) ⇒ Object
- #run_if_any_passed(parent) ⇒ Object
-
#set_flag_on_pass ⇒ Object
def debug_sites self.debug_sites = “All” end.
- #set_flag_on_ran ⇒ Object
- #test? ⇒ Boolean
-
#to_s ⇒ Object
Returns the fully formatted flow line for insertion into a flow sheet.
- #unique_counter ⇒ Object
- #unless_enable=(*args) ⇒ Object (also: #unless_enabled=)
Constructor Details
#initialize(type, attrs = {}) ⇒ FlowLine
Returns a new instance of FlowLine.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 146 def initialize(type, attrs = {}) @ignore_missing_instance = attrs.delete(:instance_not_available) self.cz_setup = attrs.delete(:cz_setup) @type = type # Set the defaults DEFAULTS[@type.to_sym].each do |k, v| send("#{k}=", v) if respond_to?("#{k}=") end # Then the values that have been supplied attrs.each do |k, v| send("#{k}=", v) if respond_to?("#{k}=") end # override test numbers if diff-friendly output desired if Origen.tester.diff_friendly_output? self.tnum = 0 end end |
Instance Attribute Details
#cz_setup ⇒ Object
cz_setup is a virtual attrib since it is not part of the regular flow line
5 6 7 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 5 def cz_setup @cz_setup end |
#id ⇒ Object
rubocop:disable Lint/DuplicateMethods
5 6 7 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 5 def id @id end |
#type ⇒ Object
cz_setup is a virtual attrib since it is not part of the regular flow line
5 6 7 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 5 def type @type end |
Class Method Details
.define ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 104 def self.define # Generate accessors for all attributes and their aliases self::TESTER_FLOWLINE_ATTRS.each do |attr| writer = "#{attr}=".to_sym reader = attr.to_sym attr_reader attr.to_sym unless method_defined? reader attr_writer attr.to_sym unless method_defined? writer end ALIASES.each do |_alias, val| if val.is_a? Hash if ((self::TESTER_FLOWLINE_ATTRS.map(&:to_sym)) & val.keys) == val.keys writer = "#{_alias}=".to_sym unless method_defined? writer define_method("#{_alias}=") do |v| val.each do |k, _v| myval = _v == :value ? v : _v send("#{k}=", myval) end end end end else if self::TESTER_FLOWLINE_ATTRS.include? "#{val}" writer = "#{_alias}=".to_sym reader = _alias.to_sym unless method_defined? writer define_method("#{_alias}=") do |v| send("#{val}=", v) end end unless method_defined? reader define_method("#{_alias}") do send(val) end end end end end end |
.unique_counter ⇒ Object
262 263 264 265 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 262 def self.unique_counter @ix ||= -1 @ix += 1 end |
Instance Method Details
#continue_pass ⇒ Object
206 207 208 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 206 def continue_pass self.result = 'Pass' end |
#debug_assume_fail ⇒ Object
214 215 216 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 214 def debug_assume_fail self.debug_assume = 'Fail' end |
#debug_assume_pass ⇒ Object
210 211 212 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 210 def debug_assume_pass self.debug_assume = 'Pass' end |
#parameter ⇒ Object
173 174 175 176 177 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 173 def parameter # When referring to the test instance take the opportunity to refresh the current # version of the test instance @parameter = Origen.interface.identity_map.current_version_of(@parameter) end |
#parameter=(value) ⇒ Object
164 165 166 167 168 169 170 171 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 164 def parameter=(value) if (@type == :test || @test == :cz) && !@ignore_missing_instance if value.is_a?(String) || value.is_a?(Symbol) fail "You must supply the actual test instance object for #{value} when adding it to the flow" end end @parameter = value end |
#run_if_all_(args) ⇒ Object
250 251 252 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 250 def run_if_all_(args) # code end |
#run_if_all_failed(parent) ⇒ Object
245 246 247 248 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 245 def run_if_all_failed(parent) parent.continue_on_fail self.flag_true_all = parent.set_flag_on_fail end |
#run_if_all_passed(parent) ⇒ Object
235 236 237 238 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 235 def run_if_all_passed(parent) parent.continue_on_fail self.flag_true_all = parent.set_flag_on_pass end |
#run_if_any_failed(parent) ⇒ Object
240 241 242 243 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 240 def run_if_any_failed(parent) parent.continue_on_fail self.flag_true_any = parent.set_flag_on_fail end |
#run_if_any_passed(parent) ⇒ Object
230 231 232 233 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 230 def run_if_any_passed(parent) parent.continue_on_fail self.flag_true_any = parent.set_flag_on_pass end |
#set_flag_on_pass ⇒ Object
def debug_sites
self.debug_sites = "All"
end
222 223 224 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 222 def set_flag_on_pass self.flag_pass = "#{id}_PASSED" end |
#set_flag_on_ran ⇒ Object
226 227 228 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 226 def set_flag_on_ran self.flag_pass = "#{id}_RAN" end |
#test? ⇒ Boolean
267 268 269 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 267 def test? @type == :test end |
#to_s ⇒ Object
Returns the fully formatted flow line for insertion into a flow sheet
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 180 def to_s l = "\t" self.class::TESTER_FLOWLINE_ATTRS.each do |attr| if attr == 'parameter' ins = parameter if ins.respond_to?(:name) l += "#{ins.name}" else l += "#{ins}" end if type == :cz && cz_setup l += " #{cz_setup}\t" else l += "\t" end else l += "#{send(attr)}\t" end end "#{l}" end |
#unique_counter ⇒ Object
258 259 260 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 258 def unique_counter @unique_counter ||= self.class.unique_counter end |
#unless_enable=(*args) ⇒ Object Also known as: unless_enabled=
202 203 |
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 202 def unless_enable=(*args) end |