origen_testers 0.31.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/config/application.rb +3 -1
  3. data/config/shared_commands.rb +4 -0
  4. data/config/version.rb +1 -1
  5. data/lib/origen_testers/api.rb +8 -0
  6. data/lib/origen_testers/atp/flow.rb +30 -9
  7. data/lib/origen_testers/flow.rb +36 -2
  8. data/lib/origen_testers/generator.rb +44 -5
  9. data/lib/origen_testers/interface.rb +22 -2
  10. data/lib/origen_testers/origen_ext/generator.rb +4 -3
  11. data/lib/origen_testers/origen_ext/generator/flow.rb +99 -5
  12. data/lib/origen_testers/program_generators.rb +5 -1
  13. data/lib/origen_testers/smartest_based_tester.rb +1 -0
  14. data/lib/origen_testers/smartest_based_tester/base.rb +177 -114
  15. data/lib/origen_testers/smartest_based_tester/base/flow.rb +329 -127
  16. data/lib/origen_testers/smartest_based_tester/base/generator.rb +25 -7
  17. data/lib/origen_testers/smartest_based_tester/base/limits_file.rb +186 -60
  18. data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +4 -0
  19. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +4 -0
  20. data/lib/origen_testers/smartest_based_tester/base/processors/extract_bin_names.rb +5 -1
  21. data/lib/origen_testers/smartest_based_tester/base/processors/extract_flow_vars.rb +108 -0
  22. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +8 -3
  23. data/lib/origen_testers/smartest_based_tester/base/test_suite.rb +9 -108
  24. data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +17 -7
  25. data/lib/origen_testers/smartest_based_tester/base/variables_file.rb +29 -7
  26. data/lib/origen_testers/smartest_based_tester/smt7.rb +59 -0
  27. data/lib/origen_testers/smartest_based_tester/smt8.rb +218 -0
  28. data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +32 -0
  29. data/lib/origen_testers/smartest_based_tester/v93k/templates/vars.tf.erb +2 -2
  30. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +109 -0
  31. data/lib/origen_testers/smartest_based_tester/v93k_smt8.rb +8 -0
  32. data/lib/origen_testers/smartest_based_tester/v93k_smt8/flow.rb +234 -0
  33. data/lib/origen_testers/smartest_based_tester/v93k_smt8/generator.rb +48 -0
  34. data/lib/origen_testers/smartest_based_tester/v93k_smt8/limits_file.rb +14 -0
  35. data/lib/origen_testers/smartest_based_tester/v93k_smt8/limits_workbook.rb +148 -0
  36. data/lib/origen_testers/smartest_based_tester/v93k_smt8/templates/limits.csv.erb +3 -0
  37. data/lib/origen_testers/smartest_based_tester/v93k_smt8/templates/template.flow.erb +41 -0
  38. data/lib/origen_testers/smartest_based_tester/v93k_smt8/test_suite.rb +66 -0
  39. data/lib/origen_testers/stil_based_tester/base.rb +4 -0
  40. data/lib/origen_testers/test/interface.rb +16 -2
  41. data/lib/origen_testers/vector_generator.rb +9 -4
  42. data/lib/origen_testers/vector_pipeline.rb +1 -1
  43. data/pattern/nvm/v93k/v93k_workout.rb +7 -0
  44. data/program/_erase_vfy.rb +2 -1
  45. data/program/components/_deep_nested.rb +3 -0
  46. data/program/components/_prb1_main.rb +1 -1
  47. data/program/components/_prb2_main.rb +6 -2
  48. data/program/flow_control.rb +3 -3
  49. data/program/prb1.rb +4 -0
  50. data/program/prb2.rb +7 -3
  51. data/templates/origen_guides/pattern/v93k.md.erb +24 -0
  52. data/templates/origen_guides/program/v93k.md.erb +6 -148
  53. data/templates/origen_guides/program/v93ksmt7.md.erb +165 -0
  54. data/templates/origen_guides/program/v93ksmt8.md.erb +112 -0
  55. metadata +30 -3
  56. data/lib/origen_testers/smartest_based_tester/base/test_methods/smart_calc_tml.rb +0 -23
