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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0ccfb03e47cfe6029a39026710cc2f13bfb22bb1fd647c487a1809a22a3e289
4
- data.tar.gz: e1bca4ec1b97d106986a00346f3cb1d5950a59dd96157ba1337c026aaac3c35c
3
+ metadata.gz: bd70a31c286817288ecefd2da59f6e353a7352e68b7fda835d003863bb31b335
4
+ data.tar.gz: 15a7415efb5843bf6de77749d322fe58d83c90ed7d6f33a55493b720602f53b1
5
5
  SHA512:
6
- metadata.gz: d5237f915a749375154874337a2351a76d11f91eb8194ecc14ae3b154b2ea8e268afc63e912fb0cfd4af059b92d667143f982326bebcc7f9c8c9f7fa099e6a4d
7
- data.tar.gz: 11b88ca1f31bec5a795ce3b2a62a2529b74f9ff92f110cb962834d1d045279490ef9a65011c6034a791744dddca549a13e150df1f37d08b46db559868ac1b958
6
+ metadata.gz: b63efbe6a34c23da197eb95b35631b37fe143b4a998c391a920acf6edd664eff512de5241915cd491578ae869f8d721bd7be4be4e51580037e5a0a7b83e5862a
7
+ data.tar.gz: 9992f1ee5387bcef67571ae85b59aedb20578d98fa7218f7c36a1281e35aba80571288d861405ae3f2936b2d6f4f7f1e64c405ce75feeec2295936c152097c67
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
- MINOR = 52
4
- BUGFIX = 15
3
+ MINOR = 53
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -21,8 +21,8 @@ Usage: origen testers:build MANIFEST [options]
21
21
  EOT
22
22
  opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
23
23
  opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
24
- opts.on('-pl', '--plugin PLUGIN_NAME', String, 'Set current plugin') { |pl_n| options[:current_plugin] = pl_n }
25
- opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
24
+ opts.on('-pl', '--plugin PLUGIN_NAME', String, 'Set current plugin') { |pl_n| options[:current_plugin] = pl_n }
25
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
26
26
  opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
27
27
  opts.on('-n', '--new', 'Generate a new manifest file for the current tester platform') { options[:new] = true }
28
28
  opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
@@ -32,7 +32,7 @@ Usage: origen convert FILE [options]
32
32
  opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
33
33
  opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
34
34
  end
35
- opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
35
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
36
36
  opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
37
37
  opts.separator ''
38
38
  opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
data/lib/commands/run.rb CHANGED
@@ -14,7 +14,7 @@ Usage: origen testers:run FLOW [options]
14
14
  opts.on('--fail ID,ID', Array, 'Comma-separated list of test IDs to fail') { |ids| options[:failed_test_ids] = ids }
15
15
  opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
16
16
  opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
17
- opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
17
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
18
18
  opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
19
19
  opts.separator ''
20
20
  opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
@@ -26,7 +26,7 @@ Origen.environment.temporary = options[:environment] if options[:environment]
26
26
  Origen.target.temporary = options[:target] if options[:target]
27
27
  # Origen.app.load_target!
28
28
 
29
- program = OrigenTesters.program
29
+ program = OrigenTesters.program
30
30
 
31
31
  unless program
32
32
  puts 'Sorry, but there is no program model available for the current target, generate the program then retry'
@@ -79,6 +79,7 @@ module OrigenTesters
79
79
 
80
80
  def is_vector_based?
81
81
  return @vector_based if defined?(@vector_based)
82
+
82
83
  true
83
84
  end
84
85
 
@@ -252,6 +253,7 @@ module OrigenTesters
252
253
  unless timeset.period_in_ns?
253
254
  fail "You must supply a period_in_ns to timeset '#{timeset.name}' before you can cycle the tester!"
254
255
  end
256
+
255
257
  timeset.cycled = true
256
258
  if PatSeq.thread
257
259
  PatSeq.thread.cycle(options)
@@ -303,6 +305,7 @@ module OrigenTesters
303
305
 
304
306
  def pop_running_clock(pin)
