origen_testers 0.52.15 → 0.54.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 (110) 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 +25 -24
  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 +37 -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 +62 -25
  86. data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +18 -4
  87. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +1 -1
  88. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +1 -1
  89. data/lib/origen_testers/smartest_based_tester/base/variables_file.rb +1 -1
  90. data/lib/origen_testers/smartest_based_tester/base.rb +11 -13
  91. data/lib/origen_testers/smartest_based_tester/decompiler/avc.rb +5 -10
  92. data/lib/origen_testers/smartest_based_tester/decompiler/nodes.rb +1 -1
  93. data/lib/origen_testers/smartest_based_tester/decompiler.rb +1 -0
  94. data/lib/origen_testers/smartest_based_tester/smt8.rb +5 -6
  95. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +1 -2
  96. data/lib/origen_testers/smartest_based_tester/v93k.rb +1 -1
  97. data/lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_test.rb +3 -2
  98. data/lib/origen_testers/smartest_based_tester/v93k_smt8/test_suite.rb +30 -26
  99. data/lib/origen_testers/smartest_based_tester/v93k_smt8.rb +1 -1
  100. data/lib/origen_testers/stil_based_tester/base.rb +6 -7
  101. data/lib/origen_testers/test/custom_test_interface.rb +7 -7
  102. data/lib/origen_testers/test/dut.rb +23 -22
  103. data/lib/origen_testers/test/interface.rb +9 -7
  104. data/lib/origen_testers/test/nvm.rb +3 -3
  105. data/lib/origen_testers/timing/timeset.rb +0 -2
  106. data/lib/origen_testers/timing/timing_api.rb +2 -3
  107. data/lib/origen_testers/vector.rb +6 -5
  108. data/lib/origen_testers/vector_generator.rb +9 -3
  109. data/lib/origen_testers.rb +1 -1
  110. metadata +6 -18
@@ -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
@@ -88,22 +87,23 @@ module OrigenTesters
88
87
  unless name.is_a?(String)
89
88
  name = name.to_s[0] == '_' ? name.to_s.camelize(:upper) : name.to_s.camelize(:lower)
90
89
  end
90
+ formatted_value = test_method.format(param.last.is_a?(Hash) ? name : param[0])
91
91
  if param.last.is_a? Hash
92
- if !test_method.format(name).nil? && !test_method.format(name).is_a?(Hash)
93
- fail "#{name} parameter structure requires a Hash but value provided is #{test_method.format(name).class}"
94
- elsif test_method.format(name).nil? && tester.print_all_params
92
+ if !formatted_value.nil? && !formatted_value.is_a?(Hash)
93
+ fail "#{name} parameter structure requires a Hash but value provided is #{formatted_value.class}"
94
+ elsif formatted_value.nil? && tester.print_all_params
95
95
  l = add_nested_params(l, name, 'param0', {}, param.last, 1)
96
- elsif test_method.format(name).nil?
96
+ elsif formatted_value.nil?
97
97
  # Do nothing
98
98
  else
99
- test_method.format(name).each do |key, meta_hash|
99
+ formatted_value.each do |key, meta_hash|
100
100
  l = add_nested_params(l, name, key, meta_hash, param.last, 1)
101
101
  end
102
102
  end
103
- elsif NO_STRING_TYPES.include?(param.last) && test_method.format(param[0]).is_a?(String) && !test_method.format(param[0]).empty?
104
- l << " #{name} = #{test_method.format(param[0])};"
103
+ elsif NO_STRING_TYPES.include?(param.last) && formatted_value.is_a?(String) && !formatted_value.empty?
104
+ l << " #{name} = #{formatted_value};"
105
105
  else
106
- l << " #{name} = #{wrap_if_string(test_method.format(param[0]))};"
106
+ l << " #{name} = #{wrap_if_string(formatted_value)};"
107
107
  end
108
108
  end
109
109
  l << '}'
@@ -112,52 +112,56 @@ module OrigenTesters
112
112
 
113
113
  # rubocop:disable Metrics/ParameterLists: Avoid parameter lists longer than 5 parameters.
114
114
  def add_nested_params(l, name, key, value_hash, nested_params, nested_loop_count)
115
- nested_params_accepted_keys = []
116
- skip_keys = []
115
+ nested_params_accepted_keys = {}
116
+ skip_keys = {}
117
117
  unless value_hash.nil?