@@ -0,0 +1,14 @@
1
+ module OrigenTesters
2
+ module SmartestBasedTester
3
+ class V93K_SMT8
4
+ require 'origen_testers/smartest_based_tester/base/limits_file'
5
+ class LimitsFile < Base::LimitsFile
6
+ TEMPLATE = "#{Origen.root!}/lib/origen_testers/smartest_based_tester/v93k_smt8/templates/limits.csv.erb"
7
+
8
+ def fully_formatted_filename
9
+ "Main.#{@filename}_Tests.csv"
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,148 @@
1
+ require 'rodf'
2
+ module OrigenTesters
3
+ module SmartestBasedTester
4
+ class V93K_SMT8
5
+ # Responsible for creating a limits workbook for each program generation run
6
+ # Each limits file will generate a sheet within this workbook
7
+ class LimitsWorkbook
8
+ include OrigenTesters::Generator
9
+
10
+ def initialize(options = {})
11
+ @softbins = {}
12
+ @bins = {}
13
+ end
14
+
15
+ def add_softbin(number, options = {})
16
+ options = {
17
+ name: nil,
18
+ bin: nil,
19
+ result: 'FAIL',
20
+ color: 'RED',
21
+ priority: 2
22
+ }.merge(options)
23
+ attrs = @softbins[number] || {}
24
+
25
+ attrs[:name] = options[:name] if options[:name]
26
+ attrs[:bin] = options[:bin] if options[:bin]
27
+ if !attrs[:result] || (options[:result] && options[:result] != 'FAIL')
28
+ attrs[:result] = options[:result]
29
+ end
30
+ if !attrs[:color] || (options[:color] && options[:color] != 'RED')
31
+ attrs[:color] = options[:color]
32
+ end
33
+ if !attrs[:priority] || (options[:priority] && options[:priority] != 2)
34
+ attrs[:priority] = options[:priority]
35
+ end
36
+
37
+ @softbins[number] = attrs
38
+ end
39
+
40
+ def add_bin(number, options = {})
41
+ options = {
42
+ name: nil,
43
+ result: 'FAIL'
44
+ }.merge(options)
45
+
46
+ attrs = @bins[number] || {}
47
+
48
+ attrs[:name] = options[:name] if options[:name]
49
+ if !attrs[:result] || (options[:result] && options[:result] != 'FAIL')
50
+ attrs[:result] = options[:result]
51
+ end
52
+
53
+ @bins[number] = attrs
54
+ end
55
+
56
+ def fully_formatted_filename
57
+ 'limits.ods'
58
+ end
59
+
60
+ def subdirectory
61
+ "#{tester.package_namespace}/common"
62
+ end
63
+
64
+ def write_to_file(options = {})
65
+ Origen.log.info "Writing... #{output_file}"
66
+ spreadsheet = RODF::Spreadsheet.new
67
+ Origen.interface.flow_sheets.each do |name, flow|
68
+ if flow.limits_file
69
+ limits_name = flow.limits_file.filename.sub('.csv', '')
70
+ table = spreadsheet.table limits_name
71
+ flow.limits_file.output_file.readlines.each_with_index do |line, i|
72
+ # Need to fix the first row, SMT8 won't allow the Low/High limits cells not to be merged
73
+ if i == 0
74
+ row = table.row
75
+ x = nil
76
+ line.chomp.split(',').each do |word|
77
+ if word == 'Low Limit'
78
+ x = 0
79
+ elsif word == 'High Limit'
80
+ row.cell 'Low Limit', span: x + 1
81
+ x = 0
82
+ elsif word == 'Unit'
83
+ row.cell 'High Limit', span: x + 1
84
+ row.cell word
85
+ x = nil
86
+ elsif x
87
+ x += 1
88
+ else
89
+ row.cell word
90
+ end
91
+ end
92
+ else
93
+ row = table.row
94
+ line.chomp.split(',').each do |word|
95
+ row.cell word
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ if tester.separate_bins_file
102
+ bins_file = output_file.sub('.ods', '_bins.ods')
103
+ Origen.log.info "Writing... #{bins_file}"
104
+ bins_ss = RODF::Spreadsheet.new
105
+ add_bin_sheets(bins_ss)
106
+ bins_ss.write_to(bins_file)
107
+ else
108
+ add_bin_sheets(spreadsheet)
109
+ end
110
+ spreadsheet.write_to(output_file)
111
+ end
112
+
113
+ def add_bin_sheets(spreadsheet)
114
+ table = spreadsheet.table 'Software_Bins'
115
+ row = table.row
116
+ row.cell 'Software Bin'
117
+ row.cell 'Software Bin Name'
118
+ row.cell 'Hardware Bin'
119
+ row.cell 'Result'
120
+ row.cell 'Color'
121
+ row.cell 'Priority'
122
+ @softbins.each do |sbin, attrs|
123
+ row = table.row
124
+ row.cell sbin
125
+ row.cell attrs[:name]
126
+ row.cell attrs[:bin]
127
+ row.cell attrs[:result]
128
+ row.cell attrs[:color]
129
+ row.cell attrs[:priority]
130
+ end
131
+
132
+ # Write out the bin table
133
+ table = spreadsheet.table 'Hardware_Bins'
134
+ row = table.row
135
+ row.cell 'Hardware Bin'
136
+ row.cell 'Hardware Bin Name'
137
+ row.cell 'Result'
138
+ @bins.each do |bin, attrs|
139
+ row = table.row
140
+ row.cell bin
141
+ row.cell attrs[:name]
142
+ row.cell attrs[:result]
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,3 @@
1
+ % lines.each do |line|
2
+ <%= line %>
3
+ % end
@@ -0,0 +1,41 @@
1
+ flow <%= flow_name %> {
2
+ % input_variables.each do |var|
3
+ % if var.is_a?(Array)
4
+ in <%= var[0].to_s %> = <%= var[1].is_a?(String) || var[1].is_a?(Symbol) ? "\"#{var[1]}\"" : var[1] %>;
5
+ % else
6
+ in <%= var.to_s %> = -1;
7
+ % end
8
+ % end
9
+
10
+ % output_variables.each do |var|
11
+ % if var.is_a?(Array)
12
+ out <%= var[0].to_s %> = <%= var[1].is_a?(String) || var[1].is_a?(Symbol) ? "\"#{var[1]}\"" : var[1] %>;
13
+ % else
14
+ out <%= var.to_s %> = -1;
15
+ % end
16
+ % end
17
+
18
+ setup {
19
+ % test_suites.sorted_collection.each do |suite|
20
+ % suite.lines.each do |line|
21
+ <%= line %>
22
+ % end
23
+
24
+ % end
25
+ % sub_flows.each do |name, path|
26
+ flow <%= name %> calls <%= path %> { }
27
+ % end
28
+ }
29
+
30
+ execute {
31
+ % flow_header.each do |line|
32
+ <%= line %>
33
+ % end
34
+ % lines.each do |line|
35
+ <%= line %>
36
+ % end
37
+ % flow_footer.each do |line|
38
+ <%= line %>
39
+ % end
40
+ }
41
+ }
@@ -0,0 +1,66 @@
1
+ module OrigenTesters
2
+ module SmartestBasedTester
3
+ class V93K_SMT8
4
+ require 'origen_testers/smartest_based_tester/base/test_suite'
5
+ class TestSuite < Base::TestSuite
6
+ ATTRS =
7
+ %w(
8
+ name
9
+ comment
10
+
11
+ test_method
12
+
13
+ pattern
14
+ specification
15
+ )
16
+
17
+ ALIASES = {
18
+ spec: :specification,
19
+ test_function: :test_method
20
+ }
21
+
22
+ DEFAULTS = {
23
+ }
24
+
25
+ # Generate accessors for all attributes and their aliases
26
+ ATTRS.each do |attr|
27
+ if attr == 'name' || attr == 'pattern'
28
+ attr_reader attr.to_sym
29
+ else
30
+ attr_accessor attr.to_sym
31
+ end
32
+ end
33
+
34
+ # Define the aliases
35
+ ALIASES.each do |_alias, val|
36
+ define_method("#{_alias}=") do |v|
37
+ send("#{val}=", v)
38
+ end
39
+ define_method("#{_alias}") do
40
+ send(val)
41
+ end
42
+ end
43
+
44
+ def lines
45
+ l = []
46
+ l << "suite #{name} calls #{test_method.klass} {"
47
+ if pattern && !pattern.to_s.empty?
48
+ l << " measurement.pattern = setupRef(#{tester.package_namespace}.patterns.#{pattern});"
49
+ end
50
+ if specification && !specification.to_s.empty?
51
+ l << " measurement.specification = setupRef(#{tester.package_namespace}.specs.#{specification});"
52
+ end
53
+ test_method.sorted_parameters.each do |param|
54
+ name = param[0]
55
+ unless name.is_a?(String)
56
+ name = name.to_s[0] == '_' ? name.to_s.camelize(:upper) : name.to_s.camelize(:lower)
57
+ end
58
+ l << " #{name} = #{wrap_if_string(test_method.format(param[0]))};"
59
+ end
60
+ l << '}'
61
+ l
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -252,6 +252,10 @@ module OrigenTesters
252
252
  Origen.log.warning "Call to match loop on pin #{pin.id} is not supported by the STIL generator and has been ignored"