305
307
  fail "ERROR: No clocks running, doesn't make sense to pop one" unless any_clocks_running?
308
+
306
309
  @clocks_running.delete(pin.name.to_s)
307
310
  end
308
311
 
@@ -23,8 +23,7 @@ module OrigenTesters::ATP
23
23
  description: description,
24
24
  type: type,
25
25
  children: Processors::Marshal.new.process_all(children),
26
- properties: properties
27
- }
26
+ properties: properties }
28
27
  Marshal.dump(d, depth)
29
28
  end
30
29
 
@@ -485,6 +485,7 @@ module OrigenTesters::ATP
485
485
  if name.to_s != options[:path].split('.').last.to_s
486
486
  fail "Auxiliary flow path does not end in '#{name}'. The path instead is '#{options[:path]}'. Please update the path to align with the provided name."
487
487
  end
488
+
488
489
  extract_meta!(options) do
489
490
  apply_conditions(options) do
490
491
  n2(:auxiliary_flow, n1(:name, name), n1(:path, options[:path]))
@@ -499,6 +500,7 @@ module OrigenTesters::ATP
499
500
  if number.is_a?(Hash)
500
501
  fail 'The bin number must be passed as the first argument'
501
502
  end
503
+
502
504
  options[:bin_description] ||= options.delete(:description)
503
505
  extract_meta!(options) do
504
506
  apply_conditions(options) do
@@ -514,6 +516,7 @@ module OrigenTesters::ATP
514
516
  if number.is_a?(Hash)
515
517
  fail 'The bin number must be passed as the first argument'
516
518
  end
519
+
517
520
  options[:type] = :pass
518
521
  bin(number, options)
519
522
  end
@@ -630,6 +633,7 @@ module OrigenTesters::ATP
630
633
  unless args[0].keys.include?(:from) && args[0].keys.include?(:to)
631
634
  fail 'Loop must specify :from, :to'
632
635
  end
636
+
633
637
  # assume 1 if :step not provided
634
638
  unless args[0].keys.include?(:step)
635
639
  args[0][:step] = 1
@@ -658,37 +662,42 @@ module OrigenTesters::ATP
658
662
  end
659
663
 
660
664
  RELATIONAL_OPERATORS.each do |method|
661
- define_method method do |*args, &block|
662
- options = args.pop if args.last.is_a?(Hash)
663
- unless args.size == 2
664
- fail "Format for relational operation must match: ':<operator>(var1, var2)'"
665
+ unless method_defined?(method)
666
+ define_method method do |*args, &block|
667
+ options = args.pop if args.last.is_a?(Hash)
668
+ unless args.size == 2
669
+ fail "Format for relational operation must match: ':<operator>(var1, var2)'"
670
+ end
671
+
672
+ n2(method.to_sym, args[0], args[1])
665
673
  end
666
- n2(method.to_sym, args[0], args[1])
667
- end unless method_defined?(method)
674
+ end
668
675
  end
669
676
 
670
677
  # Define handlers for all of the flow control block methods, unless a custom one has already
671
678
  # been defined above
672
679
  CONDITION_KEYS.keys.each do |method|
673
- define_method method do |*flags, &block|
674
- if flags.last.is_a?(Hash)
675
- options = flags.pop
676
- else
677
- options = {}
678
- end
679
- if flags.include? nil
680
- Origen.log.error("Found Nil flag passed to the '#{method}' method, ensure the flag is passed as a String or a Symbol!")
681
- fail
682
- end
683
- flags = flags.first if flags.size == 1
684
- # Legacy option provided by OrigenTesters that permits override of a block enable method by passing
685
- # an :or option with a true value
686
- if (CONDITION_KEYS[method] == :if_enabled || CONDITION_KEYS[method] || :unless_enabled) && options[:or]
687
- block.call
688
- else
689
- flow_control_method(CONDITION_KEYS[method], flags, options, &block)
680
+ unless method_defined?(method)
681
+ define_method method do |*flags, &block|
682
+ if flags.last.is_a?(Hash)
683
+ options = flags.pop
684
+ else
685
+ options = {}
686
+ end
687
+ if flags.include? nil
688
+ Origen.log.error("Found Nil flag passed to the '#{method}' method, ensure the flag is passed as a String or a Symbol!")
689
+ fail
690
+ end
691
+ flags = flags.first if flags.size == 1
692
+ # Legacy option provided by OrigenTesters that permits override of a block enable method by passing
693
+ # an :or option with a true value
694
+ if (CONDITION_KEYS[method] == :if_enabled || CONDITION_KEYS[method] || :unless_enabled) && options[:or] # rubocop:disable Lint/LiteralAsCondition, Lint/RedundantCopDisableDirective
695
+ block.call
696
+ else
697
+ flow_control_method(CONDITION_KEYS[method], flags, options, &block)
698
+ end
690
699
  end
