origen_testers 0.52.15 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/config/version.rb +2 -2
  3. data/lib/commands/build.rb +2 -2
  4. data/lib/commands/convert.rb +1 -1
  5. data/lib/commands/run.rb +2 -2
  6. data/lib/origen_testers/api.rb +3 -0
  7. data/lib/origen_testers/atp/ast/node.rb +1 -2
  8. data/lib/origen_testers/atp/flow.rb +36 -24
  9. data/lib/origen_testers/atp/flow_api.rb +1 -0
  10. data/lib/origen_testers/atp/parser.rb +6 -4
  11. data/lib/origen_testers/atp/processor.rb +1 -0
  12. data/lib/origen_testers/atp/processors/on_pass_fail_remover.rb +1 -0
  13. data/lib/origen_testers/atp/processors/relationship.rb +2 -4
  14. data/lib/origen_testers/atp/runner.rb +1 -0
  15. data/lib/origen_testers/callback_handlers.rb +1 -0
  16. data/lib/origen_testers/charz/profile.rb +7 -7
  17. data/lib/origen_testers/charz/routines/search_routine.rb +1 -0
  18. data/lib/origen_testers/charz/session.rb +1 -1
  19. data/lib/origen_testers/charz.rb +14 -10
  20. data/lib/origen_testers/command_based_tester.rb +1 -2
  21. data/lib/origen_testers/decompiler/nodes.rb +1 -1
  22. data/lib/origen_testers/decompiler/pattern/enumerable_ext.rb +1 -1
  23. data/lib/origen_testers/decompiler/pattern/splitter.rb +0 -2
  24. data/lib/origen_testers/decompiler/pattern.rb +2 -1
  25. data/lib/origen_testers/flow.rb +2 -3
  26. data/lib/origen_testers/generator/identity_map.rb +1 -1
  27. data/lib/origen_testers/generator/test_numberer.rb +1 -3
  28. data/lib/origen_testers/generator.rb +4 -2
  29. data/lib/origen_testers/igxl_based_tester/base/ac_specsets.rb +1 -1
  30. data/lib/origen_testers/igxl_based_tester/base/custom_test_instance.rb +1 -1
  31. data/lib/origen_testers/igxl_based_tester/base/dc_specsets.rb +1 -1
  32. data/lib/origen_testers/igxl_based_tester/base/edgesets.rb +1 -1
  33. data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +11 -17
  34. data/lib/origen_testers/igxl_based_tester/base/generator.rb +17 -2
  35. data/lib/origen_testers/igxl_based_tester/base/global_specs.rb +1 -1
  36. data/lib/origen_testers/igxl_based_tester/base/job.rb +16 -16
  37. data/lib/origen_testers/igxl_based_tester/base/level_io_se.rb +2 -2
  38. data/lib/origen_testers/igxl_based_tester/base/levelset.rb +2 -5
  39. data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +1 -3
  40. data/lib/origen_testers/igxl_based_tester/base/patset.rb +0 -1
  41. data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +0 -1
  42. data/lib/origen_testers/igxl_based_tester/base/test_instance.rb +13 -14
  43. data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +2 -2
  44. data/lib/origen_testers/igxl_based_tester/base/timesets.rb +1 -1
  45. data/lib/origen_testers/igxl_based_tester/base/timesets_basic.rb +1 -1
  46. data/lib/origen_testers/igxl_based_tester/base.rb +16 -19
  47. data/lib/origen_testers/igxl_based_tester/decompiler/atp.rb +12 -20
  48. data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +1 -2
  49. data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +1 -2
  50. data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +1 -2
  51. data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +7 -8
  52. data/lib/origen_testers/igxl_based_tester/j750.rb +3 -2
  53. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +5 -6
  54. data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +1 -1
  55. data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +18 -20
  56. data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +2 -2
  57. data/lib/origen_testers/igxl_based_tester/parser.rb +12 -12
  58. data/lib/origen_testers/igxl_based_tester/ultraflex/ate_hardware.rb +55 -55
  59. data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +1 -2
  60. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +1 -2
  61. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance.rb +9 -10
  62. data/lib/origen_testers/igxl_based_tester/ultraflex.rb +12 -14
  63. data/lib/origen_testers/igxl_based_tester.rb +1 -1
  64. data/lib/origen_testers/interface.rb +8 -8
  65. data/lib/origen_testers/labview_based_tester/pxie6570.rb +2 -0
  66. data/lib/origen_testers/labview_based_tester.rb +2 -2
  67. data/lib/origen_testers/origen_ext/pins/pin.rb +6 -5
  68. data/lib/origen_testers/origen_ext/pins/pin_collection.rb +6 -6
  69. data/lib/origen_testers/parser/searchable_array.rb +2 -2
  70. data/lib/origen_testers/parser/searchable_hash.rb +2 -2
  71. data/lib/origen_testers/parser.rb +1 -1
  72. data/lib/origen_testers/pattern_compilers/assembler.rb +3 -1
  73. data/lib/origen_testers/pattern_compilers/base.rb +5 -4
  74. data/lib/origen_testers/pattern_compilers/igxl_based.rb +9 -3
  75. data/lib/origen_testers/pattern_compilers/j750.rb +4 -3
  76. data/lib/origen_testers/pattern_compilers/ultraflex.rb +4 -3
  77. data/lib/origen_testers/pattern_compilers/v93k.rb +28 -31
  78. data/lib/origen_testers/pattern_compilers.rb +1 -0
  79. data/lib/origen_testers/program_generators.rb +6 -0
  80. data/lib/origen_testers/smartest_based_tester/base/flow.rb +29 -26
  81. data/lib/origen_testers/smartest_based_tester/base/generator.rb +2 -0
  82. data/lib/origen_testers/smartest_based_tester/base/limits_file.rb +2 -2
  83. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +3 -3
  84. data/lib/origen_testers/smartest_based_tester/base/processors/extract_flow_vars.rb +1 -1
  85. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +3 -0
  86. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +1 -1
  87. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +1 -1
  88. data/lib/origen_testers/smartest_based_tester/base/variables_file.rb +1 -1
  89. data/lib/origen_testers/smartest_based_tester/base.rb +11 -13
  90. data/lib/origen_testers/smartest_based_tester/decompiler/avc.rb +5 -10
  91. data/lib/origen_testers/smartest_based_tester/decompiler/nodes.rb +1 -1
  92. data/lib/origen_testers/smartest_based_tester/decompiler.rb +1 -0
  93. data/lib/origen_testers/smartest_based_tester/smt8.rb +5 -6
  94. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +1 -2
  95. data/lib/origen_testers/smartest_based_tester/v93k.rb +1 -1
  96. data/lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb +3 -2
  97. data/lib/origen_testers/smartest_based_tester/v93k_smt8/test_suite.rb +5 -4
  98. data/lib/origen_testers/smartest_based_tester/v93k_smt8.rb +1 -1
  99. data/lib/origen_testers/stil_based_tester/base.rb +6 -7
  100. data/lib/origen_testers/test/custom_test_interface.rb +7 -7
  101. data/lib/origen_testers/test/dut.rb +23 -22
  102. data/lib/origen_testers/test/interface.rb +9 -7
  103. data/lib/origen_testers/test/nvm.rb +3 -3
  104. data/lib/origen_testers/timing/timeset.rb +0 -2
  105. data/lib/origen_testers/timing/timing_api.rb +2 -3
  106. data/lib/origen_testers/vector.rb +6 -5
  107. data/lib/origen_testers/vector_generator.rb +9 -3
  108. data/lib/origen_testers.rb +1 -1
  109. metadata +7 -23
