Class: OrigenTesters::SmartestBasedTester::Base::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/smartest_based_tester/base/test_suite.rb

Direct Known Subclasses

V93K::TestSuite

Constant Summary collapse

ATTRS =
%w(name
   comment

   timing_equation timing_spec timing_set
   level_equation level_spec level_set
   analog_set
   pattern
   context
   test_type
   test_method

   test_number
   test_level

   bypass
   set_pass
   set_fail
   hold
   hold_on_fail
   output_on_pass
   output_on_fail
   pass_value
   fail_value
   per_pin_on_pass
   per_pin_on_fail
   log_mixed_signal_waveform
   fail_per_label
   ffc_enable
   log_first
   ffv_enable
   frg_enable
   hardware_dsp_disable
)
ALIASES =
{
  tim_equ_set:     :timing_equation,
  tim_spec_set:    :timing_spec,
  timset:          :timing_set,
  timeset:         :timing_set,
  time_set:        :timing_set,
  lev_equ_set:     :level_equation,
  lev_spec_set:    :level_spec,
  levset:          :level_set,
  levels:          :level_set,
  pin_levels:      :level_set,
  anaset:          :analog_set,
  test_num:        :test_number,
  test_function:   :test_method,
  value_on_pass:   :pass_value,
  value_on_fail:   :fail_value,
  seqlbl:          :pattern,
  mx_waves_enable: :log_mixed_signal_waveform,
  hw_dsp_disable:  :hardware_dsp_disable,
  ffc_on_fail:     :log_first
}
DEFAULTS =
{
  output_on_pass:  true,
  output_on_fail:  true,
  pass_value:      true,
  fail_value:      true,
  per_pin_on_pass: true,
  per_pin_on_fail: true
}

Instance Method Summary collapse

Constructor Details

#initialize(name, attrs = {}) ⇒ TestSuite

Returns a new instance of TestSuite.



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 86

def initialize(name, attrs = {})
  @name = name
  # Set the defaults
  DEFAULTS.each do |k, v|
    send("#{k}=", v)
  end
  # Then the values that have been supplied
  attrs.each do |k, v|
    send("#{k}=", v) if respond_to?("#{k}=") && k.to_sym != :name
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



129
130
131
132
133
134
135
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 129

def method_missing(method, *args, &block)
  if test_method && test_method.respond_to?(method)
    test_method.send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#inspectObject



98
99
100
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 98

def inspect
  "<TestSuite: #{name}>"
end

#linesObject



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 107

def lines
  l = []
  l << '  override = 1;'
  l << " override_tim_equ_set = #{wrap_if_string(timing_equation)};" if timing_equation
  l << " override_lev_equ_set = #{wrap_if_string(level_equation)};" if level_equation
  l << " override_tim_spec_set = #{wrap_if_string(timing_spec)};" if timing_spec
  l << " override_lev_spec_set = #{wrap_if_string(level_spec)};" if level_spec
  l << " override_anaset = #{wrap_if_string(analog_set)};" if analog_set
  l << " override_timset = #{wrap_if_string(timing_set)};" if timing_set
  l << " override_levset = #{wrap_if_string(level_set)};" if level_set
  l << " override_seqlbl = #{wrap_if_string(pattern)};" if pattern
  l << " override_test_number = #{test_number};" if test_number
  l << " override_testf = #{test_method.id};" if test_method
  l << "  test_level = #{test_level};" if test_level
  l << "  ffc_on_fail = #{wrap_if_string(log_first)};" if log_first
  l << " comment = \"#{comment}\";" if comment
  l << "local_flags  = #{flags};"
  l << ' site_match = 2;'
  l << ' site_control = "parallel:";'
  l
end

#name=(val, options = {}) ⇒ Object

The name is immutable once the test_suite is created, this will raise an error when called



103
104
105
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 103

def name=(val, options = {})
  fail 'Once assigned the name of a test suite cannot be changed!'
end

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 137

def respond_to?(method)
  (test_method && test_method.respond_to?(method)) || super
end