118
118
  unless value_hash.is_a?(Hash)
119
119
  fail "Provided value to nested params was not a Hash. Instead the value was #{value_hash.class}"
120
120
  end
121
+
121
122
  dynamic_spacing = ' ' * (4 * nested_loop_count)
122
123
  l << "#{dynamic_spacing}#{name}[#{key}] = {" unless name.nil?
124
+ # Normalize once per hash rather than once per accepted parameter.
125
+ value_hash = value_hash.transform_keys(&:to_sym)
126
+ @nested_parameter_keys ||= {}
123
127
  nested_params.each do |nested_param|
124
- # Guarentee hash is using all symbol keys
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 }
127
- nested_key = nested_param.first.to_s.gsub('.', '_').to_sym
128
- nested_key_underscore = nested_key.to_s.underscore.to_sym
129
- nested_params_accepted_keys << nested_key
130
- nested_params_accepted_keys << nested_key_underscore
128
+ nested_key, nested_key_underscore = @nested_parameter_keys[nested_param.first] ||= begin
129
+ key_name = nested_param.first.to_s.gsub('.', '_').to_sym
130
+ [key_name, key_name.to_s.underscore.to_sym]
131
+ end
132
+ nested_params_accepted_keys[nested_key] = true
133
+ nested_params_accepted_keys[nested_key_underscore] = true
131
134
  # We cannot create nested member functions with aliases
132
135
  # Requirement for hash parameter passing is to pass one of the key types and not both
133
136
  if value_hash.keys.include?(nested_key) &&
134
137
  value_hash.keys.include?(nested_key_underscore) && nested_key != nested_key_underscore
135
138
  fail 'You are using a hash based test method and provided both the parameter name and alias name.'
136
139
  end
140
+
137
141
  nested_key = nested_key_underscore if value_hash.keys.include?(nested_key_underscore)
138
142
  if nested_param.last.first.is_a?(Hash) && value_hash[nested_key].is_a?(Hash)
139
143
  value_hash[nested_key].each do |inner_key, inner_meta_hash|
140
144
  l = add_nested_params(l, nested_param.first, inner_key, value_hash.dig(nested_key, inner_key), nested_param.last.first, nested_loop_count + 1)
141
- skip_keys << nested_key
145
+ skip_keys[nested_key] = true
142
146
  end
143
147
  elsif nested_param.last.first.is_a?(Hash) && tester.print_all_params
144
148
  l = add_nested_params(l, nested_param.first, 'param0', {}, nested_param.last.first, nested_loop_count + 1)
145
149
  end
146
150
  type = nested_param.last.first
147
- if NO_STRING_TYPES.include?(nested_param.last.first) && value_hash[nested_key] && !skip_keys.include?(nested_key)
151
+ if NO_STRING_TYPES.include?(nested_param.last.first) && value_hash[nested_key] && !skip_keys.key?(nested_key)
148
152
  l << " #{dynamic_spacing}#{nested_param.first} = #{test_method.handle_val_type(value_hash[nested_key], type, nested_param.first)};"
149
- elsif value_hash[nested_key] && !skip_keys.include?(nested_key)
153
+ elsif value_hash[nested_key] && !skip_keys.key?(nested_key)
150
154
  l << " #{dynamic_spacing}#{nested_param.first} = #{wrap_if_string(test_method.handle_val_type(value_hash[nested_key], type, nested_param.first))};"
151
- elsif NO_STRING_TYPES.include?(nested_param.last.first) && !nested_param.last.last.is_a?(Hash) && tester.print_all_params && !skip_keys.include?(nested_key)
155
+ elsif NO_STRING_TYPES.include?(nested_param.last.first) && !nested_param.last.last.is_a?(Hash) && tester.print_all_params && !skip_keys.key?(nested_key)
152
156
  l << " #{dynamic_spacing}#{nested_param.first} = #{test_method.handle_val_type(nested_param.last.last, type, nested_param.first)};"
153
- elsif !nested_param.last.last.is_a?(Hash) && tester.print_all_params && !skip_keys.include?(nested_key)
157
+ elsif !nested_param.last.last.is_a?(Hash) && tester.print_all_params && !skip_keys.key?(nested_key)
154
158
  l << " #{dynamic_spacing}#{nested_param.first} = #{wrap_if_string(test_method.handle_val_type(nested_param.last.last, type, nested_param.first))};"