253
253
  end
254
254
 
255
+ def match_block(timeout_in_cycles, options = {}, &block)
256
+ Origen.log.warning 'Call to match loop block is not supported by the STIL generator and has been ignored'
257
+ end
258
+
255
259
  # Add a loop to the pattern.
256
260
  #
257
261
  # Pass in the number of times to execute it, all vectors
@@ -3,9 +3,13 @@ module OrigenTesters
3
3
  class Interface
4
4
  include OrigenTesters::ProgramGenerators
5
5
 
6
+ attr_accessor :include_additional_prb2_test
7
+ attr_reader :environment
8
+
6
9
  # Options passed to Flow.create and Library.create will be passed in here, use as
7
10
  # desired to configure your interface
8
11
  def initialize(options = {})
12
+ @environment = options[:environment]
9
13
  end
10
14
 
11
15
  # Test that the block form of flow control methods like this can
@@ -62,7 +66,12 @@ module OrigenTesters
62
66
  tm = test_methods.ac_tml.ac_test.functional_test
63
67
  ts = test_suites.run(name, options)
64
68
  ts.test_method = tm
65
- ts.levels = options.delete(:pin_levels) if options[:pin_levels]
69
+ if tester.smt8?
70
+ ts.spec = options.delete(:pin_levels) if options[:pin_levels]
71
+ ts.spec ||= 'specs.Nominal'
72
+ else
73
+ ts.levels = options.delete(:pin_levels) if options[:pin_levels]
74
+ end
66
75
  if block