@@ -1,4 +1,10 @@
1
1
  require 'active_support/concern'
2
+ # Ensure the OrigenTesters namespace and its autoloads (Interface, J750, V93K,
3
+ # etc.) are registered. This file can be loaded directly (e.g. when a plugin
4
+ # interface does `include OrigenTesters::ProgramGenerators` before origen_testers
5
+ # has been fully required), in which case `include Interface` / the PLATFORMS
6
+ # constants below would otherwise raise an uninitialized-constant error.
7
+ require 'origen_testers'
2
8
  module OrigenTesters
3
9
  # Include this module to create an interface that supports multiple tester
4
10
  # types.
@@ -33,7 +33,7 @@ module OrigenTesters
33
33
  tester.smt8?
34
34
  end
35
35
 
36
- def var_filename
36
+ def var_filename # rubocop:disable Lint/DuplicateMethods
37
37
  @var_filename || 'global'
38
38
  end
39
39
 
@@ -41,24 +41,22 @@ module OrigenTesters
41
41
  @var_filename = new_var_filename
42
42
  end
43
43
 
44
- def subdirectory
45
- @subdirectory ||= begin
46
- if smt8?
47
- parents = []
48
- f = parent
49
- while f
50
- parents.unshift(File.basename(f.filename, '.*').to_s.downcase)
51
- f = f.parent
52
- end
53
- if Origen.interface.respond_to?(:insertion) && tester.insertion_in_the_flow_path
54
- File.join tester.package_namespace, Origen.interface.insertion.to_s, 'flows', *parents
55
- else
56
- File.join tester.package_namespace, 'flows', *parents
57
- end
58
- else
59
- 'testflow/mfh.testflow.group'
60
- end
61
- end
44
+ def subdirectory # rubocop:disable Lint/DuplicateMethods
45
+ @subdirectory ||= if smt8?
46
+ parents = []
47
+ f = parent
48
+ while f
49
+ parents.unshift(File.basename(f.filename, '.*').to_s.downcase)
50
+ f = f.parent
51
+ end
52
+ if Origen.interface.respond_to?(:insertion) && tester.insertion_in_the_flow_path
53
+ File.join tester.package_namespace, Origen.interface.insertion.to_s, 'flows', *parents
54
+ else
55
+ File.join tester.package_namespace, 'flows', *parents
56
+ end
57
+ else
58
+ 'testflow/mfh.testflow.group'
59
+ end
62
60
  end