155
159
  end
156
160
  end
157
161
  l << "#{dynamic_spacing}};" unless name.nil?
158
162
  # Sanity check there are not overpassed parameters
159
163
  value_hash.keys.each do |nested_key|
160
- unless nested_params_accepted_keys.include?(nested_key.to_sym)
164
+ unless nested_params_accepted_keys.key?(nested_key.to_sym)
161
165
  fail "You provided a parameter \'#{nested_key}\' that was not an accepted parameter to the hash parameter \'#{name}\'"
162
166
  end
163
167
  end
@@ -170,7 +174,7 @@ module OrigenTesters
170
174
  if value.is_a?(String)
171
175
  if value =~ /setupRef(.*)/
172
176
  # Do not wrap setupRef calls in quotes
173
- return value
177
+ value
174
178
  else
175
179
  "\"#{value}\""
176
180
  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
  }
@@ -107,10 +107,11 @@ module OrigenTesters
107
107
  end
108
108
 
109
109
  def execute(options = {})
110
- options = { define: false, # whether to define subr or call it
111
- name: 'executefunc1',
112
- onemodsub: false # whether to expects subr to be in single module
113
- }.merge(options)
110
+ options = {
111
+ define: false, # whether to define subr or call it
112
+ name: 'executefunc1',
113
+ onemodsub: false # whether to expects subr to be in single module
114
+ }.merge(options)
114
115
 
115
116
  if options[:define]
116
117
  # define subroutine
@@ -128,13 +129,14 @@ module OrigenTesters
128
129
 
129
130
  # Match loop functionality
130
131
  def match(options = {})
131
- options = { type: :match_pin, # whether to match DONE bit in register or match pin
132
- # :match_done
133
- # :match_2pins
134
- delay_in_us: 5, # match loop delay
135
- define: false, # whether to define subr or call it
136
- subr_name: false, # default use match type as subr name
137
- }.merge(options)
132
+ options = {
133
+ type: :match_pin, # whether to match DONE bit in register or match pin
134
+ # :match_done
135
+ # :match_2pins
136
+ delay_in_us: 5, # match loop delay
137
+ define: false, # whether to define subr or call it
138
+ subr_name: false # default use match type as subr name
139
+ }.merge(options)
138
140
 
139
141
  subr_name = options[:subr_name] ? options[:subr_name] : options[:type].to_s
140
142
 
@@ -226,7 +228,7 @@ module OrigenTesters
226
228
 
227
229
  def handshake(options = {})
228
230
  options = {
229
- define: false, # whether to define subr or call it
231
+ define: false # whether to define subr or call it
230
232
  }.merge(options)
231
233
 
232
234
  if options[:define]
@@ -261,12 +263,13 @@ module OrigenTesters
261
263
  alias_method :keep_alive, :keepalive
262
264
 
263
265
  def digsrc_overlay(options = {})
264
- options = { define: false, # whether to define subr or call it
265
- subr_name: false, # default use match type as subr name
266
- digsrc_pins: @digsrc_pins, # defaults to what's defined in $dut
267
- overlay_reg: nil, # defaults to testme32 register
268
- overlay_cycle_num: 32, # Only needed if overlay_reg is NOT nil, this specificies how many clk cycles to overlay.
269
- }.merge(options)
266
+ options = {
267
+ define: false, # whether to define subr or call it
268
+ subr_name: false, # default use match type as subr name
269
+ digsrc_pins: @digsrc_pins, # defaults to what's defined in $dut
270
+ overlay_reg: nil, # defaults to testme32 register
271
+ overlay_cycle_num: 32 # Only needed if overlay_reg is NOT nil
272
+ }.merge(options)
270
273
  if options[:define]
271
274
  $tester.start_subroutine(options[:subr_name]) # Start subroutine
272
275
  digsrc_pins = $tester.assign_digsrc_pins(options[:digsrc_pins])
@@ -301,8 +304,7 @@ module OrigenTesters
301
304
  end
302
305
 
303
306
  def memory_test(options = {})
304
- options = {
305
- }.merge(options)
307
+ options = {}.merge(options)
306
308
 
307
309
  $tester.memory_test(inc_counter_x: true, gen_vector: true)