67
76
  ts.pattern = "#{name}_b#{i}"
68
77
  else
@@ -241,7 +250,12 @@ module OrigenTesters
241
250
  tm = test_methods.dc_tml.dc_test.general_pmu
242
251
  ts = test_suites.run(name, options)
243
252
  ts.test_method = tm
244
- ts.levels = options.delete(:pin_levels) if options[:pin_levels]
253
+ if tester.smt8?
254
+ ts.spec = options.delete(:pin_levels) if options[:pin_levels]
255
+ ts.spec ||= 'specs.Nominal'
256
+ else
257
+ ts.levels = options.delete(:pin_levels) if options[:pin_levels]
258
+ end
245
259
  ts.lo_limit = options[:lo_limit] if options[:lo_limit]
246
260
  ts.hi_limit = options[:hi_limit] if options[:hi_limit]
247
261
  ts.pattern = name.to_s
@@ -280,6 +280,7 @@ module OrigenTesters
280
280
  # Vector objects (vector lines)
281
281
  #
282
282
  def format(vector_array, section)
283
+ tester_writing_pattern = respond_to?(:open_and_write_pattern)
283
284
  # Go through vector_array and print out both
284
285
  # vectors and non-vectors to pattern (via 'yield line')
285
286
  vector_array.each do |vec|
@@ -298,14 +299,14 @@ module OrigenTesters
298
299
  end
299
300
  pipeline.flush do |vector|
300
301
  expand_vector(vector) do |line|
301
- yield line
302
+ yield line unless tester_writing_pattern
302
303
  end
303
304
  end
304
305
  end
305
306
  # now flush buffer if there is still a vector
306
307
  pipeline.empty(min_vectors: section == :footer ? @min_pattern_vectors : nil) do |vector|
307
308
  expand_vector(vector) do |line|