63
61
 
64
62
  def filename
@@ -79,7 +77,7 @@ module OrigenTesters
79
77
  end
80
78
  end
81
79
 
82
- def flow_name(filename = nil)
80
+ def flow_name(filename = nil) # rubocop:disable Lint/DuplicateMethods
83
81
  @flow_name_ = @flow_name unless smt8?
84
82
  @flow_name_ ||= begin
85
83
  flow_name = (filename || self.filename).sub(/\..*/, '').upcase
@@ -91,11 +89,11 @@ module OrigenTesters
91
89
  end
92
90
  end
93
91
 
94
- def flow_bypass
92
+ def flow_bypass # rubocop:disable Lint/DuplicateMethods
95
93
  @flow_bypass || false
96
94
  end
97
95
 
98
- def flow_description
96
+ def flow_description # rubocop:disable Lint/DuplicateMethods
99
97
  @flow_description || ''
100
98
  end
101
99
 
@@ -153,9 +151,8 @@ module OrigenTesters
153
151
  @ast ||= begin
154
152
  unique_id = smt8? ? nil : sig
155
153
  atp.ast(unique_id: unique_id, optimization: :smt,
156
- implement_continue: !tester.force_pass_on_continue,
157
- optimize_flags_when_continue: !tester.force_pass_on_continue
158
- )
154
+ implement_continue: !tester.force_pass_on_continue,
155
+ optimize_flags_when_continue: !tester.force_pass_on_continue)
159
156
  end
160
157
  end
161
158
 
@@ -188,6 +185,7 @@ module OrigenTesters
188
185
  def finalize(options = {})
189
186
  if smt8?
190
187
  return unless top_level? || options[:called_by_top_level]
188
+
191
189
  super
192
190
  # Refresh the ast before finalized gets set to true
193
191
  # If ast gets called by the user the finalized flag will lock it to the incorrect value
@@ -206,6 +204,7 @@ module OrigenTesters
206
204
  unless sub_flow
207
205
  fail "Something went wrong, couldn't find the sub-flow object for path #{path}"
208
206
  end
207
+
209
208
  # on_fail and on_pass nodes are removed because they will be rendered by the sub-flow's parent
210
209
  sub_flow.instance_variable_set(:@ast, sub_flow_ast.remove(:on_fail, :on_pass).updated(:flow))
211
210
  sub_flow.instance_variable_set(:@finalized, true) # To stop the AST being regenerated
@@ -509,6 +508,7 @@ module OrigenTesters
509
508
  if smt8? && !(step == -1 || step == 1)
510
509
  fail 'SMT8 does not support steps other than -1 or 1.'
511
510
  end
511
+
512
512
  if step.is_a?(String) || step.is_a?(Symbol)
513
513
  step = generate_flag_name(step)
514
514
  if tester.smt7?
@@ -520,6 +520,7 @@ module OrigenTesters
520
520
  else
521
521
  var = generate_flag_name(node.to_a[3])
522
522
  end
523
+
523
524
  test_num_inc = node.to_a[4]
524
525
  unless smt8?
525
526
  var = "@#{var}"
@@ -560,6 +561,7 @@ module OrigenTesters
560
561
 
561
562
  def generate_expr_string(node, options = {})
562
563
  return node unless node.respond_to?(:type)
564
+
563
565
  case node.type
564
566
  when :eq, :ne, :gt, :ge, :lt, :le
565
567
  result = "#{generate_expr_term(node.to_a[0])} " # operand 1
@@ -572,7 +574,8 @@ module OrigenTesters
572
574
  end
573
575
 
574
576
  def generate_expr_term(val)
575
- return val if val.is_a?(Fixnum) || val.is_a?(Integer) || val.is_a?(Float)
577
+ return val if val.is_a?(Integer) || val.is_a?(Float)
578
+
576
579
  case val[0]
577
580
  when '$'
578
581
  if smt8?
