Class: OrigenTesters::IGXLBasedTester::Parser::TestInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/igxl_based_tester/parser/test_instance.rb

Constant Summary collapse

TYPES =
%w(
  functional board_pmu empty pin_pmu powersupply mto_memory
)
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:        :powersupply,
  mto_memory_t:         :mto_memory
}
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
  },
  mto_memory:  {
    patterns:                  :arg0,
    pattern:                   :arg0,
    start_func:                :arg1,
    start_of_body_f:           :arg1,
    pre_pat_func:              :arg2,
    pre_pat_f:                 :arg2,
    pre_test_func:             :arg3,
    pre_test_f:                :arg3,
    post_test_func:            :arg4,
    post_test_f:               :arg4,
    post_pat_func:             :arg5,
    post_pat_f:                :arg5,
    end_of_body_func:          :arg6,
    end_of_body_f:             :arg6,
    set_pass_fail:             :arg7,
    init_lo:                   :arg8,
    start_lo:                  :arg8,
    init_hi:                   :arg9,
    start_hi:                  :arg9,
    init_hiz:                  :arg10,
    start_hiz:                 :arg10,
    float_pins:                :arg11,
    start_of_body_func_args:   :arg12,
    start_of_body_f_args:      :arg12,
    pre_pat_func_args:         :arg13,
    pre_pat_f_args:            :arg13,
    pre_test_func_args:        :arg14,
    pre_test_f_args:           :arg14,
    post_test_func_args:       :arg15,
    post_test_f_args:          :arg15,
    post_pat_f_args:           :arg16,
    end_of_body_func_args:     :arg17,
    end_of_body_f_args:        :arg17,
    utility_pins_1:            :arg18,
    utility_pins_0:            :arg19,
    wait_flags:                :arg20,
    wait_time_out:             :arg21,
    PatFlagF:                  :arg22,
    pat_flag_f:                :arg22,
    pat_flag_func_args:        :arg23,
    pat_flag_f_args:           :arg23,
    relay_mode:                :arg24,
    x_enable_mask:             :arg29,
    x_shift_direction:         :arg30,
    x_shift_input:             :arg31,
    y_enable_mask:             :arg36,
    y_shift_direction:         :arg37,
    y_shift_input:             :arg38,
    dga:                       :arg39,
    dgb:                       :arg40,
    dgc:                       :arg41,
    dgd:                       :arg42,
    dg_enable_mask:            :arg43,
    dg_shift_direction:        :arg44,
    dg_shift_input:            :arg45,
    x_coincidence_enable_mask: :arg46,
    y_coincidence_enable_mask: :arg47,
    two_bit_dg_setup:          :arg48,
    x_scramble_algorithm:      :arg49,
    y_scramble_algorithm:      :arg50,
    topo_inversion_algorithm:  :arg51,
    utility_counter_a:         :arg52,
    utility_counter_b:         :arg53,
    utility_counter_c:         :arg54,
    dut_data_source:           :arg55,
    scramble_addr:             :arg56,
    speed_mode:                :arg57,
    resource_map:              :arg58,
    receive_data:              :arg59,
    data_to_capture:           :arg60,
    capture_marker:            :arg61,
    enable_wrapping:           :arg62,
    capture_scrambled_address: :arg63,
    mapmem_0_input_set:        :arg64,
    mapmem_1_input_set:        :arg65,
    threading:                 :arg69,
    match_all_sites:           :arg70
  },

  powersupply: {
    precond_pat:              :arg0,
    pre_cond_pat:             :arg0,
    start_func:               :arg1,
    start_of_body_f:          :arg1,
    pre_pat_func:             :arg2,
    pre_pat_f:                :arg2,
    pre_test_func:            :arg3,
    pre_test_f:               :arg3,
    post_test_func:           :arg4,
    post_test_f:              :arg4,
    post_pat_func:            :arg5,
    post_pat_f:               :arg5,
    end_func:                 :arg6,
    end_of_body_f:            :arg6,
    hold_state_pat:           :arg7,
    holdstate_pat:            :arg7,
    wait_flags:               :arg8,
    wait_time_out:            :arg9,
    start_lo:                 :arg10,
    start_init_lo:            :arg10,
    init_lo:                  :arg10,
    start_hi:                 :arg11,
    start_init_hi:            :arg11,
    init_hi:                  :arg11,
    start_hiz:                :arg12,
    start_init_hiz:           :arg12,
    init_hiz:                 :arg12,
    float_pins:               :arg13,
    irange:                   :arg14,
    sampling_time:            :arg15,
    samples:                  :arg16,
    settling_time:            :arg17,
    hi_lo_lim_valid:          :arg18,
    hi_lo_limit_valid:        :arg18,
    hi_limit:                 :arg19,
    lo_limit:                 :arg20,
    force_cond_1:             :arg21,
    force_cond:               :arg21,
    force_condition:          :arg21,
    force_condition_1:        :arg21,
    force_cond_2:             :arg22,
    force_condition_2:        :arg22,
    power_pins:               :arg23,
    pins:                     :arg23,
    pin:                      :arg23,
    force_source:             :arg24,
    pcp_start:                :arg25,
    pcp_stop:                 :arg26,
    start_func_args:          :arg27,
    start_of_body_f_args:     :arg27,
    pre_pat_func_args:        :arg28,
    pre_pat_f_args:           :arg28,
    pre_test_func_args:       :arg29,
    pre_test_f_args:          :arg29,
    post_test_func_args:      :arg30,
    post_test_f_args:         :arg30,
    post_pat_func_args:       :arg31,
    post_pat_f_args:          :arg31,
    end_func_args:            :arg32,
    end_of_body_f_args:       :arg32,
    hsp_start:                :arg33,
    hsp_stop:                 :arg34,
    pcp_check_pg:             :arg35,
    clamp:                    :arg36,
    hsp_check_pg:             :arg37,
    resume_pat:               :arg38,
    relay_mode:               :arg39,
    utility_pins_1:           :arg40,
    utility_pins_0:           :arg41,
    test_control:             :arg42,
    serialize_meas:           :arg43,
    serialize_meas_func:      :arg44,
    serialize_meas_f:         :arg44,
    serialize_meas_func_args: :arg45,
    serialize_meas_f_args:    :arg45,
    precond_pat_clam:         :arg46,
    threading:                :arg47
  }
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, options = {}) ⇒ TestInstance

