origen_testers 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/config/application.rb +140 -0
  3. data/config/commands.rb +73 -0
  4. data/config/development.rb +12 -0
  5. data/config/environment.rb +1 -0
  6. data/config/shared_commands.rb +47 -0
  7. data/config/users.rb +18 -0
  8. data/config/version.rb +8 -0
  9. data/lib/commands/build.rb +69 -0
  10. data/lib/origen_testers.rb +23 -0
  11. data/lib/origen_testers/api.rb +258 -0
  12. data/lib/origen_testers/basic_test_setups.rb +105 -0
  13. data/lib/origen_testers/callback_handlers.rb +58 -0
  14. data/lib/origen_testers/generator.rb +279 -0
  15. data/lib/origen_testers/generator/flow_control_api.rb +611 -0
  16. data/lib/origen_testers/generator/identity_map.rb +23 -0
  17. data/lib/origen_testers/generator/placeholder.rb +11 -0
  18. data/lib/origen_testers/generator/test_numberer.rb +23 -0
  19. data/lib/origen_testers/igxl_based_tester.rb +12 -0
  20. data/lib/origen_testers/igxl_based_tester/base.rb +641 -0
  21. data/lib/origen_testers/igxl_based_tester/base/flow.rb +171 -0
  22. data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +322 -0
  23. data/lib/origen_testers/igxl_based_tester/base/generator.rb +217 -0
  24. data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +109 -0
  25. data/lib/origen_testers/igxl_based_tester/base/patgroups.rb +38 -0
  26. data/lib/origen_testers/igxl_based_tester/base/patset.rb +68 -0
  27. data/lib/origen_testers/igxl_based_tester/base/patset_pattern.rb +56 -0
  28. data/lib/origen_testers/igxl_based_tester/base/patsets.rb +38 -0
  29. data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +68 -0
  30. data/lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb +56 -0
  31. data/lib/origen_testers/igxl_based_tester/base/patsubrs.rb +38 -0
  32. data/lib/origen_testers/igxl_based_tester/base/test_instance.rb +326 -0
  33. data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +58 -0
  34. data/lib/origen_testers/igxl_based_tester/base/test_instances.rb +179 -0
  35. data/lib/origen_testers/igxl_based_tester/files.rb +43 -0
  36. data/lib/origen_testers/igxl_based_tester/j750.rb +248 -0
  37. data/lib/origen_testers/igxl_based_tester/j750/flow.rb +10 -0
  38. data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +19 -0
  39. data/lib/origen_testers/igxl_based_tester/j750/generator.rb +19 -0
  40. data/lib/origen_testers/igxl_based_tester/j750/patgroup.rb +9 -0
  41. data/lib/origen_testers/igxl_based_tester/j750/patgroups.rb +10 -0
  42. data/lib/origen_testers/igxl_based_tester/j750/patset.rb +9 -0
  43. data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +18 -0
  44. data/lib/origen_testers/igxl_based_tester/j750/patsets.rb +10 -0
  45. data/lib/origen_testers/igxl_based_tester/j750/patsubr.rb +9 -0
  46. data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +18 -0
  47. data/lib/origen_testers/igxl_based_tester/j750/patsubrs.rb +10 -0
  48. data/lib/origen_testers/igxl_based_tester/j750/templates/flow.txt.erb +9 -0
  49. data/lib/origen_testers/igxl_based_tester/j750/templates/instances.txt.erb +16 -0
  50. data/lib/origen_testers/igxl_based_tester/j750/templates/patgroups.txt.erb +8 -0
  51. data/lib/origen_testers/igxl_based_tester/j750/templates/patsets.txt.erb +10 -0
  52. data/lib/origen_testers/igxl_based_tester/j750/templates/patsubrs.txt.erb +10 -0
  53. data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +547 -0
  54. data/lib/origen_testers/igxl_based_tester/j750/test_instance_group.rb +9 -0
  55. data/lib/origen_testers/igxl_based_tester/j750/test_instances.rb +10 -0
  56. data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +34 -0
  57. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow.rb +9 -0
  58. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow_line.rb +9 -0
  59. data/lib/origen_testers/igxl_based_tester/j750_hpt/generator.rb +19 -0
  60. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroup.rb +9 -0
  61. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroups.rb +9 -0
  62. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset.rb +9 -0
  63. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset_pattern.rb +9 -0
  64. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsets.rb +9 -0
  65. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr.rb +9 -0
  66. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr_pattern.rb +9 -0
  67. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubrs.rb +9 -0
  68. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +515 -0
  69. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance_group.rb +9 -0
  70. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instances.rb +9 -0
  71. data/lib/origen_testers/igxl_based_tester/parser.rb +102 -0
  72. data/lib/origen_testers/igxl_based_tester/parser/ac_spec.rb +9 -0
  73. data/lib/origen_testers/igxl_based_tester/parser/ac_specs.rb +0 -0
  74. data/lib/origen_testers/igxl_based_tester/parser/dc_spec.rb +33 -0
  75. data/lib/origen_testers/igxl_based_tester/parser/dc_specs.rb +48 -0
  76. data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +339 -0
  77. data/lib/origen_testers/igxl_based_tester/parser/flow.rb +109 -0
  78. data/lib/origen_testers/igxl_based_tester/parser/flow_line.rb +203 -0
  79. data/lib/origen_testers/igxl_based_tester/parser/flows.rb +21 -0
  80. data/lib/origen_testers/igxl_based_tester/parser/pattern_set.rb +92 -0
  81. data/lib/origen_testers/igxl_based_tester/parser/pattern_sets.rb +31 -0
  82. data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +341 -0
  83. data/lib/origen_testers/igxl_based_tester/parser/test_instances.rb +24 -0
  84. data/lib/origen_testers/igxl_based_tester/parser/timeset.rb +13 -0
  85. data/lib/origen_testers/igxl_based_tester/parser/timesets.rb +0 -0
  86. data/lib/origen_testers/igxl_based_tester/ultraflex.rb +477 -0
  87. data/lib/origen_testers/igxl_based_tester/ultraflex/flow.rb +10 -0
  88. data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +19 -0
  89. data/lib/origen_testers/igxl_based_tester/ultraflex/generator.rb +19 -0
  90. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroup.rb +9 -0
  91. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroups.rb +10 -0
  92. data/lib/origen_testers/igxl_based_tester/ultraflex/patset.rb +9 -0
  93. data/lib/origen_testers/igxl_based_tester/ultraflex/patset_pattern.rb +18 -0
  94. data/lib/origen_testers/igxl_based_tester/ultraflex/patsets.rb +10 -0
  95. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr.rb +9 -0
  96. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +18 -0
  97. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubrs.rb +10 -0
  98. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/flow.txt.erb +9 -0
  99. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/instances.txt.erb +16 -0
  100. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patgroups.txt.erb +9 -0
  101. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsets.txt.erb +10 -0
  102. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsubrs.txt.erb +10 -0
  103. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance.rb +270 -0
  104. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance_group.rb +9 -0
  105. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instances.rb +10 -0
  106. data/lib/origen_testers/interface.rb +183 -0
  107. data/lib/origen_testers/parser.rb +22 -0
  108. data/lib/origen_testers/parser/description_lookup.rb +62 -0
  109. data/lib/origen_testers/parser/searchable_array.rb +30 -0
  110. data/lib/origen_testers/parser/searchable_hash.rb +30 -0
  111. data/lib/origen_testers/pattern_compilers.rb +116 -0
  112. data/lib/origen_testers/pattern_compilers/assembler.rb +88 -0
  113. data/lib/origen_testers/pattern_compilers/job.rb +96 -0
  114. data/lib/origen_testers/pattern_compilers/ultraflex_pattern_compiler.rb +599 -0
  115. data/lib/origen_testers/program_generators.rb +55 -0
  116. data/lib/origen_testers/smartest_based_tester.rb +8 -0
  117. data/lib/origen_testers/smartest_based_tester/base.rb +411 -0
  118. data/lib/origen_testers/smartest_based_tester/base/flow.rb +188 -0
  119. data/lib/origen_testers/smartest_based_tester/base/flow_node.rb +476 -0
  120. data/lib/origen_testers/smartest_based_tester/base/generator.rb +123 -0
  121. data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +23 -0
  122. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +47 -0
  123. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +143 -0
  124. data/lib/origen_testers/smartest_based_tester/base/test_methods.rb +73 -0
  125. data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +33 -0
  126. data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +38 -0
  127. data/lib/origen_testers/smartest_based_tester/base/test_methods/custom_tml.rb +19 -0
  128. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +147 -0
  129. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +43 -0
  130. data/lib/origen_testers/smartest_based_tester/base/test_suite.rb +166 -0
  131. data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +58 -0
  132. data/lib/origen_testers/smartest_based_tester/v93k.rb +8 -0
  133. data/lib/origen_testers/smartest_based_tester/v93k/builder.rb +89 -0
  134. data/lib/origen_testers/smartest_based_tester/v93k/builder/flow.rb +169 -0
  135. data/lib/origen_testers/smartest_based_tester/v93k/builder/pattern_master.rb +54 -0
  136. data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +10 -0
  137. data/lib/origen_testers/smartest_based_tester/v93k/flow_node.rb +9 -0
  138. data/lib/origen_testers/smartest_based_tester/v93k/generator.rb +19 -0
  139. data/lib/origen_testers/smartest_based_tester/v93k/pattern_compiler.rb +10 -0
  140. data/lib/origen_testers/smartest_based_tester/v93k/pattern_master.rb +10 -0
  141. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.aiv.erb +17 -0
  142. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.flow.erb +201 -0
  143. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.pmfl.erb +13 -0
  144. data/lib/origen_testers/smartest_based_tester/v93k/test_method.rb +9 -0
  145. data/lib/origen_testers/smartest_based_tester/v93k/test_methods.rb +9 -0
  146. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +9 -0
  147. data/lib/origen_testers/smartest_based_tester/v93k/test_suites.rb +9 -0
  148. data/lib/origen_testers/test/basic_interface.rb +17 -0
  149. data/lib/origen_testers/test/block.rb +21 -0
  150. data/lib/origen_testers/test/dut.rb +184 -0
  151. data/lib/origen_testers/test/dut2.rb +76 -0
  152. data/lib/origen_testers/test/j750_base_interface.rb +119 -0
  153. data/lib/origen_testers/test/j750_hpt_interface.rb +8 -0
  154. data/lib/origen_testers/test/j750_interface.rb +8 -0
  155. data/lib/origen_testers/test/nvm.rb +94 -0
  156. data/lib/origen_testers/test/ultraflex_interface.rb +110 -0
  157. data/lib/origen_testers/test/v93k_interface.rb +115 -0
  158. data/lib/origen_testers/timing.rb +362 -0
  159. data/lib/origen_testers/vector.rb +203 -0
  160. data/lib/origen_testers/vector_based_tester.rb +42 -0
  161. data/lib/origen_testers/vector_generator.rb +623 -0
  162. data/lib/origen_testers/vector_pipeline.rb +288 -0
  163. data/pattern/dc_instr.rb +7 -0
  164. data/pattern/delay.rb +7 -0
  165. data/pattern/mem_test.rb +8 -0
  166. data/pattern/multi_vector.rb +117 -0
  167. data/pattern/multi_vector_plus1.rb +125 -0
  168. data/pattern/nvm/j750/add_late_pins.rb +3 -0
  169. data/pattern/nvm/j750/iterator_postfix_test_x_bx.rb +8 -0
  170. data/pattern/nvm/j750/iterator_test_x_bx.rb +8 -0
  171. data/pattern/nvm/j750/j750_halt.rb +159 -0
  172. data/pattern/nvm/j750/j750_workout.rb +202 -0
  173. data/pattern/nvm/j750/timing.rb +73 -0
  174. data/pattern/nvm/v93k/v93k_workout.rb +136 -0
  175. data/pattern/read_write_reg.rb +58 -0
  176. data/pattern/reset.rb +4 -0
  177. data/pattern/subroutines.rb +38 -0
  178. data/program/_additional_erase.rb +7 -0
  179. data/program/_efa_resources.rb +7 -0
  180. data/program/_erase.rb +25 -0
  181. data/program/_erase_vfy.rb +5 -0
  182. data/program/_iv_resources.rb +10 -0
  183. data/program/basic_interface.rb +5 -0
  184. data/program/components/_prb2_main.rb +6 -0
  185. data/program/flow_control.rb +164 -0
  186. data/program/prb1.rb +226 -0
  187. data/program/prb1_resources.rb +28 -0
  188. data/program/prb2.rb +40 -0
  189. data/program/test.rb +20 -0
  190. data/templates/example.txt.erb +53 -0
  191. data/templates/j750/_vt_flow.txt.erb +8 -0
  192. data/templates/j750/_vt_instances.txt.erb +4 -0
  193. data/templates/j750/program_sheet.txt.erb +9 -0
  194. data/templates/manifest/v93k.yaml.erb +22 -0
  195. data/templates/web/index.md.erb +51 -0
  196. data/templates/web/layouts/_basic.html.erb +15 -0
  197. data/templates/web/partials/_navbar.html.erb +22 -0
  198. data/templates/web/release_notes.md.erb +5 -0
  199. metadata +332 -0