@@ -83,9 +83,11 @@ module OrigenTesters
83
83
  # Returns the current flow object (Origen.interface.flow)
84
84
  def flow(id = Origen.file_handler.current_file.basename('.rb').to_s)
85
85
  return @current_flow if @current_flow
86
+
86
87
  id = id.to_s.sub(/_resources?/, '')
87
88
  filename = id.split('.').last
88
89
  return flow_sheets[id] if flow_sheets[id] # will return flow if already existing
90
+
89
91
  p = platform::Flow.new
90
92
  p.inhibit_output if Origen.interface.resources_mode?
91
93
  if id == Origen.file_handler.current_file.basename('.rb').to_s && Origen.interface.try(:use_flow_name_for_top_level)
@@ -36,7 +36,7 @@ module OrigenTesters
36
36
  l += ',default,default'
37
37
  else
38
38
  test_modes.each { |mode| l += ",#{mode}" }
39
- test_modes.each { |mode| l += ",#{mode}" }
39
+ test_modes.each { |mode| l += ",#{mode}" } # rubocop:disable Style/CombinableLoops
40
40
  end
41
41
  lines << l
42
42
 
@@ -282,7 +282,7 @@ module OrigenTesters
282
282
  # "Low Limit"
283
283
  l << f((options[:limits][mode] || options[:limits][nil] || {})[:lsl] || 'na')
284
284
  end
285
- test_modes.each do |mode|
285
+ test_modes.each do |mode| # rubocop:disable Style/CombinableLoops
286
286
  # "High Limit"
287
287
  l << f((options[:limits][mode] || options[:limits][nil] || {})[:usl] || 'na')
288
288
  end
@@ -13,15 +13,15 @@ module OrigenTesters
13
13
  @paths = {}
14
14
  end
15
15
 
16
- def filename
16
+ def filename # rubocop:disable Lint/DuplicateMethods
17
17
  @filename || flow.filename.sub('.tf', '.pmfl')
18
18
  end
19
19
 
20
- def subdirectory
20
+ def subdirectory # rubocop:disable Lint/DuplicateMethods
21
21
  @subdirectory ||= 'vectors'
22
22
  end
23
23
 
24
- def paths
24
+ def paths # rubocop:disable Lint/DuplicateMethods
25
25
  { '../vectors' => patterns }
26
26
  end
27
27
 
@@ -1,4 +1,4 @@
1
- require 'set'
1
+ require 'set' # rubocop:disable Lint/RedundantRequireStatement -- needed for Ruby 2.6
2
2
  module OrigenTesters
3
3
  module SmartestBasedTester
4
4
  class Base
@@ -122,6 +122,7 @@ module OrigenTesters
122
122
 
123
123
  def handle_val_type(val, type, attr)
124
124
  return val if val == '' && !tester.smt8?
125
+
125
126
  case type
126
127
  when :current, 'CURR'
127
128
  "#{val}[A]"
@@ -155,11 +156,13 @@ module OrigenTesters
155
156
  unless val.is_a?(Array)
156
157
  fail "#{val} is not an Array. List_strings must have Array values"
157
158
  end
159
+
158
160
  "##{val}"
159
161
  when :list_classes
160
162
  unless val.is_a?(Array)
161
163
  fail "#{val} is not an Array. List_classes must have Array values"
162
164
  end
165
+
163
166
  "##{val.to_s.gsub('"', '')}"
164
167
  else
165
168
  fail "Unknown type for attribute #{attr}: #{type}"
