Class: OrigenTesters::SmartestBasedTester::V93K_SMT8::ShmooTestTracking

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

Constant Summary collapse

ATTRS =
%w(
  name

  resource_type
  resource_name
  setup_signal

  range_list
  range_start
  range_stop
  range_relative_percentage_start
  range_relative_percentage_stop
  range_relative_value_start
  range_relative_value_stop
)

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ShmooTestTracking.



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 352

def initialize(name, attrs = {})
  @name = name

  @resource_type = attrs.delete(:resource_type)
  @resource_name = attrs.delete(:resource_name)
  @setup_signal = attrs.delete(:setup_signal)

  if range = attrs.delete(:range)
    if range.is_a?(Range)
      @range_start = range.begin
      @range_stop = range.end
    elsif range.is_a?(Hash)
      @range_start = range[:start]
      @range_stop = range[:stop]
    elsif range.is_a?(Array)
      @range_list = range
    end
  elsif range_relative_percentage = attrs.delete(:range_relative_percentage)
    if range_relative_percentage.is_a?(Range)
      @range_relative_percentage_start = range_relative_percentage.begin
      @range_relative_percentage_stop = range_relative_percentage.end
    elsif range_relative_percentage.is_a?(Hash)
      @range_relative_percentage_start = range_relative_percentage[:start]
      @range_relative_percentage_stop = range_relative_percentage[:stop]
    end
  elsif range_relative_value = attrs.delete(:range_relative_value)
    if range_relative_value.is_a?(Range)
      @range_relative_value_start = range_relative_value.begin
      @range_relative_value_stop = range_relative_value.end
    elsif range_relative_value.is_a?(Hash)
      @range_relative_value_start = range_relative_value[:start]
      @range_relative_value_stop = range_relative_value[:stop]
    end
  else
    attrs.each do |k, v|
      send("#{k}=", v) if respond_to?("#{k}=") && k.to_sym != :name
    end
  end
end

Instance Method Details

#linesObject



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb', line 392

def lines
  l = []
  l << "        tracking [#{name}] = {"
  if resource_type
    l << "            resourceType = #{resource_type};"
  else
    fail 'Shmoo Tracking must have a resource type'
  end
  if resource_name
    l << "            resourceName = \"#{resource_name}\";"
  else
    fail 'Shmoo Tracking must have a resource name'
  end
  l << "            setup_signal = \"#{setup_signal}\";" if setup_signal
  if range_list
    l << "            range.list = \#[#{range_list.map(&:to_s).join(',')}];"
  elsif range_start && range_stop
    l << "            range.start = #{range_start};"
    l << "            range.stop = #{range_stop};"
  elsif range_relative_percentage_start && range_relative_percentage_stop
    l << "            range.relativePercentage.start = #{range_relative_percentage_start};"
    l << "            range.relativePercentage.stop = #{range_relative_percentage_stop};"
  elsif range_relative_value_start && range_relative_value_stop
    l << "            range.relativeValue.start = #{range_relative_value_start};"
    l << "            range.relativeValue.stop = #{range_relative_value_stop};"
  else
    fail 'Shmoo Tracking must have a range (start & stop) or range list'
  end
  l << '        };'
  l
end