@@ -0,0 +1,58 @@
1
+ module OrigenTesters
2
+ module IGXLBasedTester
3
+ class Base
4
+ class TestInstanceGroup
5
+ attr_accessor :name, :version, :append_version
6
+
7
+ include Enumerable
8
+
9
+ def initialize(name, options = {})
10
+ @name = name
11
+ @store = []
12
+ @append_version = true
13
+ end
14
+
15
+ def name
16
+ if unversioned_name
17
+ if version && @append_version
18
+ "#{unversioned_name}_v#{version}"
19
+ else
20
+ unversioned_name.to_s
21
+ end
22
+ end
23
+ end
24
+
25
+ def unversioned_name
26
+ if @name
27
+ if @name =~ /grp$/
28
+ @name
29
+ else
30
+ "#{@name}_grp"
31
+ end
32
+ end
33
+ end
34
+
35
+ def <<(instance)
36
+ @store << instance
37
+ end
38
+
39
+ def size
40
+ @store.size
41
+ end
42
+
43
+ def each
44
+ @store.each { |ins| yield ins }
45
+ end
46
+
47
+ def ==(other_instance_group)
48
+ self.class == other_instance_group.class &&
49
+ unversioned_name.to_s == other_instance_group.unversioned_name.to_s &&
50
+ size == other_instance_group.size &&
51
+ self.all? do |ins|
52
+ other_instance_group.any? { |other_ins| ins == other_ins }
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,179 @@
1
+ module OrigenTesters
2
+ module IGXLBasedTester
3
+ class Base
4
+ class TestInstances
5
+ include OrigenTesters::Generator
6
+
7
+ OUTPUT_POSTFIX = 'instances'
8
+
9
+ class IndexedString < ::String
10
+ attr_accessor :index
11
+
12
+ def name
13
+ self
14
+ end
15
+ end
16
+
17
+ def add(name, type, options = {})
18
+ options = {
19
+ test_instance_class: platform::TestInstance
20
+ }.merge(options)
21
+ ins = options.delete(:test_instance_class).new(name, type, options)
22
+ if @current_group
23
+ @current_group << ins
24
+ else
25
+ collection << ins
26
+ end
27
+ c = Origen.interface.consume_comments
28
+ Origen.interface.descriptions.add_for_test_definition(name, c)
29
+ ins
30
+ end
31
+
32
+ # IG-XL doesn't have a formal instance group type and instead declares them anonymously
33
+ # whenever test instances of the same name appear consecutively in the test instance sheet.
34
+ # However when it comes to generating a test program life becomes much easier if we have
35
+ # a way to explicitly declare instances as part of a group - this makes duplicate tracking
36
+ # and sorting of the test instance sheet much easier.
37
+ #
38
+ # Use this method to generate instance groups via a block. Within the block you should
39
+ # generate instances as normal and they will automatically be assigned to the current group.
40
+ # Note that the name of the instances generated within the group is discarded and replaced
41
+ # with the name of the group. Origen automatically appends "grp" to this name to highlight
42
+ # instances that were generated as part of the group.
43
+ #
44
+ # test_instances.group("erase_all_blocks") do |group|
45
+ # # Generate instances here as normal
46
+ # test_instances.functional("erase_blk0")
47
+ # test_instances.functional("erase_blk1")
48
+ # end
49
+ #
50
+ # The group object is passed into the block but usually you should not need to interact
51
+ # with this directly except maybe to set the name if it is not yet established at the point
52
+ # where the group is initiated:
53
+ #
54
+ # test_instances.group do |group|
55
+ # # Generate instances here as normal
56
+ # group.name = "group_blah"
57
+ # end
58
+ #
59
+ # A common way to generate groups is to create a helper method in your application which
60
+ # is responsible for creating groups as required:
61
+ #
62
+ # def group_wrapper(name, options)
63
+ # if options[:by_block]
64
+ # test_instances.group(name) do |group|
65
+ # yield group
66
+ # end
67
+ # else
68
+ # yield
69
+ # end
70
+ # end
71
+ #
72
+ # In that case the group argument becomes quite useful for branching based on whether you
73
+ # are generating a group or standalone instances:
74
+ #
75
+ # group_wrapper(name, options) do |group|
76
+ # if group
77
+ # # Generate group instances
78
+ # else
79
+ # # Generate standalone instances
80
+ # end
81
+ # end
82
+ def group(name = nil, options = {})
83
+ name, options = nil, name if name.is_a?(Hash)
84
+ @current_group = platform::TestInstanceGroup.new(name, options)
85
+ collection << @current_group
86
+ yield @current_group
87
+ @current_group = nil
88
+ end
89
+ alias_method :add_group, :group
90
+
91
+ def finalize(options = {}) # :nodoc:
92
+ uniq!
93
+ sort!
94
+ end
95
+
96
+ def uniq! # :nodoc:
97
+ uniques = []
98
+ versions = {}
99
+ multi_version_tests = {}
100
+ collection.each do |instance|
101
+ # If a uniquely named instance is found add it, otherwise update the version
102
+ # of the current instance to match that of the existing instance that it duplicates
103
+ unless uniques.any? do |i|
104
+ if i == instance
105
+ instance.version = i.version
106
+ true
107
+ else
108
+ false
109
+ end
110
+ end
111
+ if instance.respond_to?(:version=)
112
+ versions[instance.unversioned_name] ||= 0
113
+ versions[instance.unversioned_name] += 1
114
+ if versions[instance.unversioned_name] > 1
115
+ multi_version_tests[instance.unversioned_name] = true
116
+ end
117
+ instance.version = versions[instance.unversioned_name]
118
+ end
119
+ uniques << instance
120
+ end
121
+ end
122
+ # This final loop disables the version identifier for tests that have only a single version,
123
+ # this makes it clearer when multiple versions exist - whenever you see a v1 you know there
124
+ # is at least a v2 also.
125
+ collection.map! do |instance|
126
+ if instance.respond_to?(:version=)
127
+ unless multi_version_tests[instance.unversioned_name]
128
+ instance.append_version = false
129
+ end
130
+ end
131
+ instance
132
+ end
133
+ self.collection = uniques
134
+ end
135
+
136
+ def sort! # :nodoc:
137
+ # Present the instances in the final sheet in alphabetical order
138
+ collection.map!.with_index do |ins, i|
139
+ if ins.is_a?(String) # Can happen if content has been rendered in from a template
140
+ ins = IndexedString.new(ins)
141
+ end
142
+ ins
143
+ end
144
+ collection.sort! { |a, b| [a.name.to_s] <=> [b.name.to_s] }
145
+ end
146
+
147
+ def bpmu(name, options = {})
148
+ add(name, :board_pmu, options)
149
+ end
150
+ alias_method :board_pmu, :bpmu
151
+
152
+ def ppmu(name, options = {})
153
+ add(name, :pin_pmu, options)
154
+ end
155
+ alias_method :pin_pmu, :ppmu
156
+
157
+ def functional(name, options = {})
158
+ add(name, :functional, options)
159
+ end
160
+
161
+ def empty(name, options = {})
162
+ add(name, :empty, options)
163
+ end
164
+
165
+ def other(name, options = {})
166
+ add(name, :other, options)
167
+ end
168
+
169
+ def apmu_powersupply(name, options = {})
170
+ add(name, :apmu_powersupply, options)
171
+ end
172
+
173
+ def mto_memory(name, options = {})
174
+ add(name, :mto_memory, options)
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,43 @@
1
+ module OrigenTesters
2
+ module IGXLBasedTester
3
+ # Methods for handling all J750 file parsing, e.g. datalogs,
4
+ # test time profiles, etc.
5
+ module Files
6
+ # Reads all lines from a J750 detailed execution time file, returning the lines
7
+ # as an array like this:
8
+ #
9
+ # [
10
+ # {:name => "power_cycle", :index => 1, :group => 3, :time => 0.00461},
11
+ # {:name => "power_cycle", :index => 2, :group => 3, :time => 0.00481},
12
+ # {:name => "power_cycle", :index => 3, :group => 3, :time => 0.00438},
13
+ # {:name => "nvm_mass_erase", :index => nil, :group => nil, :time => 0.19863},
14
+ # ]
15
+ def read_test_times(file, options = {})
16
+ tests = []
17
+ File.readlines(file).each do |line|
18
+ unless line.strip.empty? || line =~ /Entire Job/
19
+ # http://rubular.com/r/vZOcqovTsf
20
+ if line =~ /(\w+) ?(\(.*?\))? \d\d\d\d (\d+\.\d+).*/
21
+ t = { name: Regexp.last_match[1], time: Regexp.last_match[3].to_f.round(6) }
22
+ # If an indexed test
23
+ if Regexp.last_match[2]
24
+ str = Regexp.last_match[2].gsub('(', '').gsub(')', '')
25
+ fields = str.split('/')
26
+ i = fields[0].to_i
27
+ g = fields[1].to_i
28
+ t[:index] = i
29
+ t[:group] = g
30
+
31
+ else
32
+ t[:index] = nil
33
+ t[:group] = nil
34
+ end
35
+ tests << t
36
+ end
37
+ end
38
+ end
39
+ tests
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,248 @@
1
+ module OrigenTesters
2
+ module IGXLBasedTester
3
+ # Tester model to generate .atp patterns for the Teradyne J750
4
+ #
5
+ # == Basic Usage
6
+ # $tester = Testers::J750.new
7
+ # $tester.cycle # Generate a vector
8
+ #
9
+ # Many more methods exist to generate J750 specific micro-code, see below for
10
+ # details.
11
+ #
12
+ # Also note that this class inherits from the base Tester class and so all methods
13
+ # described there are also available.
14
+ class J750 < Base
15
+ require 'origen_testers/igxl_based_tester/j750/generator.rb'
16
+
17
+ attr_accessor :use_hv_pin
18
+ attr_accessor :software_version
19
+
20
+ def self.hpt_mode
21
+ @@hpt_mode
22
+ end
23
+ def self.hpt_mode?
24
+ @@hpt_mode
25
+ end
26
+
27
+ # Returns a new J750 instance, normally there would only ever be one of these
28
+ # assigned to the global variable such as $tester by your target.
29
+ def initialize
30
+ super
31
+ @pipeline_depth = 34 # for extended mode is vectors, for normal mode is vector pairs (54 for J750Ex)
32
+ @use_hv_pin = false # allows to use high voltage for a pin for all patterns
33
+ @software_version = '3.50.40'
34
+ @name = 'j750'
35
+ @@hpt_mode = false
36
+ @opcode_mode = :extended
37
+ @loop_bits_max = 16 # maximum loop bit length
38
+
39
+ @flags = %w(cpuA cpuB cpuC cpuD)
40
+ @microcode[:enable] = 'enable'
41
+ @microcode[:set_flag] = 'set_cpu'
42
+ @microcode[:mask_vector] = 'ign ifc icc'
43
+ end
44
+
45
+ def pattern_header(options = {})
46
+ super(options) do |pin_list|
47
+ microcode "vector ($tset, #{pin_list})"
48
+ microcode '{'
49
+ unless options[:subroutine_pat]
50
+ microcode 'start_label pattern_st:'
51
+ end
52
+ end
53
+ end
54
+
55
+ def pattern_footer(options = {})
56
+ super(options)
57
+ end
58
+
59
+ # Generates a match loop based on vector condition passed in via block
60
+ #
61
+ # This method is not really intended to be called directly, rather you should call
62
+ # via Tester#wait:
63
+ # e.g. $tester.wait(:match => true) do
64
+ # reg(:status_reg).bit(:done).read(1)! # vector condition that you want to match
65
+ # end
66
+ #
67
+ # The timeout should be provided in cycles, however when called via the wait method the
68
+ # time-based helpers (time_in_us, etc) will be converted to cycles for you.
69
+ #
70
+ # The following options are available to tailor the match loop behavior, defaults in
71
+ # parenthesis:
72
+ # * :check_for_fails (false) - Flushes the pipeline and handshakes with the tester (passing readcode 100) prior to the match (to allow binout of fails encountered before the match)
73
+ # * :force_fail_on_timeout (true) - Force a vector mis-compare if the match loop times out
74
+ # * :on_timeout_goto ("") - Optionally supply a label to branch to on timeout, by default will continue from the end of the match loop
75
+ # * :on_block_match_goto ("") - Optionally supply a label to branch to when block condition is met, by default will continue from the end of the match loop
76
+ # * :multiple_entries (false) - Supply an integer to generate multiple entries into the match (each with a unique readcode), this can be useful when debugging patterns with multiple matches
77
+ # * :force_fail_on_timeout (true) - force pattern to fail if timeout occurs
78
+ # * :global_loops (false) - whether match loop loops should use global labels
79
+ # * :manual_stop (false) - whether to use extra cpuB flag to resolve IG-XL v.3.50.xx bug where VBT clears cpuA immediately
80
+ # at start of PatFlagFunc instead of at end. Use will have to manually clear cpuB to resume this pattern.
81
+ # ==== Examples
82
+ # $tester.wait(:match => true, :time_in_us => 5000, :pin => $top.pin(:done), :state => :high) do
83
+ # <vectors>
84
+ # end
85
+ def match_block(timeout, options = {}, &block)
86
+ options = {
87
+ check_for_fails: false,
88
+ on_timeout_goto: false,
89
+ on_block_match_goto: false,
90
+ multiple_entries: false,
91
+ force_fail_on_timeout: true,
92
+ global_loops: false,
93
+ manual_stop: false,
94
+ clr_fail_post_match: false
95
+ }.merge(options)
96
+
97
+ unless block_given?
98
+ fail 'ERROR: block not passed to match_block!'
99
+ end
100
+
101
+ # Create BlockArgs objects in order to receive multiple blocks
102
+ match_conditions = Origen::Utility::BlockArgs.new
103
+ fail_conditions = Origen::Utility::BlockArgs.new
104
+
105
+ # yield object to calling routine to get populated with blocks
106
+ if block.arity > 0
107
+ yield match_conditions, fail_conditions
108
+ else
109
+ # for backwards compatibility with Origen core call to match_block
110
+ match_conditions.add(&block)
111
+ fail_conditions.add(&block)
112
+ end
113
+
114
+ # Flush the pipeline first and then pass control to the program to bin out any failures
115
+ # prior to entering the match loop
116
+ if options[:check_for_fails]
117
+ if options[:multiple_entries]
118
+ @match_entries.times do |i|
119
+ microcode "global subr match_done_#{i}:"
120
+ set_code(i + 100)
121
+ cycle(microcode: 'jump call_tester') unless i == @match_entries - 1
122
+ end
123
+ microcode 'call_tester:'
124
+ else
125
+ set_code(100)
126
+ end
127
+ cc 'Wait for any prior failures to propagate through the pipeline'
128
+ cycle(microcode: 'pipe_minus 1')
129
+ cc 'Now handshake with the tester to bin out and parts that have failed before they got here'
130
+ handshake(manual_stop: options[:manual_stop])
131
+ end
132
+
133
+ # Now do the main match loop
134
+ cc 'Start the match loop'
135
+
136
+ global_opt = (options[:global_loops]) ? 'global ' : ''
137
+ microcode "#{global_opt}match_outer_loop_#{@unique_counter}:"
138
+ cycle # (:microcode => "loopB #{outer_loop_count} ign ifc icc")
139
+ set_loopb_vector = last_vector
140
+
141
+ microcode "#{global_opt}match_inner_loop_#{@unique_counter}:"
142
+ cycle # (:microcode => "loopA #{inner_loop_count} ign ifc icc")
143
+ set_loopa_vector = last_vector
144
+
145
+ # count cycles in match loop block passed to help with meeting
146
+ # desired timeout value (have to back assign microcodes above)
147
+ prematch_cycle_count = cycle_count
148
+ match_conditions.each_with_index do |condition, i|
149
+ mask_fails(true)
150
+ condition.call # match condition
151
+ mask_fails(false)
152
+ cc ' Wait for the result to propagate through the pipeline'
153
+ cycle(microcode: 'pipe_minus 1 ign ifc icc')
154
+ inc_cycle_count(@pipeline_depth - 1) # Account for pipeline depth
155
+ cc "Branch if block condition #{i} met"
156
+ cycle(microcode: "if (pass) jump block_#{i}_matched_#{@unique_counter} icc ifc")
157
+ cycle(microcode: 'clr_flag (fail) icc')
158
+ end
159
+ match_conditions_cycle_count = cycle_count - prematch_cycle_count
160
+ cc "Match loop cycle count = #{match_conditions_cycle_count}"
161
+
162
+ # reduce timeout requested by match loop cycle count
163
+ timeout = (timeout.to_f / match_conditions_cycle_count).ceil
164
+
165
+ # Calculate the loop counts for the 2 loops to appropriately hit the timeout requested
166
+ loop_value = timeout.to_f.floor
167
+
168
+ if loop_value < (2**@loop_bits_max)
169
+ # small value, only need to use one loop
170
+ outer_loop_count = 1
171
+ inner_loop_count = loop_value
172
+ elsif loop_value < (2**(2 * @loop_bits_max))
173
+ # 2 nested loops required
174
+ inner_loop_count = 2**@loop_bits_max - 1
175
+ outer_loop_count = (loop_value.to_f / inner_loop_count).ceil
176
+ else
177
+ abort 'ERROR: timeout value too large in tester match method!'
178
+ end
179
+
180
+ # retroactively set loop counter values for timeout based on cycles in match loop condition
181
+ set_loopb_vector.microcode = "loopB #{outer_loop_count} ign ifc icc"
182
+ set_loopa_vector.microcode = "loopA #{inner_loop_count} ign ifc icc"
183
+
184
+ cc 'Loop back around if time remaining'
185
+ cycle(microcode: "end_loopA match_inner_loop_#{@unique_counter} icc")
186
+ cycle(microcode: "end_loopB match_outer_loop_#{@unique_counter} icc")
187
+
188
+ if options[:force_fail_on_timeout]
189
+ cc 'To get here something has gone wrong, check block again to force a pattern failure'
190
+ fail_conditions.each(&:call)
191
+ end
192
+
193
+ if options[:on_timeout_goto]
194
+ cycle(microcode: "jump #{options[:on_timeout_goto]} icc")
195
+ else
196
+ cycle(microcode: "jump match_loop_end_#{@unique_counter} icc")
197
+ # cycle(:microcode => 'halt')
198
+ end
199
+ match_conditions.each_with_index do |condition, i|
200
+ microcode "block_#{i}_matched_#{@unique_counter}:"
201
+ cycle(microcode: 'pop_loop icc')
202
+ end
203
+ if options[:clr_fail_post_match]
204
+ cycle(microcode: 'clr_fail')
205
+ end
206
+ if options[:on_block_match_goto]
207
+ cycle(microcode: "jump #{options[:on_block_match_goto]}")
208
+ end
209
+ microcode "match_loop_end_#{@unique_counter}:"
210
+ if options[:clr_fail_post_match]
211
+ cycle(microcode: 'clr_fail')
212
+ end
213
+
214
+ @unique_counter += 1 # Increment so a different label will be applied if another
215
+ # handshake is called in the same pattern
216
+ end
217
+
218
+ # Handshake with the tester.
219
+ #
220
+ # Will set a cpu flag (A) and wait for it to be cleared by the tester, optionally
221
+ # pass in a read code to pass information to the tester.
222
+ #
223
+ # ==== Examples
224
+ # $tester.handshake # Pass control to the tester for a measurement
225
+ # $tester.handshake(:readcode => 10) # Trigger a specific action by the tester
226
+ def handshake(options = {})
227
+ options = {
228
+ readcode: false,
229
+ manual_stop: false, # set a 2nd CPU flag in case 1st flag is automatically cleared
230
+ }.merge(options)
231
+ if options[:readcode]
232
+ set_code(options[:readcode])
233
+ end
234
+ if options[:manual_stop]
235
+ cycle(microcode: "#{@microcode[:enable]} (#{@flags[1]})")
236
+ cycle(microcode: "#{@microcode[:set_flag]} (#{@flags[0]} #{@flags[1]})")
237
+ cycle(microcode: "loop_here_#{@unique_counter}: if (flag) jump loop_here_#{@unique_counter}")
238
+ else
239
+ cycle(microcode: "#{@microcode[:set_flag]} (#{@flags[0]})")
240
+ cycle(microcode: "loop_here_#{@unique_counter}: if (#{@flags[0]}) jump loop_here_#{@unique_counter}")
241
+ end
242
+ @unique_counter += 1 # Increment so a different label will be applied if another
243
+ # handshake is called in the same pattern
244
+ end
245
+ end
246
+ end
247
+ J750 = IGXLBasedTester::J750
248
+ end