@@ -94,7 +94,7 @@ module OrigenTesters
94
94
  output_dc: {
95
95
  class_name: 'OutputDC',
96
96
  pinlist: [:string, ''],
97
- mode: [:string, 'PROGRAMLOAD', %w(PROGRAMLOAD, PPMU SPMU PPMUTERM SPMUTERM)],
97
+ mode: [:string, 'PROGRAMLOAD', %w(PROGRAMLOAD PPMU SPMU PPMUTERM SPMUTERM)],
98
98
  measure_level: [:string, 'BOTH', %(BOTH LOW HIGH)],
99
99
  force_current_low: [:current, 0],
100
100
  force_current_high: [:current, 0],
@@ -19,7 +19,7 @@ module OrigenTesters
19
19
  @render = true
20
20
  end
21
21
 
22
- def unit=(val)
22
+ def unit=(val) # rubocop:disable Lint/DuplicateMethods
23
23
  case val.to_s.downcase
24
24
  when 'v', 'volts'
25
25
  @unit = 'V'
@@ -11,7 +11,7 @@ module OrigenTesters
11
11
  def initialize(options = {})
12
12
  end
13
13
 
14
- def subdirectory
14
+ def subdirectory # rubocop:disable Lint/DuplicateMethods
15
15
  @subdirectory ||= 'testflow/mfh.testflow.setup'
16
16
  end
17
17
 
@@ -206,12 +206,13 @@ module OrigenTesters
206
206
  def seq_path
207
207
  @seq_path || 'specs'
208
208
  end
209
+
209
210
  # Set the test mode(s) that you want to see in the limits files, supply an array of mode names
210
211
  # to set multiple.
211
212
  def limitfile_test_modes=(val)
212
213
  @limitfile_test_modes = Array(val).map(&:to_s)
213
214
  end
214
- alias_method :limitsfile_test_modes, :limitfile_test_modes=
215
+ alias_method :limitsfile_test_modes, :limitfile_test_modes= # rubocop:disable Lint/DuplicateMethods
215
216
 
216
217
  # return the multiport burst name
217
218
  # provide the name you want to obtain multiport for
@@ -286,7 +287,7 @@ module OrigenTesters
286
287
  super(options)
287
288
  end
288
289
 
289
- unless options_overlay.nil?
290
+ unless options_overlay.nil? # rubocop:disable Lint/EmptyConditionalBody, Lint/RedundantCopDisableDirective
290
291
  # stage = :body if ovly_style == :subroutine # always set stage back to body in case subr overlay was selected
291
292
  end
292
293
  end
@@ -368,12 +369,12 @@ module OrigenTesters
368
369
  # other platforms, such as the J750, is required.
369
370
  def store(*pins)
370
371
  options = pins.last.is_a?(Hash) ? pins.pop : {}
371
- options = { offset: 0
372
- }.merge(options)
372
+ options = { offset: 0 }.merge(options)
373
373
  pins = pins.flatten.compact
374
374
  if pins.empty?
375
375
  fail 'For the V93K you must supply the pins to store/capture'
376
376
  end
377
+
377
378
  pins.each do |pin|
378
379
  pin.restore_state do
379
380
  pin.capture
@@ -395,12 +396,12 @@ module OrigenTesters
395
396
  # $tester.cycle # This is the vector that will be captured
396
397
  def store_next_cycle(*pins)
397
398
  options = pins.last.is_a?(Hash) ? pins.pop : {}
398
- options = {
399
- }.merge(options)
399
+ options = {}.merge(options)
400
400
  pins = pins.flatten.compact
401
401
  if pins.empty?
402
402
  fail 'For the V93K you must supply the pins to store/capture'
403
403
  end
404
+
404
405
  pins.each { |pin| pin.save; pin.capture }
405
406
  # Register this clean up function to be run after the next vector
406
407
  # is generated, cool or what!
@@ -470,8 +471,7 @@ module OrigenTesters
470
471
  # ==== Examples
471
472
  # $tester.handshake # Pass control to the tester for a measurement
472
473
  def handshake(options = {})
473
- options = {
474
- }.merge(options)
474
+ options = {}.merge(options)
475
475
  ::Pattern.split(options)
476
476
  end
477
477
 
@@ -480,8 +480,7 @@ module OrigenTesters
480
480
  # ==== Examples
481
481
  # $tester.freq_count($top.pin(:d_out)) # Freq measure on pin "d_out"
482
482
  def freq_count(_pin, options = {})
483
- options = {
484
- }.merge(options)
483
+ options = {}.merge(options)
485
484
  ::Pattern.split(options)
486
485
  end
487
486
 
@@ -706,8 +705,7 @@ module OrigenTesters
706
705
 
707
706
  # An internal method called by Origen to create the pattern header
708
707
  def pattern_header(options = {})
709
- options = {
710
- }.merge(options)
708
+ options = {}.merge(options)
711
709
  pin_list = ordered_pins.map do |p|
712
710
  if Origen.app.pin_pattern_order.include?(p.id)
713
711
  # specified name overrides pin name
@@ -738,7 +736,7 @@ module OrigenTesters
738
736
  # An internal method called by Origen to generate the pattern footer
739
737
  def pattern_footer(options = {})
740
738
  options = {
741
- end_in_ka: false
739
+ end_in_ka: false
742
740
  }.merge(options)
743
741
  if options[:end_in_ka]
744
742
  Origen.log.warning '93K keep alive not yet implemented!'
@@ -24,8 +24,7 @@ module OrigenTesters
24
24
  end
25
25
  OrigenTesters::Decompiler::Nodes::Frontmatter.new(context: context,
26
26
  pattern_header: header,
27
- comments: []
28
- )
27
+ comments: [])
29
28
  end
30
29
 
31
30
  def parse_pinlist(raw_pinlist:, context:)
@@ -35,16 +34,14 @@ module OrigenTesters
35
34
  # up the names.