691
- end unless method_defined?(method)
700
+ end
692
701
  end
693
702
 
694
703
  def inspect
@@ -736,6 +745,7 @@ module OrigenTesters::ATP
736
745
  unless options[:then] || options[:else]
737
746
  fail "You must supply a :then or :else option when calling #{name} like this!"
738
747
  end
748
+
739
749
  node = n1(name, flag)
740
750
  if options[:then]
741
751
  node = append_to(node) { options[:then].call }
@@ -766,6 +776,7 @@ module OrigenTesters::ATP
766
776
  unless found
767
777
  fail 'The request to apply the current context has failed, this is likely a bug in OrigenTesters::ATP'
768
778
  end
779
+
769
780
  node
770
781
  else
771
782
  conditions = extract_conditions(options)
@@ -1021,6 +1032,7 @@ module OrigenTesters::ATP
1021
1032
  def add_bin_description(node, number, description, options)
1022
1033
  @existing_bin_descriptions ||= { soft: {}, hard: {} }
1023
1034
  return node if @existing_bin_descriptions[options[:type]][number]
1035
+
1024
1036
  @existing_bin_descriptions[options[:type]][number] = true
1025
1037
  name, *nodes = *node
1026
1038
  if nodes[0] && nodes[0].type == :volatile
@@ -58,6 +58,7 @@ module OrigenTesters::ATP
58
58
  unless options[:rule]
59
59
  fail 'You must supply option :rule (e.g. rule: :gt) when calling the limit helper'
60
60
  end