308
310
 
@@ -318,8 +320,7 @@ module OrigenTesters
318
320
  end
319
321
 
320
322
  def freq_count(options = {})
321
- options = {
322
- }.merge(options)
323
+ options = {}.merge(options)
323
324
 
324
325
  $tester.freq_count($dut.pin(:tdo), readcode: 73)
325
326
  end
@@ -667,7 +667,7 @@ module OrigenTesters
667
667
  def ac_specset(sheet_name, expression, options = {})
668
668
  options = {
669
669
  specset: :default,
670
- nom: { typ: nil }
670
+ nom: { typ: nil }
671
671
  }.merge(options)
672
672
 
673
673
  ss = ac_specsets(sheet_name)
@@ -677,7 +677,7 @@ module OrigenTesters
677
677
  # Collects AC Spec object(s) from the given expression and adds them to the given Specset
678
678
  def collect_ac_specs(ssname, edge, options = {})
679
679
  options = {
680
- nom: { typ: nil }
680
+ nom: { typ: nil }
681
681
  }.merge(options)
682
682
 
683
683
  # Create a Specsets object from the UFlex program generator API
@@ -698,8 +698,9 @@ module OrigenTesters
698
698
  }.merge(options)
699
699
 
700
700
  return unless expression.is_a? String
701
+
701
702
  # collect all variable names within the expression
702
- vars = expression.scan(/[a-zA-Z][\w]+/).map(&:to_sym)
703
+ vars = expression.scan(/[a-zA-Z]\w+/).map(&:to_sym)
703
704
  vars.each do |var|
704
705
  next if var =~ /^(d0_edge|d1_edge|d2_edge|d3_edge|c1_edge|c2_edge)$/
705
706
  # The substitutions below are used for backward compatibility
@@ -734,8 +735,8 @@ module OrigenTesters
734
735
  vcl: -1, # Voltage clamp low
735
736
  vch: 2.5, # Voltage clamp high
736
737
  vt: 0.9, # Termination voltage
737
- voutlotyp: 0, #
738
- vouthityp: 0, #
738
+ voutlotyp: 0,
739
+ vouthityp: 0,
739
740
  dmode: 'Largeswing-VT' # Driver mode
740
741
  }.merge(options)
741
742
 
@@ -801,7 +802,8 @@ module OrigenTesters
801
802
  }.merge(options)
802
803
 
803
804
  return unless expression.is_a? String
804
- vars = expression.scan(/[a-zA-Z][\w]+/).map(&:to_sym)
805
+
806
+ vars = expression.scan(/[a-zA-Z]\w+/).map(&:to_sym)
805
807
  vars.each do |var|
806
808
  next if var =~ /^(nA|uA|mA|A|nV|uV|mV|V)$/i
807
809
 
@@ -844,7 +846,7 @@ module OrigenTesters
844
846
 
845
847
  def reference(reference, options = {})
846
848
  options = {
847
- comment: nil
849
+ comment: nil
848
850
  }.merge(options)
849
851
 
850
852
  references('Refs').add(reference, options)
@@ -48,7 +48,7 @@ module OrigenTesters
48
48
 
49
49
  class NVMSub < NVM
50
50
  def redefine_data_reg
51
- add_reg :data, 0x40, 16, d: { pos: 0, bits: 16 }
51
+ add_reg :data, 0x40, 16, d: { pos: 0, bits: 16 }
52
52
  end
53
53
 
54
54
  # Tests that the block format for defining registers works
@@ -57,7 +57,7 @@ module OrigenTesters
57
57
  # This is dreg
58
58
  add_reg :dreg, 0x1000, size: 16 do
59
59
  # This is dreg bit 15
60
- bit 15, :bit15, reset: 1
60
+ bit 15, :bit15, reset: 1
61
61
  # **Bit 14** - This does something cool
62
62
  #
63
63
  # 0 | Coolness is disabled
@@ -86,7 +86,7 @@ module OrigenTesters
86
86
  bit 15, :bit15, reset: 1, description: 'This is dreg3 bit 15'
87
87
  bit 14, :bit14, description: "**Bit 14** - This does something cool\n\n0 | Coolness is disabled\n1 | Coolness is enabled"
88
88
  bits 13..8, :upper, description: 'This is dreg3 bit upper'