36
35
  # E.g.: FORMAT TCLK TDI TDO TMS;
37
36
  OrigenTesters::Decompiler::Nodes::Pinlist.new(context: context,
38
- pins: raw_pinlist[raw_pinlist.index('FORMAT')..raw_pinlist.index(';') - 1].split(/\s+/)[1..-1].map(&:strip)
39
- )
37
+ pins: raw_pinlist[raw_pinlist.index('FORMAT')..raw_pinlist.index(';') - 1].split(/\s+/)[1..-1].map(&:strip))
40
38
  end
41
39
 
42
40
  def parse_vector(raw_vector:, context:, meta:)
43
41
  if raw_vector =~ Regexp.new('^\s*#')
44
42
  # Comment
45
43
  OrigenTesters::Decompiler::Nodes::CommentBlock.new(context: context,
46
- comments: raw_vector.split("\n")
47
- )
44
+ comments: raw_vector.split("\n"))
48
45
  elsif raw_vector =~ Regexp.new('^R\d+\s')
49
46
  # Vector
50
47
  elements = raw_vector.split(/\s+/, 2 + context.pinlist.size)
@@ -56,8 +53,7 @@ module OrigenTesters
56
53
  repeat: elements[0].gsub('R', '').to_i,
57
54
  timeset: elements[1],
58
55
  pin_states: (elements[2..-2] || []) << elements[-1][0],
59
- comment: elements[-1][1]
60
- )
56
+ comment: elements[-1][1])
61
57
  else
62
58
  # Anything that doesn't start with Rxyz where xyz is some integer
63
59
  # will be considered a sequencer instruction
@@ -66,8 +62,7 @@ module OrigenTesters
66
62
 
67
63
  nodes_namespace::SequencerInstruction.new(context: context,
68
64
  instruction: inst_plus_args[0],
69
- arguments: inst_plus_args[1..-1]
70
- )
65
+ arguments: inst_plus_args[1..-1])
71
66
  end
72
67
  end
73
68
  end
@@ -5,7 +5,7 @@ module OrigenTesters
5
5
  class SequencerInstruction < OrigenTesters::Decompiler::Nodes::Node
6
6
  PLATFORM_NODES = [:instruction, :arguments]
7
7
 
8
- def initialize(instruction:, arguments: [], context:)
8
+ def initialize(instruction:, context:, arguments: [])
9
9
  @execute = false
10
10
 
11
11
  @instruction = instruction
@@ -27,6 +27,7 @@ module OrigenTesters
27
27
  if current_indices[:pinlist_start] && line !~ /^\s/
28
28
  next true
29
29
  end
30
+
30
31
  false
31
32
  end,
32
33
 
@@ -9,8 +9,7 @@ module OrigenTesters
9
9
 
10
10
  # An internal method called by Origen to create the pattern header
11
11
  def pattern_header(options = {})
12
- options = {
13
- }.merge(options)
12
+ options = {}.merge(options)
14
13
  @program_lines = []
15
14
  @program_action_lines = []
16
15
  if zip_patterns
@@ -40,7 +39,7 @@ module OrigenTesters
40
39
  # An internal method called by Origen to generate the pattern footer
41
40
  def pattern_footer(options = {})
42
41
  options = {
43
- end_in_ka: false
42
+ end_in_ka: false
44
43
  }.merge(options)
45
44
  if options[:end_in_ka]
46
45
  Origen.log.warning '93K keep alive not yet implemented!'
@@ -128,9 +127,9 @@ module OrigenTesters
128
127
  elsif comment =~ /^SQPG LBGN (\d+);/
129
128
  @program_lines << " <Instruction id=\"loop\" value=\"#{Regexp.last_match(1)}\"/>"
130
129
  elsif comment =~ /^SQPG LEND;/
131
- @program_lines << " <Instruction id=\"loopEnd\"/>"
130
+ @program_lines << ' <Instruction id="loopEnd"/>'
132
131
  elsif comment =~ /^SQPG RETC (\d) (\d);/
133
- @program_lines << " <Instruction id=\"returnConditional\">"
132
+ @program_lines << ' <Instruction id="returnConditional">'
134
133
  @program_lines << " <Assignment id=\"onFail\" value=\"#{Regexp.last_match(1) == '0' ? 'false' : 'true'}\"/>"
135
134
  @program_lines << " <Assignment id=\"resetFail\" value=\"#{Regexp.last_match(2) == '0' ? 'false' : 'true'}\"/>"
136
135
  @program_lines << ' </Instruction>'
@@ -150,7 +149,7 @@ module OrigenTesters
150
149
  # Close out current gen_vec group