Returns a new instance of TestInstance.



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 351

def initialize(line, options = {})
  @parser = options[: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

#parserObject

Returns the value of attribute parser.



5
6
7
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 5

def parser
  @parser
end

Instance Method Details

#componentsObject



389
390
391
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 389

def components
  @components ||= []
end

#descriptionObject



373
374
375
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 373

def description
  parser.descriptions.test_instance(name: name)
end

#extract_pattern_from_patset(patset) ⇒ Object



402
403
404
405
406
407
408
409
410
411
412
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 402

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

#inspectObject

:nodoc:



369
370
371
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 369

def inspect  # :nodoc:
  "<TestInstance: #{name}, Type: #{type}>"
end

#parseObject



381
382
383
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 381

def parse
  @components = @line.split("\t") unless @line.strip.empty?
end

#patternsObject

Returns an array of all pattern names referenced in this test instance



394
395
396
397
398
399
400
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 394

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

#typeObject



377
378
379
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 377

def type
  TYPE_ALIASES[proc_name.downcase.to_sym] || :unsupported
end

#valid?Boolean

Returns:

  • (Boolean)


385
386
387
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 385

def valid?
  components[4] && ['Excel Macro', 'VB DLL'].include?(components[4])
end

#vddObject



414
415
416
# File 'lib/origen_testers/igxl_based_tester/parser/test_instance.rb', line 414

def vdd
  parser.dc_specs.where(name: 'VDD', exact: true).first.lookup(dc_category, dc_selector)
end