308
- yield line
309
+ yield line unless tester_writing_pattern
309
310
  end
310
311
  end
311
312
  end
@@ -335,7 +336,7 @@ module OrigenTesters
335
336
  @dont_compress = val
336
337
  end
337
338
 
338
- # expands (uncompresses to pattern) vector if desired or leaves it as is
339
+ # expands (un-compresses to pattern) vector if desired or leaves it as is
339
340
  # allows for tracking and formatting of vector
340
341
  # if comment then return without modification
341
342
  def expand_vector(vec)
@@ -349,10 +350,14 @@ module OrigenTesters
349
350
  yield track_and_format_vector(vec)
350
351
  end
351
352
  else
352
- yield vec # Return comments without modification
353
+ yield track_and_format_comment(vec) # Return comments without modification
353
354
  end
354
355
  end
355
356
 
357
+ def track_and_format_comment(comment)
358
+ comment
359
+ end
360
+
356
361
  # Update tracking info (stats object) and allow for
357
362
  # any additional formatting via format_vector
358
363
  # method if overridden
@@ -23,7 +23,7 @@ module OrigenTesters
23
23
  end
24
24
 
25
25
  def push_microcode(code)
26
- if $tester.v93k? && code =~ /JSUB/
26
+ if $tester.v93k? && $tester.smt_version == 7 && code =~ /JSUB/
27
27
  @vector_count += 1
28
28
  end
29
29
  comments << code
@@ -72,6 +72,13 @@ Pattern.create do
72
72
  :pin2 => $nvm.pin(:fail), :state2 => :low)
73
73
  $nvm.pin(:fail).assert(0)
74
74
 
75
+ ss "Test a block match loop"
76
+ tester.wait match: true, time_in_us: 5000 do
77
+ $nvm.pin(:done).assert(1)
78
+ $nvm.pin(:fail).assert(1)
79
+ 1.cycle
80
+ end
81
+
75
82
  ss "Test looping, these vectors should be executed once"
76
83
  $tester.loop_vector("test_loop_1", 1) do
77
84
  $nvm.pins(:porta).drive(0xAA)
@@ -1,5 +1,6 @@
1
1
  Flow.create do |options|
2
2
 
3
- func :margin_read1_all1, number: options[:number]
3
+ # Added set-flag to test that manually set flags are brought up to the top-level for SMT8
4
+ func :margin_read1_all1, number: options[:number], on_fail: { set_flag: :ers_vfy_failed }
4
5
 
5
6
  end
@@ -0,0 +1,3 @@
1
+ Flow.create do |options|
2
+ test :deep_test, id: :deep_test
3
+ end
@@ -226,5 +226,5 @@ Flow.create do |options|
226
226
  func "cc_test_#{i}".to_sym, number: 7000 + i
227
227
  end
228
228
 
229
- pass 1, description: "Good die!", softbin: 1
229
+ import 'deep_nested'
230
230
  end
@@ -1,6 +1,10 @@
1
1
  Flow.create do |options|
2
2
 
3
- func :pgm_ckbd, number: options[:number] + 10
4
- func :mrd_ckbd, number: options[:number] + 20
3
+ if environment == :probe
4
+ func :pgm_ckbd, number: options[:number] + 10
5
+ func :mrd_ckbd, number: options[:number] + 20
6
+ end
7
+
8
+ self.include_additional_prb2_test = true
5
9
 
6
10
  end
@@ -434,13 +434,13 @@ Flow.create interface: 'OrigenTesters::Test::Interface', flow_name: "Flow Contro
434
434
  func :test2, unless_flag: :$Alarm, number: 51950
435
435
 
436
436
  # The is auto-generated comment from hashtag
437
- func_with_comment :test1
437
+ func_with_comment :test1, number: 51952
438
438
 
439
439
  cc 'The is auto-generated comment from cc'
440
- func_with_comment :test1
440
+ func_with_comment :test1, number: 51954
441
441
 
442
442
  log 'Use bin_attrs to set not_over_on'
443
- func :test1n, number: 51960, bin: 12, bin_attrs: { not_over_on: true }
443
+ func :test1n, number: 51956, bin: 12, bin_attrs: { not_over_on: true }
444
444
 
445
445
  end
446
446