61
+
61
62
  {
62
63
  value: value,
63
64
  rule: options[:rule] || :lt,
@@ -1,18 +1,19 @@
1
1
  require 'sexpistol'
2
2
  module OrigenTesters::ATP
3
- class Parser < Sexpistol
3
+ class Parser < Sexpistol::Parser
4
4
  def initialize
5
5
  # This accessor moves to Sexpistol::Parser in newer versions of the gem
6
- self.ruby_keyword_literals = true
6
+ # self.ruby_keyword_literals = true
7
7
  end
8
8
 
9
9
  def string_to_ast(string)
10
- to_sexp(parse_string(string))
10
+ # to_sexp(parse_string(string))
11
+ to_sexp(Sexpistol.parse(string, parse_ruby_keyword_literals: true))
11
12
  end
12
13
 
13
14
  def to_sexp(ast_array)
14
15
  children = ast_array.map do |item|
15
- if item.is_a?(Array)
16
+ if item.is_a?(Array)
16
17
  to_sexp(item)
17
18
  else
18
19
  item
@@ -20,6 +21,7 @@ module OrigenTesters::ATP
20
21
  end
21
22
  type = children.shift
22
23
  return type if type.is_a?(OrigenTesters::ATP::AST::Node)
24
+
23
25
  type = type.to_s.gsub('-', '_').to_sym
24
26
  OrigenTesters::ATP::AST::Node.new(type, children)
25
27
  end
@@ -57,6 +57,7 @@ module OrigenTesters::ATP
57
57
  unless @volatiles
58
58
  fail 'You must first call extract_volatiles(node) from your on_flow hander method'
59
59
  end
60
+
60
61
  @volatiles[:flags] || []
61
62
  end
62
63
 
@@ -15,6 +15,7 @@ module OrigenTesters::ATP
15
15
  unless id
16
16
  fail 'Something has gone wrong, all nodes should have IDs by this point'
17
17
  end
18
+
18
19
  id = id.value
19
20
  nodes = [node]
20
21
  if on_fail && contains_anything_interesting?(on_fail)
@@ -51,7 +51,7 @@ module OrigenTesters::ATP
51
51
  end
52
52
  alias_method :on_unless_ran, :on_if_ran
53
53
 
54
- def results
54
+ def results # rubocop:disable Lint/DuplicateMethods
55
55
  @results ||= {}.with_indifferent_access
56
56
  end
57
57
  end
@@ -107,9 +107,7 @@ module OrigenTesters::ATP
107
107
  if node.type == :group || node.type == :sub_flow
108
108
  nodes = node.to_a.dup
109
109
  pre_nodes = []
110
- while [:name, :id, :path].include?(nodes.first.try(:type))
111
- pre_nodes << nodes.shift
112
- end
110
+ pre_nodes << nodes.shift while [:name, :id, :path].include?(nodes.first.try(:type))
113
111
  node.updated(nil, pre_nodes + [set_flag] + nodes)
114
112
 
115
113
  # For a test, set a flag immediately after the referenced test has executed
@@ -187,6 +187,7 @@ module OrigenTesters::ATP
187
187
  unless job
188
188
  fail 'Flow contains JOB-based conditions and no current JOB has been given!'
189
189
  end
190
+
190
191
  if state
191
192
  process_all(node) if jobs.include?(job)
192
193
  else
@@ -23,6 +23,7 @@ module OrigenTesters
23
23
  # Found a .atp or .atp.gz file so we should compile it
24
24
  matches = Dir.glob("#{Origen.root}/**/#{patname}")
25
25
  fail "Found multiple locations for #{patname}, exiting...\n\t#{matches}" if matches.size > 1
26
+
26
27
  pattern = matches.first.to_s
27
28
  current_compiler = select_compiler
28
29
  run_compiler(current_compiler, pattern)
@@ -113,14 +113,14 @@ module OrigenTesters
113
113
  def gate_check(gates, gate_type)
114
114
  case gates
115
115
  when Symbol, String
116
- return
116
+ nil
117
117
  when Array
118
118
  unknown_gates = gates.reject { |gate| [String, Symbol].include? gate.class }
119
119
  if unknown_gates.empty?
120
- return
120
+ nil
121
121
  else
122
122
  Origen.log.error "Profile #{id}: Unknown #{gate_type} type(s) in #{gate_type} array."
123
- Origen.log.error "Arrays must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq } were found in #{gates}"
123
+ Origen.log.error "Arrays must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq} were found in #{gates}"
124
124
  fail
125
125
  end
126
126
  when Hash
@@ -150,14 +150,14 @@ module OrigenTesters
150
150
  end
151
151
  case gates
152
152
  when Symbol, String
153
- return
153
+ nil
154
154
  when Array
155
155
  unknown_gates = gates.reject { |gate| [String, Symbol].include? gate.class }
156
156
  if unknown_gates.empty?
157
- return
157
+ nil
158
158
  else
159
159
  Origen.log.error "Profile #{id}: Unknown #{gate_type} type(s) in #{gate_type} array."
160
- Origen.log.error "Arrays must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq } were found in #{gates}"
160
+ Origen.log.error "Arrays must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq} were found in #{gates}"
161
161
  fail
162
162
  end
163
163
  when Hash
@@ -173,7 +173,7 @@ module OrigenTesters
173
173
  gates = [gates] unless gates.is_a? Array
174
174
  unknown_gates = gates.reject { |gate| [String, Symbol].include? gate.class }
175
175
  unless unknown_gates.empty?
176
- Origen.log.error "Gate array must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq } were found in #{gates}"
176
+ Origen.log.error "Gate array must contain Strings and/or Symbols, but #{unknown_gates.map(&:class).uniq} were found in #{gates}"
177
177
  fail
178
178
  end
179
179
  end
@@ -30,6 +30,7 @@ module OrigenTesters
30
30
  end
31
31
 
32
32
  return if @attr_value_check == false
33
+
33
34
  if [@start, @stop, @res].all? { |attr| attr.is_a? Numeric }
34
35
  unless @res <= (@start - @stop).abs
35
36
  Origen.log.error "SearchRoutine #{@id}: Search resolution (#{@res}) is larger than the search range: #{(@start - @stop).abs}"
@@ -73,7 +73,7 @@ module OrigenTesters
73
73
  end
74
74
  end
75
75
 
76
- def current_instance(options = {})
76
+ def current_instance(options = {}) # rubocop:disable Lint/DuplicateMethods
77
77
  instance = @current_instance || instances.first
78
78
  if instance.nil? && @stored_instance
79
79
  unless options[:stored_instance_valid]
@@ -26,30 +26,30 @@ module OrigenTesters
26
26
  :eof_charz_tests, :skip_group_eof_charz_tests, :eof_charz_tests_group_name,
27
27
  :default_valid_charz_placements
28
28
 
29
- def charz_stack
29
+ def charz_stack # rubocop:disable Lint/DuplicateMethods
30
30
  @charz_stack ||= []
31
31
  end
32
32
 
33
- def charz_profiles
33
+ def charz_profiles # rubocop:disable Lint/DuplicateMethods
34
34
  @charz_profiles ||= {}
35
35
  end
36
36
 
37
- def charz_routines
37
+ def charz_routines # rubocop:disable Lint/DuplicateMethods
38
38
  @charz_routines ||= {}
39
39
  end
40
40
 
41
- def charz_session
41
+ def charz_session # rubocop:disable Lint/DuplicateMethods
42
42
  @charz_session ||= Session.new
43
43
  end
44
44
 
45
- def default_valid_charz_placements
45
+ def default_valid_charz_placements # rubocop:disable Lint/DuplicateMethods
46
46
  @default_valid_charz_placements ||= [:inline, :eof]
47
47
  end
48
48
 
49
49
  # If there is a current instance present, that should always be used. However when running EOF charz,
50
50
  # the instance to be used is no longer set, so instead of referencing the session, use the one that we've
51
51
  # stored already
52
- def charz_instance
52
+ def charz_instance # rubocop:disable Lint/DuplicateMethods
53
53
  unless charz_session.current_instance(stored_instance_valid: true).nil?
54
54
  set_charz_instance(charz_session.current_instance(stored_instance_valid: true))
55
55
  end
@@ -61,7 +61,7 @@ module OrigenTesters
61
61
  charz_session.stored_instance = instance
62
62
  end
63
63
 
64
- def eof_charz_tests
64
+ def eof_charz_tests # rubocop:disable Lint/DuplicateMethods
65
65
  @eof_charz_tests ||= []
66
66
  end
67
67
 
@@ -252,7 +252,11 @@ module OrigenTesters
252
252
  if charz_session.on_result?
253
253
  md5_id = Digest::MD5.new
254
254
  md5_id << parent_test_name.to_s
255
- md5_id << options.to_s
255
+ # Use a deterministic string representation of options that is consistent
256
+ # across Ruby versions. Ruby 4.0 changed Hash#inspect to use "key: val"
257
+ # syntax instead of ":key=>val", which produces different MD5 digests.
258
+ # Explicitly build the old-style rocket format to keep IDs stable.
259
+ md5_id << ('{' + options.map { |k, v| "#{k.inspect}=>#{v.inspect}" }.join(', ') + '}')
256
260
  md5_id << charz_session.id.to_s
257
261
  options[:id] = "auto_charz_id_#{md5_id}".to_sym
258
262
  end
@@ -434,7 +438,7 @@ module OrigenTesters
434
438
  gated_routines = charz_instance.routines - ungated_routines
435
439
  # Build the proc which contains the nested if statements for each routine so they are anded.
436
440
  gated_routines.each do |routine|
437
- my_proc = -> do
441
+ my_proc = lambda do
438
442
  if_flag charz_instance.flags do
439
443
  block.call(options.merge(current_routine: routine))
440
444
  end
@@ -477,7 +481,7 @@ module OrigenTesters
477
481
  # Build the proc which contains the nested if statemements for each routine so they are anded.
478
482
  gated_routines = charz_instance.routines - ungated_routines
479
483
  gated_routines.each do |routine|
480
- my_proc = -> do
484
+ my_proc = lambda do
481
485
  if_enable charz_instance.enables do
482
486
  block.call(options.merge(current_routine: routine))
483
487
  end
@@ -1,4 +1,3 @@
1
-
2
1
  module OrigenTesters
3
2
  # A base class that can be used to model command-based, rather than
4
3
  # vector-based testers.
@@ -35,7 +34,7 @@ module OrigenTesters
35
34
  end
36
35
 
37
36
  # Loop the content embedded in the supplied block
38
- def loop(_name = nil, number_of_loops)
37
+ def loop(_name = nil, number_of_loops) # rubocop:disable Style/OptionalArguments
39
38
  number_of_loops.times do
40
39
  yield
41
40
  end
@@ -117,7 +117,7 @@ module OrigenTesters
117
117
  alias_method :header, :pattern_header
118
118
  alias_method :comment_header, :pattern_header
119
119
 
120
- def initialize(pattern_header: nil, comments: nil, context:)
120
+ def initialize(context:, pattern_header: nil, comments: nil)
121
121
  @pattern_header = pattern_header
122
122
  @comments = comments || []
123
123
 
@@ -164,7 +164,7 @@ module OrigenTesters
164
164
  end
165
165
  vectors
166
166
  else
167
- each_vector { |v| return v }
167
+ each_vector { |v| return v } # rubocop:disable Lint/UnreachableLoop
168
168
  end
169
169
  end
170
170
  end
@@ -94,7 +94,6 @@ module OrigenTesters
94
94
  # - Its possible (and fine) for endmatter to be non-existant, or even not allowed.
95
95
  # - In the latter case, the endvector symbol should the EoF symbol.
96
96
  # @return (Hash)
97
- # rubocop:disable Metrics/ParameterLists
98
97
  def split(pinlist_start:, vectors_start:, vectors_end:, vectors_include_start_line: false, vectors_include_end_line: false, &block)
99
98
  def check_match(matcher, line, index, indices)
100
99
  if matcher.respond_to?(:call)
@@ -158,7 +157,6 @@ module OrigenTesters
158
157
 
159
158
  indices
160
159
  end
161
- # rubocop:enable Metrics/ParameterLists
162
160
  end
163
161
  end
164
162
  end
@@ -177,6 +177,7 @@ module OrigenTesters
177
177
  if @first_vector.nil?
178
178
  fail OrigenTesters::Decompiler::ParseError, "Could not locate the first vector in pattern #{@source}"
179
179
  end
180
+
180
181
  @first_vector
181
182
  end
182
183
  end
@@ -249,7 +250,7 @@ module OrigenTesters
249
250
  def first_vector?
250
251
  first_vector
251
252
  rescue OrigenTesters::Decompiler::ParseError
252
- return false
253
+ false
253
254
  end
254
255
 
255
256
  # Adds any pins in the decompiled pattern to the DUT which are not already present.
@@ -244,12 +244,11 @@ module OrigenTesters
244
244
 
245
245
  def get_app(file)
246
246
  path = Pathname.new(file).dirname
247
- until File.exist?(File.join(path, 'config/application.rb')) || path.root?
248
- path = path.parent
249
- end
247
+ path = path.parent until File.exist?(File.join(path, 'config/application.rb')) || path.root?
250
248
  if path.root?
251
249
  fail 'Something went wrong resoving the app root in OrigenTesters'
252
250
  end
251
+
253
252
  Origen.find_app_by_root(path)
254
253
  end
255
254
 
@@ -16,7 +16,7 @@ module OrigenTesters
16
16
  end
17
17
 
18
18
  def map_for(obj)
19
- @store[obj.object_id]
19
+ @store[obj.object_id] # rubocop:disable Lint/HashCompareByIdentity
20
20
  end
21
21
  end
22
22
  end
@@ -8,9 +8,7 @@ module OrigenTesters
8
8
  # @option options [Float] :range (1.26) The range parameter, see code formula
9
9
  # @option options [Integer] :offset (0) The o
10
10
  def test_number_for(test_name, options = {})
11
- options = {
12
-
13
- }.merge(options)
11
+ options = {}.merge(options)
14
12
  end
15
13
 
16
14
  private
@@ -108,6 +108,7 @@ module OrigenTesters
108
108
  }.merge(options)