151
150
  write_gen_vec
152
151
  if has_repeat
153
- @program_lines << " <Instruction id=\"genVec\" value=\"1\">"
152
+ @program_lines << ' <Instruction id="genVec" value="1">'
154
153
  @program_lines << " <Assignment id=\"repeat\" value=\"#{vec.repeat}\"/>"
155
154
  @program_lines << ' </Instruction>'
156
155
  @gen_vec -= 1
@@ -38,8 +38,7 @@ module OrigenTesters
38
38
  hardware_dsp_disable
39
39
  site_control
40
40
  site_match
41
- force_serial
42
- )
41
+ force_serial)
43
42
 
44
43
  ALIASES = {
45
44
  tim_equ_set: :timing_equation,
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  module SmartestBasedTester
3
3
  class V93K < Base
4
- require 'origen_testers/smartest_based_tester/v93k/generator.rb'
4
+ require 'origen_testers/smartest_based_tester/v93k/generator'
5
5
  end
6
6
  end
7
7
  V93K = SmartestBasedTester::V93K
@@ -23,8 +23,7 @@ module OrigenTesters
23
23
  signal: :result_signal
24
24
  }
25
25
 
26
- DEFAULTS = {
27
- }
26
+ DEFAULTS = {}
28
27
 
29
28
  NO_STRING_TYPES = [:list_strings, :list_classes, :class]
30
29
  # Generate accessors for all attributes and their aliases
@@ -76,6 +75,7 @@ module OrigenTesters
76
75
  if axes_names.include?(aname.to_sym)
77
76
  fail "Axis name #{aname} is already used in shmoo test '#{@name}'"
78
77
  end
78
+
79
79
  axes << ShmooTestAxis.new(aname.to_sym, a)
80
80
  end
81
81
  else
@@ -250,6 +250,7 @@ module OrigenTesters
250
250
  if trackings_names.include?(tname.to_sym)
251
251
  fail "Tracking name #{tname} is already used in shmoo test axis '#{@name}'"
252
252
  end
253
+
253
254
  trackings << ShmooTestTracking.new(tname.to_sym, t)
254
255
  end
255
256
  end
@@ -27,8 +27,7 @@ module OrigenTesters
27
27
  test_function: :test_method
28
28
  }
29
29
 
30
- DEFAULTS = {
31
- }
30
+ DEFAULTS = {}
32
31
 
33
32
  NO_STRING_TYPES = [:list_strings, :list_classes, :class]
34
33
  # Generate accessors for all attributes and their aliases
@@ -118,12 +117,13 @@ module OrigenTesters
118
117
  unless value_hash.is_a?(Hash)
119
118
  fail "Provided value to nested params was not a Hash. Instead the value was #{value_hash.class}"
120
119
  end
120
+
121
121
  dynamic_spacing = ' ' * (4 * nested_loop_count)
122
122
  l << "#{dynamic_spacing}#{name}[#{key}] = {" unless name.nil?
123
123
  nested_params.each do |nested_param|
124
124
  # Guarentee hash is using all symbol keys
125
125
  # Since we cannot guarentee ruby version is greater than 2.5, we have to use an older syntax to
126
- value_hash = value_hash.inject({}) { |memo, (k, v)| memo[k.to_sym] = v; memo }
126
+ value_hash = value_hash.transform_keys(&:to_sym)
127
127
  nested_key = nested_param.first.to_s.gsub('.', '_').to_sym
128
128
  nested_key_underscore = nested_key.to_s.underscore.to_sym
129
129
  nested_params_accepted_keys << nested_key
@@ -134,6 +134,7 @@ module OrigenTesters
134
134
  value_hash.keys.include?(nested_key_underscore) && nested_key != nested_key_underscore
135
135
  fail 'You are using a hash based test method and provided both the parameter name and alias name.'
136
136
  end
137
+
137
138
  nested_key = nested_key_underscore if value_hash.keys.include?(nested_key_underscore)
138
139
  if nested_param.last.first.is_a?(Hash) && value_hash[nested_key].is_a?(Hash)
139
140
  value_hash[nested_key].each do |inner_key, inner_meta_hash|
@@ -170,7 +171,7 @@ module OrigenTesters
170
171
  if value.is_a?(String)
171
172
  if value =~ /setupRef(.*)/
172
173
  # Do not wrap setupRef calls in quotes
173
- return value
174
+ value
174
175
  else
175
176
  "\"#{value}\""
176
177
  end
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  module SmartestBasedTester
3
3
  class V93K_SMT8 < Base
4
- require 'origen_testers/smartest_based_tester/v93k_smt8/generator.rb'
4
+ require 'origen_testers/smartest_based_tester/v93k_smt8/generator'
5
5
  end
