Class: OrigenTesters::SmartestBasedTester::Base::LimitsFile

Inherits:
ATP::Formatter show all
Includes:
Generator
Defined in:
lib/origen_testers/smartest_based_tester/base/limits_file.rb

Direct Known Subclasses

V93K::LimitsFile, V93K_SMT8::LimitsFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #finalize, #identity_map, #import, #inhibit_output, #name, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #platform, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Methods inherited from ATP::Formatter

#format, format, run, run_and_format, #run_and_format

Methods inherited from ATP::Processor

#clean_flag, #extract_volatiles, #handler_missing, #process, #process_all, #run, #volatile?, #volatile_flags

Constructor Details

#initialize(flow, options = {}) ⇒ LimitsFile

Returns a new instance of LimitsFile.



10
11
12
13
14
15
16
17
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 10

def initialize(flow, options = {})
  @flow = flow
  @flowname = flow.filename.sub(/\..*/, '') # Base off the filename since it will include any prefix
  @used_test_numbers = {}
  @test_modes = Array(options[:test_modes])
  @empty = true
  @smt8 = tester.smt8?
end

Instance Attribute Details

#bin_namesObject (readonly)

Returns the value of attribute bin_names.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 8

def bin_names
  @bin_names
end

#flowObject (readonly)

Returns the value of attribute flow.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 8

def flow
  @flow
end

#flownameObject (readonly)

Returns the value of attribute flowname.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 8

def flowname
  @flowname
end

#test_modesObject

Returns the value of attribute test_modes.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 8

def test_modes
  @test_modes
end

Instance Method Details

#empty?Boolean

Returns true if the AST provided when initializing this limits table generator did not contain any tests, i.e. the resultant limits file is empty

Returns:

  • (Boolean)


104
105
106
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 104

def empty?
  @empty
end

#generate(ast) ⇒ Object



65
66
67
68
69
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 65

def generate(ast)
  @bin_names = Processors::ExtractBinNames.new.run(ast)
  header
  process(ast)
end

#headerObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 19

def header
  if smt8?
    @test_path = []
    l = 'Test Suite,Test,Test Number,Test Text'
    if test_modes.empty?
      l += ',Low Limit,High Limit'
    else
      l += ',Low Limit'
      (test_modes.size - 1).times { l += ',' }
      l += ',High Limit'
      (test_modes.size - 1).times { l += ',' }
    end
    l += ',Unit,Soft Bin'
    lines << l

    l = ',,,'
    if test_modes.empty?
      l += ',default,default'
    else
      test_modes.each { |mode| l += ",#{mode}" }
      test_modes.each { |mode| l += ",#{mode}" }
    end
    lines << l

  else
    l = '"Suite name","Pins","Test name","Test number"'
    if test_modes.empty?
      l += ',"Lsl","Lsl_typ","Usl_typ","Usl","Units","Bin_s_num","Bin_s_name","Bin_h_num","Bin_h_name","Bin_type","Bin_reprobe","Bin_overon","Test_remarks"'
      lines << l
    else
      l += (',"Lsl","Lsl_typ","Usl_typ","Usl","Units"' * test_modes.size) + ',"Bin_s_num","Bin_s_name","Bin_h_num","Bin_h_name","Bin_type","Bin_reprobe","Bin_overon","Test_remarks"'
      lines << l
      l = '"Test mode",,,'
      test_modes.each do |mode|
        l += ",\"#{mode}\",\"#{mode}\",\"#{mode}\",\"#{mode}\",\"#{mode}\""
      end
      l += ',,,,,,,,'
      lines << l
    end
  end
end

#limits_workbookObject



108
109
110
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 108

def limits_workbook
  Origen.interface.limits_workbook
end

#linesObject



71
72
73
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 71

def lines
  @lines ||= []
end

#on_sub_flow(node) ⇒ Object



96
97
98
99
100
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 96

def on_sub_flow(node)
  @test_path << Pathname.new(node.find(:path).value).basename('.*').to_s
  process_all(node.children)
  @test_path.pop
end

#on_test(node) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 83

def on_test(node)
  o = {}
  o[:suite_name] = extract_test_suite_name(node)

  lines << line(extract_line_options(node, o))

  node.find_all(:sub_test).each do |sub_test|
    lines << line(extract_line_options(sub_test, o.dup))
  end

  process_all(node.children)
end

#subdirectoryObject



75
76
77
78
79
80
81
# File 'lib/origen_testers/smartest_based_tester/base/limits_file.rb', line 75

def subdirectory
  if tester.smt7?
    'testtable/limits'
  else
    "#{tester.package_namespace}/limits"
  end
end