Class: Origen::Tester::Ultraflex::Parser::TestInstance
- Inherits:
-
Object
- Object
- Origen::Tester::Ultraflex::Parser::TestInstance
- Defined in:
- lib/origen/tester/ultraflex/parser/test_instance.rb
Constant Summary
- TYPES =
%w( functional board_pmu empty pin_pmu power_supply
- TYPE_ALIASES =
{ functional_t: :functional, boardpmu_t: :board_pmu, nvmboardpmucal_t: :board_pmu, nvmboardpmumeasure_t: :board_pmu, empty_t: :empty, pinpmu_t: :pin_pmu, nvmpinpmucal_t: :pin_pmu, nvmpinpmumeas_t: :pin_pmu, powersupply_t: :power_supply }
- ATTRS =
attributes
- ALIASES =
{ name: :test_name, functional: { pattern: :arg0, start_func: :arg1, pre_pat_func: :arg2, pre_test_func: :arg3, post_test_func: :arg4, post_pat_func: :arg5, end_func: :arg6, set_pass_fail: :arg7, start_func_args: :arg13, pre_pat_func_args: :arg14, pre_test_func_args: :arg15, post_test_func_args: :arg16, post_pat_func_args: :arg17, end_func_args: :arg18, wait_flags: :arg21, wait_time: :arg22, pat_flag_func: :arg23, pat_flag_func_args: :arg24, relay_mode: :arg25, threading: :arg26, match_all_sites: :arg27, capture_mode: :arg30, capture_what: :arg31, capture_memory: :arg32, capture_size: :arg33, datalog_mode: :arg34, data_type: :arg35 }, board_pmu: { hsp_start: :arg0, start_func: :arg1, pre_pat_func: :arg2, pre_test_func: :arg3, post_test_func: :arg4, post_pat_func: :arg5, end_func: :arg6, precond_pat: :arg7, hold_state_pat: :arg8, holdstate_pat: :arg8, pattern: :arg8, pcp_stop: :arg9, wait_flags: :arg10, start_lo: :arg11, init_lo: :arg11, start_hi: :arg12, init_hi: :arg12, start_hiz: :arg13, init_hiz: :arg13, float_pins: :arg14, pinlist: :arg15, measure_mode: :arg16, irange: :arg17, clamp: :arg18, vrange: :arg19, sampling_time: :arg20, samples: :arg21, setting_time: :arg22, hi_lo_lim_valid: :arg23, hi_limit: :arg24, lo_limit: :arg25, force_cond_1: :arg26, force_cond_2: :arg27, gang_pins_tested: :arg28, relay_mode: :arg29, wait_time_out: :arg30, start_func_args: :arg31, pre_pat_func_args: :arg32, pre_test_func_args: :arg33, post_test_func_args: :arg34, post_pat_func_args: :arg35, end_func_args: :arg36, pcp_start: :arg37, pcp_check_pg: :arg38, hsp_stop: :arg39, hsp_check_pg: :arg40, resume_pat: :arg41, utility_pins_1: :arg42, utility_pins_0: :arg43, pre_charge_enable: :arg44, pre_charge: :arg45, threading: :arg46 }, pin_pmu: { hsp_start: :arg0, start_func: :arg1, pre_pat_func: :arg2, pre_test_func: :arg3, post_test_func: :arg4, post_pat_func: :arg5, end_func: :arg6, precond_pat: :arg7, hold_state_pat: :arg8, holdstate_pat: :arg8, pattern: :arg8, pcp_stop: :arg9, wait_flags: :arg10, start_lo: :arg11, init_lo: :arg11, start_hi: :arg12, init_hi: :arg12, start_hiz: :arg13, init_hiz: :arg13, float_pins: :arg14, pinlist: :arg15, measure_mode: :arg16, irange: :arg17, setting_time: :arg18, hi_lo_lim_valid: :arg19, hi_limit: :arg20, lo_limit: :arg21, force_cond_1: :arg22, force_cond_2: :arg23, fload: :arg24, f_load: :arg24, relay_mode: :arg25, wait_time_out: :arg26, start_func_args: :arg27, pre_pat_func_args: :arg28, pre_test_func_args: :arg29, post_test_func_args: :arg30, post_pat_func_args: :arg31, end_func_args: :arg32, pcp_start: :arg33, pcp_check_pg: :arg34, hsp_stop: :arg35, hsp_check_pg: :arg36, sampling_time: :arg37, samples: :arg38, resume_pat: :arg39, vcl: :arg40, vch: :arg41, utility_pins_1: :arg42, utility_pins_0: :arg43, pre_charge_enable: :arg44, pre_charge: :arg45, threading: :arg46 } }
Instance Attribute Summary (collapse)
-
- (Object) parser
Returns the value of attribute parser.
Instance Method Summary (collapse)
- - (Object) components
- - (Object) description
- - (Object) extract_pattern_from_patset(patset)
-
- (TestInstance) initialize(line, options = {})
constructor
A new instance of TestInstance.
-
- (Object) inspect
:nodoc:.
- - (Object) parse
-
- (Object) patterns
Returns an array of all pattern names referenced in this test instance.
- - (Object) type
- - (Boolean) valid?
- - (Object) vdd
Constructor Details
- (TestInstance) initialize(line, options = {})
Returns a new instance of TestInstance
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 192 def initialize(line, = {}) @parser = [:parser] @line = line parse if valid? ATTRS.each_with_index do |attr, i| instance_variable_set("@#{attr}", components[i + 1]) end if ALIASES[type] ALIASES[type].each do |alias_, attr| define_singleton_method("#{alias_}") do send(attr) end end end end end |
Instance Attribute Details
- (Object) parser
Returns the value of attribute parser
6 7 8 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 6 def parser @parser end |
Instance Method Details
- (Object) components
230 231 232 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 230 def components @components ||= [] end |
- (Object) description
214 215 216 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 214 def description parser.descriptions.test_instance(name: name) end |
- (Object) extract_pattern_from_patset(patset)
243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 243 def extract_pattern_from_patset(patset) pset = parser.pattern_sets.where(name: patset, exact: true) if pset.size > 1 puts "Warning multiple pattern sets called #{patset} found, using the first one" end if pset.size == 0 patset else pset.first.pattern_names end end |
- (Object) inspect
:nodoc:
210 211 212 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 210 def inspect # :nodoc: "<TestInstance: #{name}, Type: #{type}>" end |
- (Object) parse
222 223 224 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 222 def parse @components = @line.split("\t") unless @line.strip.empty? end |
- (Object) patterns
Returns an array of all pattern names referenced in this test instance
235 236 237 238 239 240 241 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 235 def patterns if self.respond_to?(:pattern) pattern.split(',').map do |pat| extract_pattern_from_patset(pat) end.flatten.map { |pat| pat.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') } end end |
- (Object) type
218 219 220 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 218 def type TYPE_ALIASES[proc_name.downcase.to_sym] || :unsupported end |
- (Boolean) valid?
226 227 228 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 226 def valid? components[4] && ['Excel Macro', 'VB DLL'].include?(components[4]) end |
- (Object) vdd
255 256 257 |
# File 'lib/origen/tester/ultraflex/parser/test_instance.rb', line 255 def vdd parser.dc_specs.where(name: 'VDD', exact: true).first.lookup(dc_category, dc_selector) end |