89
- bit 7..0, :lower, writable: false, reset: 0x55, description: "This is dreg3 bit lower\nThis is dreg3 bit lower line 2"
89
+ bit 7..0, :lower, writable: false, reset: 0x55, description: "This is dreg3 bit lower\nThis is dreg3 bit lower line 2"
90
90
  end
91
91
  end
92
92
  end
@@ -65,7 +65,6 @@ module OrigenTesters
65
65
  end
66
66
 
67
67
  # Return the period
68
- p
69
68
  end
70
69
 
71
70
  # Indicates whether a period_in_ns has been defined for this timeset.
@@ -134,7 +133,6 @@ module OrigenTesters
134
133
  # )
135
134
  # end
136
135
  @period_in_ns = p
137
- @period_in_ns
138
136
  end
139
137
  end
140
138
  end
@@ -142,7 +142,7 @@ module OrigenTesters
142
142
  time_in_ns: 0,
143
143
  time_in_ms: 0,
144
144
  time_in_s: 0,
145
- match: false, # Set to true to invoke a match loop where the supplied delay
145
+ match: false # Set to true to invoke a match loop where the supplied delay
146
146
  # will become the timeout duration
147
147
  }.merge(options)
148
148
 
@@ -255,8 +255,7 @@ module OrigenTesters
255
255
  # end
256
256
  def count(options = {})
257
257
  options = { period_in_cycles: 0, period_in_ms: 0, period_in_us: 0, period_in_ns: 0,
258
- duration_in_cycles: 0, duration_in_ms: 0, duration_in_us: 0, duration_in_ns: 0
259
- }.merge(options)
258
+ duration_in_cycles: 0, duration_in_ms: 0, duration_in_us: 0, duration_in_ns: 0 }.merge(options)
260
259
 
261
260
  period_cycles = options[:period_in_cycles] + ms_to_cycles(options[:period_in_ms]) +
262
261
  us_to_cycles(options[:period_in_us]) + ns_to_cycles(options[:period_in_ns])
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  # A simple class to model a vector
3
3
  class Vector
4
- attr_accessor :repeat, :microcode, :timeset, :pin_vals,
4
+ attr_accessor :repeat, :microcode, :timeset, :pin_vals, # rubocop:disable Lint/DuplicateMethods
5
5
  :number, :cycle_number, :dont_compress,
6
6
  :comments, :inline_comment, :cycle, :number, :contains_capture
7
7
 
@@ -12,7 +12,7 @@ module OrigenTesters
12
12
  end
13
13
  end
14
14
 
15
- def comments
15
+ def comments # rubocop:disable Lint/DuplicateMethods
16
16
  @comments ||= []
17
17
  end
18
18
 
@@ -73,6 +73,7 @@ module OrigenTesters
73
73
  if timeset.period_in_ns % tset.period_in_ns != 0
74
74
  fail "The period of timeset #{timeset.name} is not a multiple of the period of timeset #{tset.name}!"
75
75
  end
76
+
76
77
  if contains_capture
77
78
  vector_modification_required = true
78
79
  elsif $tester.timing_toggled_pins.empty?
@@ -177,7 +178,7 @@ module OrigenTesters
177
178
  Origen.app.pin_map.sort_by { |id, pin| pin.order }.map { |id, pin| pin }
178
179
  end
179
180
 
180
- def microcode=(val)
181
+ def microcode=(val) # rubocop:disable Lint/DuplicateMethods
181
182
  if val && has_microcode? && @microcode != val
182
183
  fail "Trying to assign microcode: #{val}, but vector already has microcode: #{@microcode}"
183
184
  else
@@ -186,7 +187,7 @@ module OrigenTesters
186
187
  end
187
188
 
188
189
  # Since repeat 0 is non-intuitive every vector implicitly has a repeat of 1
189
- def repeat
190
+ def repeat # rubocop:disable Lint/DuplicateMethods
190
191
  @repeat || 1
191
192
  end
192
193
 
@@ -196,7 +197,7 @@ module OrigenTesters
196
197
 
197
198
  def ==(obj)
198
199
  if obj.is_a?(Vector)
199
- self.has_microcode? == obj.has_microcode? &&
200
+ has_microcode? == obj.has_microcode? &&
200
201
  timeset == obj.timeset &&
201
202
  pin_vals == obj.pin_vals
202
203
  else