Class: OrigenTesters::SmartestBasedTester::V93K_SMT8::ShmooTest

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb

Constant Summary collapse

ATTRS =
%w(
  name

  bypass
  target
  result_title
  result_type
  result_signal
  execution_order
  ffc_error_count
  axis
)
ALIASES =
{
  targets: :target,
  title:   :result_title,
  type:    :result_type,
  signal:  :result_signal
}
DEFAULTS =
{
}
NO_STRING_TYPES =
[:list_strings, :list_classes, :class]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ShmooTest.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 50

def initialize(name, attrs = {})
  @name = name
  if interface.unique_test_names == :signature
    if interface.flow.sig
      @name = "#{name}_#{interface.flow.sig}"
    end
  elsif interface.unique_test_names == :flowname || interface.unique_test_names == :flow_name
    @name = "#{name}_#{interface.flow.name.to_s.symbolize}"
  elsif interface.unique_test_names == :preflowname || interface.unique_test_names == :pre_flow_name
    @name = "#{interface.flow.name.to_s.symbolize}_#{name}"
  elsif interface.unique_test_names
    utn_string = interface.unique_test_names.to_s
    if utn_string =~ /^prepend_/
      utn_string = utn_string.gsub(/^prepend_/, '')
      @name = "#{utn_string}_#{name}"
    else
      utn_string = utn_string.gsub(/^append_/, '')
      @name = "#{name}_#{utn_string}"
    end
  end

  # handle axis
  if axis = attrs.delete(:axis)
    axis = [axis] unless axis.is_a?(Array)
    axis.each_with_index do |a, i|
      aname = a.delete(:name) || "axis#{i + 1}"
      if axes_names.include?(aname.to_sym)
        fail "Axis name #{aname} is already used in shmoo test '#{@name}'"
      end
      axes << ShmooTestAxis.new(aname.to_sym, a)
    end
  else
    fail 'ShmooTest must have at least one axis'
  end

  # Set the defaults
  self.class::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

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



48
49
50
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 48

def meta
  @meta
end

Instance Method Details

#axesObject



112
113
114
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 112

def axes
  @axes ||= []
end

#axes_namesObject



116
117
118
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 116

def axes_names
  axes.map(&:name)
end

#inspectObject



99
100
101
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 99

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

#interfaceObject



108
109
110
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 108

def interface
  Origen.interface
end

#linesObject



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/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 120

def lines
  l = []
  l << "shmoo #{name} {"
  if target.length > 1
    l << "    target = \#[#{target.map(&:to_s).join(',')}];"
  else
    l << "    target = #{target[0]};"
  end
  l << "    resultTitle = \"#{result_title}\";" if result_title
  l << "    resultType = \"#{result_type}\";" if result_type
  l << "    resultSignal = \"#{result_signal}\";" if result_signal
  l << "    executionOrder = #{execution_order};" if execution_order
  l << "    bypass = \"#{bypass}\";" if bypass
  l << "    ffcErrorCount = #{ffc_error_count};" if ffc_error_count
  l << ''

  axes.each do |a|
    a.lines.each do |al|
      l << al
    end
  end

  l << '}'
  l
end

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

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



104
105
106
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 104

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

#smt8?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 95

def smt8?
  tester.smt8?
end