109
109
  # Allow generators to override this and fully define the filename if they want
110
110
  return fully_formatted_filename if try(:fully_formatted_filename)
111
+
111
112
  name = (@filename || Origen.file_handler.current_file.basename('.rb')).to_s
112
113
  name[0] = '' if name[0] == '_'
113
114
  if Origen.config.program_prefix
@@ -178,6 +179,7 @@ module OrigenTesters
178
179
 
179
180
  def write_from_template(options = {})
180
181
  return unless Origen.interface.write?
182
+
181
183
  options = {
182
184
  quiet: false,
183
185
  skip_diff: false
@@ -192,7 +194,7 @@ module OrigenTesters
192
194
  @append = true
193
195
  Origen.file_handler.preserve_state do
194
196
  File.open(output_file, 'a') do |out|
195
- content = compiler.insert(ERB.new(File.read(self.class::TEMPLATE), 0, Origen.config.erb_trim_mode).result(binding))
197
+ content = compiler.insert(ERB.new(File.read(self.class::TEMPLATE), trim_mode: Origen.config.erb_trim_mode).result(binding))
196
198
  out.puts content unless content.empty?
197
199
  end
198
200
  end
@@ -201,7 +203,7 @@ module OrigenTesters
201
203
  @append = false
202
204
  Origen.file_handler.preserve_state do
203
205
  File.open(output_file, 'w') do |out|
204
- out.puts compiler.insert(ERB.new(File.read(self.class::TEMPLATE), 0, Origen.config.erb_trim_mode).result(binding))
206
+ out.puts compiler.insert(ERB.new(File.read(self.class::TEMPLATE), trim_mode: Origen.config.erb_trim_mode).result(binding))
205
207
  end
206
208
  end
207
209
  @@opened_files << output_file
@@ -46,7 +46,7 @@ module OrigenTesters
46
46
  case data
47
47
  when NilClass
48
48
  data_new = 0
49
- when Fixnum, Float
49
+ when Integer, Float
50
50
  case
51
51
  when data == 0
52
52
  data_new = data.to_s
@@ -106,7 +106,7 @@ module OrigenTesters
106
106
  end
107
107
  # Set the defaults
108
108
  self.class::TEST_INSTANCE_DEFAULTS.each do |k, v|
109
- send("#{k}=", v) if self.respond_to?("#{k}=", v)
109
+ send("#{k}=", v) if respond_to?("#{k}=", v)
110
110
  end
111
111
  # Finally set any initial values that have been supplied
112
112
  options[:attrs].each do |k, v|
@@ -59,7 +59,7 @@ module OrigenTesters
59
59
  case data
60
60
  when NilClass
61
61
  data_new = 0
62
- when Fixnum, Float
62
+ when Integer, Float
63
63
  case
64
64
  when data == 0
65
65
  data_new = data.to_s
@@ -20,7 +20,7 @@ module OrigenTesters
20
20
  esname = esname.to_sym unless esname.is_a? Symbol
21
21
  pin = pin.to_sym unless pin.is_a? Symbol
22
22
  @es.key?(esname) ? @es[esname].add_edge(pin, edge) : @es[esname] = platform::Edgeset.new(esname, pin, edge, options)
23
- @es_sheet_pins = options[:es_sheet_pins] unless @es_sheet_pins
23
+ @es_sheet_pins ||= options[:es_sheet_pins]
24
24
  @es
25
25
  end
26
26