6
6
  end
7
7
  V93K_SMT8 = SmartestBasedTester::V93K_SMT8
@@ -65,8 +65,7 @@ module OrigenTesters
65
65
 
66
66
  # An internal method called by Origen to create the pattern header
67
67
  def pattern_header(options = {})
68
- options = {
69
- }.merge(options)
68
+ options = {}.merge(options)
70
69
 
71
70
  @pattern_name = options[:pattern]
72
71
 
@@ -242,7 +241,7 @@ module OrigenTesters
242
241
  end
243
242
  if v == 0
244
243
  line << 'L'
245
- elsif v == 0
244
+ elsif v == 0 # rubocop:disable Lint/DuplicateElsifCondition
246
245
  line << 'H'
247
246
  else
248
247
  line << 'L/H/X'
@@ -301,12 +300,12 @@ module OrigenTesters
301
300
  # other platforms, such as the J750, is required.
302
301
  def store(*pins)
303
302
  options = pins.last.is_a?(Hash) ? pins.pop : {}
304
- options = { offset: 0
305
- }.merge(options)
303
+ options = { offset: 0 }.merge(options)
306
304
  pins = pins.flatten.compact
307
305
  if pins.empty?
308
306
  fail 'For the STIL generation you must supply the pins to store/capture'
309
307
  end
308
+
310
309
  pins.each do |pin|
311
310
  pin.restore_state do
312
311
  pin.capture
@@ -326,12 +325,12 @@ module OrigenTesters
326
325
  # $tester.cycle # This is the vector that will be captured
327
326
  def store_next_cycle(*pins)
328
327
  options = pins.last.is_a?(Hash) ? pins.pop : {}
329
- options = {
330
- }.merge(options)
328
+ options = {}.merge(options)
331
329
  pins = pins.flatten.compact
332
330
  if pins.empty?
333
331
  fail 'For STIL generation you must supply the pins to store/capture'
334
332
  end
333
+
335
334
  pins.each { |pin| pin.save; pin.capture }
336
335
  # Register this clean up function to be run after the next vector
337
336
  # is generated, cool or what!
@@ -116,12 +116,12 @@ module OrigenTesters
116
116
  # An optional finalize function can be supplied to do any final test instance configuration, this
117
117
  # function will be called immediately before the test method is finally rendered. The test method
118
118
  # object itself will be passed in as an argument.
119
- finalize: lambda do |tm|
119
+ finalize: lambda do |tm|
120
120
  tm.my_arg3 = 'arg3_set_from_finalize'
121
121
  end,
122
122
  # Example of a custom method.
123
123
  # In all cases the test method object will be passed in as the first argument.
124
- set_my_arg4: lambda do |tm, val|
124
+ set_my_arg4: lambda do |tm, val|
125
125
  tm.my_arg4 = val
126
126
  end
127
127
  }
@@ -143,7 +143,7 @@ module OrigenTesters
143
143
  # An optional finalize function can be supplied to do any final test instance configuration, this
144
144
  # function will be called immediately before the test method is finally rendered. The test method
145
145
  # object itself will be passed in as an argument.
146
- finalize: lambda do |tm|
146
+ finalize: lambda do |tm|
147
147
  if tm.my_arg1 == 'DELETE_ME'
148
148
  tm.remove_parameter(:my_arg1)
149
149
  end
@@ -185,8 +185,8 @@ module OrigenTesters
185
185
  my_arg0: [:string, ''],
186
186
  my_arg1: [:string, 'a_default_value'],
187
187
  my_arg2: [:integer, 0],
188
- my_arg2: [:list_strings, %w(E1 E2)],
189
- my_arg3: [:list_classes, %w(E1 E2)]
188
+ my_arg3: [:list_strings, %w(E1 E2)],
189
+ my_arg4: [:list_classes, %w(E1 E2)]
190
190
  }]
191
191
  # Define any methods you want the test method to have
192
192
  }
@@ -214,12 +214,12 @@ module OrigenTesters
214
214
  # An optional finalize function can be supplied to do any final test instance configuration, this
215
215
  # function will be called immediately before the test instance is finally rendered. The test instance
216
216
  # object itself will be passed in as an argument.
217
- finalize: lambda do |ti|
217
+ finalize: lambda do |ti|
218
218
  ti.my_arg3 = 'arg3_set_from_finalize'
219
219
  end,
220
220
  # Example of a custom method.
221
221
  # In all cases the test method object will be passed in as the first argument.
222
- set_my_arg4: lambda do |ti, val|
222
+ set_my_arg4: lambda do |ti, val|
223
223
  ti.my_arg4 = val
224
224
  end
225
225
  }