Class: OrigenTesters::IGXLBasedTester::Base::FlowLine

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/igxl_based_tester/base/flow_line.rb

Direct Known Subclasses

J750::FlowLine, UltraFLEX::FlowLine

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, attrs = {}) ⇒ FlowLine

Returns a new instance of FlowLine.



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 152

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 self.respond_to?("#{k}=")
  end
  # Then the values that have been supplied
  attrs.each do |k, v|
    send("#{k}=", v) if self.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_setupObject

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

#idObject

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 id
  @id
end

#typeObject

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

.defineObject



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
145
146
147
148
149
150
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 110

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_counterObject



268
269
270
271
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 268

def self.unique_counter
  @ix ||= -1
  @ix += 1
end

Instance Method Details

#continue_passObject



212
213
214
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 212

def continue_pass
  self.result = 'Pass'
end

#debug_assume_failObject



220
221
222
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 220

def debug_assume_fail
  self.debug_assume = 'Fail'
end

#debug_assume_passObject



216
217
218
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 216

def debug_assume_pass
  self.debug_assume = 'Pass'
end

#parameterObject



179
180
181
182
183
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 179

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



170
171
172
173
174
175
176
177
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 170

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



256
257
258
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 256

def run_if_all_(args)
  # code
end

#run_if_all_failed(parent) ⇒ Object



251
252
253
254
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 251

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



241
242
243
244
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 241

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



246
247
248
249
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 246

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



236
237
238
239
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 236

def run_if_any_passed(parent)
  parent.continue_on_fail
  self.flag_true_any = parent.set_flag_on_pass
end

#set_flag_on_passObject

def debug_sites

  self.debug_sites = "All"
end


228
229
230
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 228

def set_flag_on_pass
  self.flag_pass = "#{id}_PASSED"
end

#set_flag_on_ranObject



232
233
234
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 232

def set_flag_on_ran
  self.flag_pass = "#{id}_RAN"
end

#test?Boolean

Returns:

  • (Boolean)


273
274
275
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 273

def test?
  @type == :test
end

#to_sObject

Returns the fully formatted flow line for insertion into a flow sheet



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 186

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_counterObject



264
265
266
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 264

def unique_counter
  @unique_counter ||= self.class.unique_counter
end

#unless_enable=(*args) ⇒ Object Also known as: unless_enabled=



208
209
# File 'lib/origen_testers/igxl_based_tester/base/flow_line.rb', line 208

def unless_enable=(*args)
end