origen_testers 0.13.1 → 0.13.2

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 (258) hide show
  1. checksums.yaml +4 -4
  2. data/config/application.rb +151 -151
  3. data/config/boot.rb +13 -13
  4. data/config/commands.rb +85 -86
  5. data/config/users.rb +18 -18
  6. data/config/version.rb +8 -8
  7. data/lib/commands/build.rb +69 -69
  8. data/lib/commands/run.rb +48 -48
  9. data/lib/origen_testers.rb +47 -47
  10. data/lib/origen_testers/api.rb +381 -381
  11. data/lib/origen_testers/basic_test_setups.rb +105 -105
  12. data/lib/origen_testers/callback_handlers.rb +59 -59
  13. data/lib/origen_testers/command_based_tester.rb +45 -45
  14. data/lib/origen_testers/flow.rb +382 -382
  15. data/lib/origen_testers/generator.rb +283 -283
  16. data/lib/origen_testers/generator/identity_map.rb +23 -23
  17. data/lib/origen_testers/generator/placeholder.rb +11 -11
  18. data/lib/origen_testers/generator/test_numberer.rb +23 -23
  19. data/lib/origen_testers/igxl_based_tester.rb +12 -12
  20. data/lib/origen_testers/igxl_based_tester/base.rb +1100 -1099
  21. data/lib/origen_testers/igxl_based_tester/base/ac_specsets.rb +79 -79
  22. data/lib/origen_testers/igxl_based_tester/base/custom_test_instance.rb +169 -169
  23. data/lib/origen_testers/igxl_based_tester/base/dc_specsets.rb +98 -98
  24. data/lib/origen_testers/igxl_based_tester/base/edge.rb +60 -60
  25. data/lib/origen_testers/igxl_based_tester/base/edges.rb +24 -24
  26. data/lib/origen_testers/igxl_based_tester/base/edgeset.rb +39 -39
  27. data/lib/origen_testers/igxl_based_tester/base/edgesets.rb +130 -130
  28. data/lib/origen_testers/igxl_based_tester/base/flow.rb +460 -460
  29. data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +276 -276
  30. data/lib/origen_testers/igxl_based_tester/base/generator.rb +607 -607
  31. data/lib/origen_testers/igxl_based_tester/base/global_specs.rb +83 -83
  32. data/lib/origen_testers/igxl_based_tester/base/job.rb +75 -75
  33. data/lib/origen_testers/igxl_based_tester/base/jobs.rb +44 -44
  34. data/lib/origen_testers/igxl_based_tester/base/level_io_se.rb +59 -59
  35. data/lib/origen_testers/igxl_based_tester/base/level_supply.rb +39 -39
  36. data/lib/origen_testers/igxl_based_tester/base/levels.rb +31 -31
  37. data/lib/origen_testers/igxl_based_tester/base/levelset.rb +110 -110
  38. data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +109 -109
  39. data/lib/origen_testers/igxl_based_tester/base/patgroups.rb +38 -38
  40. data/lib/origen_testers/igxl_based_tester/base/patset.rb +68 -68
  41. data/lib/origen_testers/igxl_based_tester/base/patset_pattern.rb +56 -56
  42. data/lib/origen_testers/igxl_based_tester/base/patsets.rb +38 -38
  43. data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +68 -68
  44. data/lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb +56 -56
  45. data/lib/origen_testers/igxl_based_tester/base/patsubrs.rb +38 -38
  46. data/lib/origen_testers/igxl_based_tester/base/pinmap.rb +93 -93
  47. data/lib/origen_testers/igxl_based_tester/base/references.rb +25 -25
  48. data/lib/origen_testers/igxl_based_tester/base/test_instance.rb +322 -322
  49. data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +66 -66
  50. data/lib/origen_testers/igxl_based_tester/base/test_instances.rb +212 -212
  51. data/lib/origen_testers/igxl_based_tester/base/test_instances/custom_til.rb +37 -37
  52. data/lib/origen_testers/igxl_based_tester/base/timeset.rb +37 -37
  53. data/lib/origen_testers/igxl_based_tester/base/timesets.rb +49 -49
  54. data/lib/origen_testers/igxl_based_tester/base/timesets_basic.rb +49 -49
  55. data/lib/origen_testers/igxl_based_tester/files.rb +43 -43
  56. data/lib/origen_testers/igxl_based_tester/j750.rb +269 -269
  57. data/lib/origen_testers/igxl_based_tester/j750/custom_test_instance.rb +32 -32
  58. data/lib/origen_testers/igxl_based_tester/j750/flow.rb +10 -10
  59. data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +19 -19
  60. data/lib/origen_testers/igxl_based_tester/j750/generator.rb +19 -19
  61. data/lib/origen_testers/igxl_based_tester/j750/patgroup.rb +9 -9
  62. data/lib/origen_testers/igxl_based_tester/j750/patgroups.rb +10 -10
  63. data/lib/origen_testers/igxl_based_tester/j750/patset.rb +9 -9
  64. data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +18 -18
  65. data/lib/origen_testers/igxl_based_tester/j750/patsets.rb +10 -10
  66. data/lib/origen_testers/igxl_based_tester/j750/patsubr.rb +9 -9
  67. data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +18 -18
  68. data/lib/origen_testers/igxl_based_tester/j750/patsubrs.rb +10 -10
  69. data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +746 -746
  70. data/lib/origen_testers/igxl_based_tester/j750/test_instance_group.rb +9 -9
  71. data/lib/origen_testers/igxl_based_tester/j750/test_instances.rb +10 -10
  72. data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +34 -34
  73. data/lib/origen_testers/igxl_based_tester/j750_hpt/custom_test_instance.rb +32 -32
  74. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow.rb +9 -9
  75. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow_line.rb +9 -9
  76. data/lib/origen_testers/igxl_based_tester/j750_hpt/generator.rb +19 -19
  77. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroup.rb +9 -9
  78. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroups.rb +9 -9
  79. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset.rb +9 -9
  80. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset_pattern.rb +9 -9
  81. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsets.rb +9 -9
  82. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr.rb +9 -9
  83. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr_pattern.rb +9 -9
  84. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubrs.rb +9 -9
  85. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +599 -599
  86. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance_group.rb +9 -9
  87. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instances.rb +9 -9
  88. data/lib/origen_testers/igxl_based_tester/parser.rb +102 -102
  89. data/lib/origen_testers/igxl_based_tester/parser/ac_spec.rb +9 -9
  90. data/lib/origen_testers/igxl_based_tester/parser/dc_spec.rb +33 -33
  91. data/lib/origen_testers/igxl_based_tester/parser/dc_specs.rb +48 -48
  92. data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +339 -339
  93. data/lib/origen_testers/igxl_based_tester/parser/flow.rb +109 -109
  94. data/lib/origen_testers/igxl_based_tester/parser/flow_line.rb +203 -203
  95. data/lib/origen_testers/igxl_based_tester/parser/flows.rb +21 -21
  96. data/lib/origen_testers/igxl_based_tester/parser/pattern_set.rb +92 -92
  97. data/lib/origen_testers/igxl_based_tester/parser/pattern_sets.rb +31 -31
  98. data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +420 -420
  99. data/lib/origen_testers/igxl_based_tester/parser/test_instances.rb +24 -24
  100. data/lib/origen_testers/igxl_based_tester/parser/timeset.rb +13 -13
  101. data/lib/origen_testers/igxl_based_tester/ultraflex.rb +798 -798
  102. data/lib/origen_testers/igxl_based_tester/ultraflex/ac_specsets.rb +10 -10
  103. data/lib/origen_testers/igxl_based_tester/ultraflex/ate_hardware.rb +949 -949
  104. data/lib/origen_testers/igxl_based_tester/ultraflex/custom_test_instance.rb +36 -36
  105. data/lib/origen_testers/igxl_based_tester/ultraflex/dc_specsets.rb +10 -10
  106. data/lib/origen_testers/igxl_based_tester/ultraflex/edge.rb +9 -9
  107. data/lib/origen_testers/igxl_based_tester/ultraflex/edges.rb +9 -9
  108. data/lib/origen_testers/igxl_based_tester/ultraflex/edgeset.rb +9 -9
  109. data/lib/origen_testers/igxl_based_tester/ultraflex/edgesets.rb +10 -10
  110. data/lib/origen_testers/igxl_based_tester/ultraflex/flow.rb +158 -158
  111. data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +19 -19
  112. data/lib/origen_testers/igxl_based_tester/ultraflex/generator.rb +19 -19
  113. data/lib/origen_testers/igxl_based_tester/ultraflex/global_specs.rb +10 -10
  114. data/lib/origen_testers/igxl_based_tester/ultraflex/job.rb +9 -9
  115. data/lib/origen_testers/igxl_based_tester/ultraflex/jobs.rb +10 -10
  116. data/lib/origen_testers/igxl_based_tester/ultraflex/level_io_se.rb +9 -9
  117. data/lib/origen_testers/igxl_based_tester/ultraflex/level_supply.rb +9 -9
  118. data/lib/origen_testers/igxl_based_tester/ultraflex/levels.rb +9 -9
  119. data/lib/origen_testers/igxl_based_tester/ultraflex/levelset.rb +10 -10
  120. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroup.rb +9 -9
  121. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroups.rb +10 -10
  122. data/lib/origen_testers/igxl_based_tester/ultraflex/patset.rb +9 -9
  123. data/lib/origen_testers/igxl_based_tester/ultraflex/patset_pattern.rb +18 -18
  124. data/lib/origen_testers/igxl_based_tester/ultraflex/patsets.rb +10 -10
  125. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr.rb +9 -9
  126. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +18 -18
  127. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubrs.rb +10 -10
  128. data/lib/origen_testers/igxl_based_tester/ultraflex/pinmap.rb +10 -10
  129. data/lib/origen_testers/igxl_based_tester/ultraflex/references.rb +10 -10
  130. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/ac_specsets.txt.erb +0 -0
  131. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/dc_specsets.txt.erb +0 -0
  132. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/edgesets.txt.erb +0 -0
  133. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/global_specs.txt.erb +0 -0
  134. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/jobs.txt.erb +0 -0
  135. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/levelset.txt.erb +0 -0
  136. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/pinmap.txt.erb +0 -0
  137. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/references.txt.erb +0 -0
  138. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/timesets.txt.erb +0 -0
  139. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/timesets_basic.txt.erb +0 -0
  140. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance.rb +315 -315
  141. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance_group.rb +9 -9
  142. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instances.rb +10 -10
  143. data/lib/origen_testers/igxl_based_tester/ultraflex/timeset.rb +9 -9
  144. data/lib/origen_testers/igxl_based_tester/ultraflex/timesets.rb +10 -10
  145. data/lib/origen_testers/igxl_based_tester/ultraflex/timesets_basic.rb +10 -10
  146. data/lib/origen_testers/interface.rb +345 -324
  147. data/lib/origen_testers/memory_style.rb +77 -77
  148. data/lib/origen_testers/no_interface.rb +7 -7
  149. data/lib/origen_testers/origen_ext/application/runner.rb +25 -25
  150. data/lib/origen_testers/origen_ext/generator.rb +54 -54
  151. data/lib/origen_testers/origen_ext/generator/flow.rb +91 -77
  152. data/lib/origen_testers/origen_ext/generator/resources.rb +21 -21
  153. data/lib/origen_testers/origen_ext/pins/pin.rb +78 -78
  154. data/lib/origen_testers/origen_ext/pins/pin_collection.rb +84 -84
  155. data/lib/origen_testers/parser.rb +22 -22
  156. data/lib/origen_testers/parser/description_lookup.rb +62 -62
  157. data/lib/origen_testers/parser/searchable_array.rb +30 -30
  158. data/lib/origen_testers/parser/searchable_hash.rb +30 -30
  159. data/lib/origen_testers/pattern_compilers.rb +116 -116
  160. data/lib/origen_testers/pattern_compilers/assembler.rb +88 -88
  161. data/lib/origen_testers/pattern_compilers/job.rb +96 -96
  162. data/lib/origen_testers/pattern_compilers/ultraflex_pattern_compiler.rb +599 -599
  163. data/lib/origen_testers/program_generators.rb +62 -62
  164. data/lib/origen_testers/smartest_based_tester.rb +8 -8
  165. data/lib/origen_testers/smartest_based_tester/base.rb +576 -567
  166. data/lib/origen_testers/smartest_based_tester/base/flow.rb +296 -291
  167. data/lib/origen_testers/smartest_based_tester/base/generator.rb +207 -194
  168. data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +32 -32
  169. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +69 -69
  170. data/lib/origen_testers/smartest_based_tester/base/processors.rb +16 -16
  171. data/lib/origen_testers/smartest_based_tester/base/processors/adjacent_if_combiner.rb +106 -106
  172. data/lib/origen_testers/smartest_based_tester/base/processors/continue_implementer.rb +39 -39
  173. data/lib/origen_testers/smartest_based_tester/base/processors/empty_branch_cleaner.rb +21 -21
  174. data/lib/origen_testers/smartest_based_tester/base/processors/extract_run_flag_table.rb +33 -33
  175. data/lib/origen_testers/smartest_based_tester/base/processors/extract_set_variables.rb +22 -22
  176. data/lib/origen_testers/smartest_based_tester/base/processors/flag_optimizer.rb +188 -188
  177. data/lib/origen_testers/smartest_based_tester/base/processors/if_ran_cleaner.rb +34 -34
  178. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +178 -164
  179. data/lib/origen_testers/smartest_based_tester/base/test_methods.rb +77 -73
  180. data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +33 -33
  181. data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +38 -38
  182. data/lib/origen_testers/smartest_based_tester/base/test_methods/custom_tml.rb +19 -19
  183. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +147 -147
  184. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +65 -65
  185. data/lib/origen_testers/smartest_based_tester/base/test_suite.rb +208 -193
  186. data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +58 -54
  187. data/lib/origen_testers/smartest_based_tester/base/variables_file.rb +38 -38
  188. data/lib/origen_testers/smartest_based_tester/v93k.rb +8 -8
  189. data/lib/origen_testers/smartest_based_tester/v93k/builder.rb +89 -89
  190. data/lib/origen_testers/smartest_based_tester/v93k/builder/flow.rb +181 -181
  191. data/lib/origen_testers/smartest_based_tester/v93k/builder/pattern_master.rb +54 -54
  192. data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +10 -10
  193. data/lib/origen_testers/smartest_based_tester/v93k/generator.rb +19 -19
  194. data/lib/origen_testers/smartest_based_tester/v93k/pattern_compiler.rb +10 -10
  195. data/lib/origen_testers/smartest_based_tester/v93k/pattern_master.rb +10 -10
  196. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.aiv.erb +17 -17
  197. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.pmfl.erb +13 -13
  198. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.tf.erb +236 -214
  199. data/lib/origen_testers/smartest_based_tester/v93k/templates/vars.tf.erb +48 -48
  200. data/lib/origen_testers/smartest_based_tester/v93k/test_method.rb +9 -9
  201. data/lib/origen_testers/smartest_based_tester/v93k/test_methods.rb +9 -9
  202. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +9 -9
  203. data/lib/origen_testers/smartest_based_tester/v93k/test_suites.rb +9 -9
  204. data/lib/origen_testers/smartest_based_tester/v93k/variables_file.rb +10 -10
  205. data/lib/origen_testers/test/basic_interface.rb +17 -17
  206. data/lib/origen_testers/test/block.rb +21 -21
  207. data/lib/origen_testers/test/custom_test_interface.rb +111 -111
  208. data/lib/origen_testers/test/dut.rb +295 -295
  209. data/lib/origen_testers/test/dut2.rb +76 -76
  210. data/lib/origen_testers/test/dut3.rb +244 -244
  211. data/lib/origen_testers/test/interface.rb +503 -503
  212. data/lib/origen_testers/test/nvm.rb +94 -94
  213. data/lib/origen_testers/timing.rb +368 -368
  214. data/lib/origen_testers/vector.rb +207 -207
  215. data/lib/origen_testers/vector_based_tester.rb +41 -41
  216. data/lib/origen_testers/vector_generator.rb +655 -655
  217. data/lib/origen_testers/vector_pipeline.rb +302 -302
  218. data/pattern/bitmap.rb +7 -7
  219. data/pattern/dc_instr.rb +7 -7
  220. data/pattern/delay.rb +7 -7
  221. data/pattern/freq_counter.rb +6 -6
  222. data/pattern/mem_test.rb +8 -8
  223. data/pattern/multi_vector.rb +122 -122
  224. data/pattern/multi_vector_plus1.rb +125 -125
  225. data/pattern/nvm/j750/add_late_pins.rb +3 -3
  226. data/pattern/nvm/j750/iterator_postfix_test_x_bx.rb +8 -8
  227. data/pattern/nvm/j750/iterator_test_x_bx.rb +8 -8
  228. data/pattern/nvm/j750/j750_halt.rb +159 -159
  229. data/pattern/nvm/j750/j750_workout.rb +209 -209
  230. data/pattern/nvm/j750/timing.rb +73 -73
  231. data/pattern/read_write_reg.rb +61 -61
  232. data/pattern/reset.rb +4 -4
  233. data/pattern/subroutines.rb +69 -69
  234. data/pattern/tester_overlay.rb +61 -52
  235. data/pattern/tester_store.rb +28 -28
  236. data/program/_additional_erase.rb +7 -7
  237. data/program/_efa_resources.rb +7 -7
  238. data/program/_erase.rb +25 -25
  239. data/program/_erase_vfy.rb +5 -5
  240. data/program/_iv_resources.rb +10 -10
  241. data/program/basic_interface.rb +5 -5
  242. data/program/components/_prb1_main.rb +222 -222
  243. data/program/components/_temp.rb +6 -6
  244. data/program/custom_tests.rb +10 -10
  245. data/program/flow_control.rb +422 -422
  246. data/program/prb1.rb +11 -11
  247. data/program/prb1_resources.rb +28 -28
  248. data/program/prb2.rb +27 -27
  249. data/program/test.rb +29 -29
  250. data/program/uflex_resources.rb +199 -199
  251. data/templates/example.txt.erb +53 -53
  252. data/templates/j750/program_sheet.txt.erb +9 -9
  253. data/templates/manifest/v93k.yaml.erb +22 -22
  254. data/templates/web/index.md.erb +51 -51
  255. data/templates/web/layouts/_basic.html.erb +15 -15
  256. data/templates/web/partials/_navbar.html.erb +22 -22
  257. data/templates/web/release_notes.md.erb +5 -5
  258. metadata +2 -2
data/config/users.rb CHANGED
@@ -1,18 +1,18 @@
1
- # This file defines the users associated with your project, it is basically the
2
- # mailing list for release notes.
3
- #
4
- # You can split your users into "admin" and "user" groups, the main difference
5
- # between the two is that admin users will get all tag emails, users will get
6
- # emails on external/official releases only.
7
- #
8
- # Users are also prohibited from running the "origen tag" task, but this is
9
- # really just to prevent a casual user from executing it inadvertently and is
10
- # not intended to be a serious security gate.
11
- module Origen
12
- module Users
13
- def users
14
- @users ||= [
15
- ]
16
- end
17
- end
18
- end
1
+ # This file defines the users associated with your project, it is basically the
2
+ # mailing list for release notes.
3
+ #
4
+ # You can split your users into "admin" and "user" groups, the main difference
5
+ # between the two is that admin users will get all tag emails, users will get
6
+ # emails on external/official releases only.
7
+ #
8
+ # Users are also prohibited from running the "origen tag" task, but this is
9
+ # really just to prevent a casual user from executing it inadvertently and is
10
+ # not intended to be a serious security gate.
11
+ module Origen
12
+ module Users
13
+ def users
14
+ @users ||= [
15
+ ]
16
+ end
17
+ end
18
+ end
data/config/version.rb CHANGED
@@ -1,8 +1,8 @@
1
- module OrigenTesters
2
- MAJOR = 0
3
- MINOR = 13
4
- BUGFIX = 1
5
- DEV = nil
6
-
7
- VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
- end
1
+ module OrigenTesters
2
+ MAJOR = 0
3
+ MINOR = 13
4
+ BUGFIX = 2
5
+ DEV = nil
6
+
7
+ VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
+ end
@@ -1,69 +1,69 @@
1
- require 'optparse'
2
- require 'pathname'
3
-
4
- options = {}
5
-
6
- opt_parser = OptionParser.new do |opts|
7
- opts.banner = <<-EOT
8
- Build a test program from a collection of sub-programs.
9
-
10
- The user must supply a manifest file to define the test program's flows. Each flow definition will state
11
- which sub-program modules that the flow is comprised of, and the order in which they should be executed.
12
- The manifest file is written in YAML format and a new manifest file can be generated for the current target
13
- tester by running the command with the --new option.
14
-
15
- Upon launch the command will parse all of the sub-program files into memory. It will then combine and render
16
- them out to new files, making edits on the fly where necessary to enable the sub-programs to co-exist within
17
- the same test program.
18
- The generated files can be tracked and diff-checked by Origen in the usual way.
19
-
20
- Usage: origen testers:build MANIFEST [options]
21
- EOT
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
- 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 }
26
- opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
27
- opts.on('-n', '--new', 'Generate a new manifest file for the current tester platform') { options[:new] = true }
28
- opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
29
- opts.on('-r', '--reference DIR', String, 'Override the default reference directory') { |o| options[:reference] = o }
30
- opts.separator ''
31
- opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
32
- end
33
-
34
- opt_parser.parse! ARGV
35
-
36
- Origen.load_application
37
- Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
38
- Origen.environment.temporary = options[:environment] if options[:environment]
39
- Origen.target.temporary = options[:target] if options[:target]
40
- Origen.app.load_target!
41
-
42
- manifest = ARGV.first
43
-
44
- unless manifest
45
- puts 'You must supply a path to a manifest file'
46
- exit 1
47
- end
48
- unless $tester.v93k?
49
- puts "Sorry but the #{$tester.name} tester is not yet supported by the build command :-("
50
- exit 1
51
- end
52
-
53
- if options[:new]
54
- template = "#{Origen.root!}/templates/manifest/#{$tester.name}.yaml.erb"
55
- manifest += '.yaml' unless manifest =~ /\..*/
56
-
57
- Origen.app.runner.launch action: :compile,
58
- files: template,
59
- output: Pathname.new(manifest).dirname.to_s,
60
- output_file_name: Pathname.new(manifest).basename.to_s,
61
- quiet: true,
62
- check_for_changes: false
63
-
64
- puts "New #{$tester.name} manifest created: #{manifest}"
65
- exit 0
66
- end
67
-
68
- # Ideally should auto select the correct test platform here, for now hardcoding to V93K
69
- eval("#{$tester.class}::Builder").new.build(manifest, options)
1
+ require 'optparse'
2
+ require 'pathname'
3
+
4
+ options = {}
5
+
6
+ opt_parser = OptionParser.new do |opts|
7
+ opts.banner = <<-EOT
8
+ Build a test program from a collection of sub-programs.
9
+
10
+ The user must supply a manifest file to define the test program's flows. Each flow definition will state
11
+ which sub-program modules that the flow is comprised of, and the order in which they should be executed.
12
+ The manifest file is written in YAML format and a new manifest file can be generated for the current target
13
+ tester by running the command with the --new option.
14
+
15
+ Upon launch the command will parse all of the sub-program files into memory. It will then combine and render
16
+ them out to new files, making edits on the fly where necessary to enable the sub-programs to co-exist within
17
+ the same test program.
18
+ The generated files can be tracked and diff-checked by Origen in the usual way.
19
+
20
+ Usage: origen testers:build MANIFEST [options]
21
+ EOT
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
+ 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 }
26
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
27
+ opts.on('-n', '--new', 'Generate a new manifest file for the current tester platform') { options[:new] = true }
28
+ opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
29
+ opts.on('-r', '--reference DIR', String, 'Override the default reference directory') { |o| options[:reference] = o }
30
+ opts.separator ''
31
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
32
+ end
33
+
34
+ opt_parser.parse! ARGV
35
+
36
+ Origen.load_application
37
+ Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
38
+ Origen.environment.temporary = options[:environment] if options[:environment]
39
+ Origen.target.temporary = options[:target] if options[:target]
40
+ Origen.app.load_target!
41
+
42
+ manifest = ARGV.first
43
+
44
+ unless manifest
45
+ puts 'You must supply a path to a manifest file'
46
+ exit 1
47
+ end
48
+ unless $tester.v93k?
49
+ puts "Sorry but the #{$tester.name} tester is not yet supported by the build command :-("
50
+ exit 1
51
+ end
52
+
53
+ if options[:new]
54
+ template = "#{Origen.root!}/templates/manifest/#{$tester.name}.yaml.erb"
55
+ manifest += '.yaml' unless manifest =~ /\..*/
56
+
57
+ Origen.app.runner.launch action: :compile,
58
+ files: template,
59
+ output: Pathname.new(manifest).dirname.to_s,
60
+ output_file_name: Pathname.new(manifest).basename.to_s,
61
+ quiet: true,
62
+ check_for_changes: false
63
+
64
+ puts "New #{$tester.name} manifest created: #{manifest}"
65
+ exit 0
66
+ end
67
+
68
+ # Ideally should auto select the correct test platform here, for now hardcoding to V93K
69
+ eval("#{$tester.class}::Builder").new.build(manifest, options)
data/lib/commands/run.rb CHANGED
@@ -1,48 +1,48 @@
1
- require 'optparse'
2
- require 'pathname'
3
-
4
- options = {}
5
-
6
- opt_parser = OptionParser.new do |opts|
7
- opts.banner = <<-EOT
8
- Run (execute a flow) of the last test program generated for the given target.
9
-
10
- Usage: origen testers:run FLOW [options]
11
- EOT
12
- opts.on('--enable FLAG,FLAG', Array, 'Comma-separated list of flow flags to enable') { |flags| options[:flow_flags] = flags }
13
- opts.on('--job NAME', String, 'Job name to enable') { |job| options[:job] = job }
14
- opts.on('--fail ID,ID', Array, 'Comma-separated list of test IDs to fail') { |ids| options[:failed_test_ids] = ids }
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
- 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 }
18
- opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
19
- opts.separator ''
20
- opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
21
- end
22
-
23
- opt_parser.parse! ARGV
24
-
25
- Origen.environment.temporary = options[:environment] if options[:environment]
26
- Origen.target.temporary = options[:target] if options[:target]
27
- # Origen.app.load_target!
28
-
29
- program = OrigenTesters.program
30
-
31
- unless program
32
- puts 'Sorry, but there is no program model available for the current target, generate the program then retry'
33
- exit 1
34
- end
35
-
36
- unless ARGV.first
37
- if OrigenTesters.program.flows.keys.size == 1
38
- ARGV << OrigenTesters.program.flows.keys.first
39
- else
40
- puts 'You must supply the name of the flow to execute, the current program has these flows'
41
- puts OrigenTesters.program.flows.keys
42
- exit 1
43
- end
44
- end
45
-
46
- ARGV.each do |flow|
47
- OrigenTesters.program.flows[flow.to_sym].run(options)
48
- end
1
+ require 'optparse'
2
+ require 'pathname'
3
+
4
+ options = {}
5
+
6
+ opt_parser = OptionParser.new do |opts|
7
+ opts.banner = <<-EOT
8
+ Run (execute a flow) of the last test program generated for the given target.
9
+
10
+ Usage: origen testers:run FLOW [options]
11
+ EOT
12
+ opts.on('--enable FLAG,FLAG', Array, 'Comma-separated list of flow flags to enable') { |flags| options[:flow_flags] = flags }
13
+ opts.on('--job NAME', String, 'Job name to enable') { |job| options[:job] = job }
14
+ opts.on('--fail ID,ID', Array, 'Comma-separated list of test IDs to fail') { |ids| options[:failed_test_ids] = ids }
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
+ 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 }
18
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
19
+ opts.separator ''
20
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
21
+ end
22
+
23
+ opt_parser.parse! ARGV
24
+
25
+ Origen.environment.temporary = options[:environment] if options[:environment]
26
+ Origen.target.temporary = options[:target] if options[:target]
27
+ # Origen.app.load_target!
28
+
29
+ program = OrigenTesters.program
30
+
31
+ unless program
32
+ puts 'Sorry, but there is no program model available for the current target, generate the program then retry'
33
+ exit 1
34
+ end
35
+
36
+ unless ARGV.first
37
+ if OrigenTesters.program.flows.keys.size == 1
38
+ ARGV << OrigenTesters.program.flows.keys.first
39
+ else
40
+ puts 'You must supply the name of the flow to execute, the current program has these flows'
41
+ puts OrigenTesters.program.flows.keys
42
+ exit 1
43
+ end
44
+ end
45
+
46
+ ARGV.each do |flow|
47
+ OrigenTesters.program.flows[flow.to_sym].run(options)
48
+ end
@@ -1,47 +1,47 @@
1
- require 'origen'
2
- require_relative '../config/application.rb'
3
-
4
- require 'active_support/concern'
5
- require 'require_all'
6
- require 'atp'
7
- require 'origen_testers/origen_ext/generator/flow'
8
- require 'origen_testers/origen_ext/generator/resources'
9
- require 'origen_testers/origen_ext/application/runner'
10
- require 'origen_testers/origen_ext/generator'
11
-
12
- module OrigenTesters
13
- autoload :CommandBasedTester, 'origen_testers/command_based_tester'
14
- autoload :VectorBasedTester, 'origen_testers/vector_based_tester'
15
- autoload :Vector, 'origen_testers/vector'
16
- autoload :VectorPipeline, 'origen_testers/vector_pipeline'
17
- autoload :Interface, 'origen_testers/interface'
18
- autoload :Generator, 'origen_testers/generator'
19
- autoload :Parser, 'origen_testers/parser'
20
- autoload :BasicTestSetups, 'origen_testers/basic_test_setups'
21
- autoload :ProgramGenerators, 'origen_testers/program_generators'
22
- autoload :Flow, 'origen_testers/flow'
23
- autoload :NoInterface, 'origen_testers/no_interface'
24
- autoload :MemoryStyle, 'origen_testers/memory_style'
25
-
26
- # not yet autoload :Time, 'origen_testers/time'
27
-
28
- # The documentation tester model has been removed, but this keeps some
29
- # legacy code working e.g. $tester.is_a?(OrigenTesters::Doc)
30
- class Doc
31
- end
32
-
33
- def self.program
34
- f = "#{Flow::PROGRAM_MODELS_DIR}/#{Origen.target.name}"
35
- if File.exist?(f)
36
- ATP::Program.load(f)
37
- end
38
- end
39
- end
40
-
41
- require 'origen_testers/igxl_based_tester'
42
- require 'origen_testers/smartest_based_tester'
43
- require 'origen_testers/pattern_compilers'
44
-
45
- require 'origen_testers/callback_handlers'
46
- require 'origen_testers/origen_ext/pins/pin'
47
- require 'origen_testers/origen_ext/pins/pin_collection'
1
+ require 'origen'
2
+ require_relative '../config/application.rb'
3
+
4
+ require 'active_support/concern'
5
+ require 'require_all'
6
+ require 'atp'
7
+ require 'origen_testers/origen_ext/generator/flow'
8
+ require 'origen_testers/origen_ext/generator/resources'
9
+ require 'origen_testers/origen_ext/application/runner'
10
+ require 'origen_testers/origen_ext/generator'
11
+
12
+ module OrigenTesters
13
+ autoload :CommandBasedTester, 'origen_testers/command_based_tester'
14
+ autoload :VectorBasedTester, 'origen_testers/vector_based_tester'
15
+ autoload :Vector, 'origen_testers/vector'
16
+ autoload :VectorPipeline, 'origen_testers/vector_pipeline'
17
+ autoload :Interface, 'origen_testers/interface'
18
+ autoload :Generator, 'origen_testers/generator'
19
+ autoload :Parser, 'origen_testers/parser'
20
+ autoload :BasicTestSetups, 'origen_testers/basic_test_setups'
21
+ autoload :ProgramGenerators, 'origen_testers/program_generators'
22
+ autoload :Flow, 'origen_testers/flow'
23
+ autoload :NoInterface, 'origen_testers/no_interface'
24
+ autoload :MemoryStyle, 'origen_testers/memory_style'
25
+
26
+ # not yet autoload :Time, 'origen_testers/time'
27
+
28
+ # The documentation tester model has been removed, but this keeps some
29
+ # legacy code working e.g. $tester.is_a?(OrigenTesters::Doc)
30
+ class Doc
31
+ end
32
+
33
+ def self.program
34
+ f = "#{Flow::PROGRAM_MODELS_DIR}/#{Origen.target.name}"
35
+ if File.exist?(f)
36
+ ATP::Program.load(f)
37
+ end
38
+ end
39
+ end
40
+
41
+ require 'origen_testers/igxl_based_tester'
42
+ require 'origen_testers/smartest_based_tester'
43
+ require 'origen_testers/pattern_compilers'
44
+
45
+ require 'origen_testers/callback_handlers'
46
+ require 'origen_testers/origen_ext/pins/pin'
47
+ require 'origen_testers/origen_ext/pins/pin_collection'
@@ -1,381 +1,381 @@
1
- module OrigenTesters
2
- # This module implements the basic set of methods that a tester must have
3
- # in order for Origen to talk to it.
4
- #
5
- # They can be overridden by tester specific classes and who may go on to add
6
- # additional methods of their own.
7
- #
8
- # Essentially this API means that any class that includes Origen::Tester will
9
- # function as a tester, although it might not do very much!
10
- module API
11
- attr_accessor :includes
12
- attr_accessor :comment_level
13
- attr_accessor :generating
14
- # Get/Set the overlay style
15
- #
16
- # This method changes the way overlay is handled.
17
- # The default value and possible settings is dependent on the individual tester.
18
- #
19
- # @example
20
- # tester.overlay_style = :label
21
- attr_accessor :overlay_style
22
- # Get/Set the capture style
23
- #
24
- # This method changes the way tester.store() implements the store
25
- # The default value and possible settings is dependent on the individual tester.
26
- #
27
- # @example
28
- # tester.capture_style = :hram
29
- attr_accessor :capture_style
30
-
31
- def name
32
- @name || self.class
33
- end
34
-
35
- def generate?
36
- true
37
- end
38
-
39
- def generating_pattern?
40
- @generating == :pattern
41
- end
42
-
43
- def generating_program?
44
- @generating == :program
45
- end
46
-
47
- def pat_extension
48
- @pat_extension || 'txt'
49
- end
50
- alias_method :pattern_extension, :pat_extension
51
-
52
- def comment_char
53
- @comment_char || '//'
54
- end
55
-
56
- def program_comment_char
57
- @program_comment_char || comment_char
58
- end
59
-
60
- def pattern_header(*args)
61
- end
62
-
63
- def pattern_footer(*args)
64
- end
65
-
66
- def step_comment_prefix
67
- @step_comment_prefix || '##'
68
- end
69
-
70
- def is_vector_based?
71
- return @vector_based if defined?(@vector_based)
72
- true
73
- end
74
-
75
- def is_command_based?
76
- !is_vector_based?
77
- end
78
-
79
- def stil?
80
- defined?(OrigenTesters::StilBasedTester::Base) &&
81
- is_a?(OrigenTesters::StilBasedTester::Base)
82
- end
83
-
84
- def j750?
85
- is_a?(OrigenTesters::IGXLBasedTester::J750)
86
- end
87
-
88
- def j750_hpt?
89
- is_a?(OrigenTesters::IGXLBasedTester::J750_HPT)
90
- end
91
-
92
- def v93k?
93
- is_a?(OrigenTesters::SmartestBasedTester::V93K)
94
- end
95
-
96
- def ultraflex?
97
- is_a?(OrigenTesters::IGXLBasedTester::UltraFLEX)
98
- end
99
- alias_method :uflex?, :ultraflex?
100
-
101
- def link?
102
- !!(self.class.to_s =~ /^OrigenLink::/)
103
- end
104
-
105
- def doc?
106
- false
107
- end
108
-
109
- def annotate(msg, options = {})
110
- end
111
-
112
- def diff_friendly_output=(value)
113
- @diff_friendly_output = value
114
- end
115
-
116
- def diff_friendly_output?
117
- !!@diff_friendly_output
118
- end
119
- alias_method :diff_friendly_output, :diff_friendly_output?
120
-
121
- # Ignore fails on the given pins for the duration of the given block, this
122
- # has the effect of temporarily setting the states of the given pins to
123
- # don't care.
124
- def ignore_fails(*pins)
125
- pins.each(&:suspend)
126
- yield
127
- pins.each(&:resume)
128
- end
129
-
130
- # Output a comment in the pattern, normally you would not call this directly
131
- # and instead use these shorthand methods:
132
- # cc "Some comment"
133
- # ss "A single line step comment"
134
- # step_comment do
135
- # cc "A multi line"
136
- # cc "step comment"
137
- # end
138
- def c1(msg, options = {})
139
- prefix = comment_char + ' '
140
- prefix += step_comment_prefix + ' ' if @step_comment_on
141
- push_comment(prefix + msg.to_s)
142
- end
143
-
144
- def c2(msg, options = {})
145
- c1(msg, options)
146
- end
147
-
148
- def pattern_section(msg)
149
- if generating_program?
150
- yield
151
- else
152
- step_comment(msg)
153
- yield
154
- end
155
- end
156
-
157
- def ss(msg = nil)
158
- div = step_comment_prefix.length
159
- div = 1 if div == 0
160
- c1(step_comment_prefix * (70 / div))
161
- @step_comment_on = true
162
- if block_given?
163
- yield
164
- else
165
- c1(msg)
166
- end
167
- @step_comment_on = false
168
- if $_testers_enable_vector_comments
169
- timestamp = " #{execution_time_in_ns}ns #{step_comment_prefix}"
170
- str = step_comment_prefix * (70 / div)
171
- c1 str.sub(/#{step_comment_prefix}{#{timestamp.length - 1}}$/, timestamp)
172
- else
173
- c1(step_comment_prefix * (70 / div))
174
- end
175
- end
176
-
177
- def snip(number, options = {})
178
- yield
179
- end
180
-
181
- # Allows a section to be run without actually generating any vectors. This can be useful
182
- # to ensure the pin states end up as they otherwise would have if the section had been run.
183
- # Classic example of this is a subroutine pattern, wrap this around a call to the startup
184
- # routine to ensure the pin states are as they would have been immediately after the startup.
185
- # ==== Example
186
- # # Setup state as if I had run startup without actually doing so
187
- # $tester.inhibit_vectors_and_comments do
188
- # $soc.startup
189
- # $top.startup
190
- # end
191
- def inhibit_vectors_and_comments
192
- inhibit_vectors = @inhibit_vectors
193
- inhibit_comments = @inhibit_comments
194
- @inhibit_vectors = true
195
- @inhibit_comments = true
196
- yield
197
- @inhibit_vectors = inhibit_vectors # Restore to their initial state
198
- @inhibit_comments = inhibit_comments
199
- end
200
-
201
- # Generate a vector.
202
- # Calling this method will generate a vector in the output pattern based on the
203
- # current pin states and timeset.
204
- def cycle(options = {})
205
- options = {
206
- microcode: '',
207
- timeset: current_timeset,
208
- pin_vals: current_pin_vals,
209
- repeat: nil
210
- }.merge(options)
211
-
212
- if any_clocks_running?
213
- update_running_clocks
214
- if options[:repeat]
215
- slice_repeats(options).each do |slice|
216
- options[:repeat] = slice[0]
217
- delay(options.delete(:repeat), options) do |options|
218
- push_vector(options)
219
- end
220
- slice[1].each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
221
- options[:pin_vals] = current_pin_vals
222
- end
223
- pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
224
- else
225
- push_vector(options)
226
- pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
227
- end
228
- else
229
- if options[:repeat]
230
- delay(options.delete(:repeat), options) do |options|
231
- push_vector(options)
232
- end
233
- else
234
- push_vector(options)
235
- end
236
- end
237
- end
238
-
239
- def import_test_time(file, options = {})
240
- puts "Sorry but an importer doesn't exist for: #{Origen.tester.class}"
241
- end
242
-
243
- def any_clocks_running?
244
- @clocks_running.nil? ? false : @clocks_running.count > 0
245
- end
246
-
247
- def clocks_running
248
- @clocks_running
249
- end
250
- alias_method :running_clocks, :clocks_running
251
-
252
- def push_running_clock(pin)
253
- @clocks_running.nil? ? @clocks_running = { pin.name.to_s => pin } : @clocks_running[pin.name.to_s] = pin
254
- end
255
-
256
- def pop_running_clock(pin)
257
- fail "ERROR: No clocks running, doesn't make sense to pop one" unless any_clocks_running?
258
- @clocks_running.delete(pin.name.to_s)
259
- end
260
-
261
- def slice_repeats(options = {})
262
- slices = {}
263
- repeat_ary = []
264
- clocks_running.each do |name, clock_pin|
265
- if clock_pin.next_edge < (cycle_count + options[:repeat])
266
- if clock_pin.respond_to?(:duty_cycles)
267
- d0, d1 = clock_pin.duty_cycles
268
- else
269
- # keep legacy support for older pin_clock styling, supports only 50% duty-cycle
270
- d0 = clock_pin.half_period
271
- d1 = clock_pin.half_period
272
- end
273
- pin_slices = (clock_pin.next_edge..(cycle_count + options[:repeat])).step(d0 + d1).to_a
274
- pin_slices += ((clock_pin.next_edge + d0)..(cycle_count + options[:repeat])).step(d0 + d1).to_a
275
- pin_slices.sort!
276
- pin_slices.insert(0, cycle_count)
277
- else
278
- pin_slices = [cycle_count]
279
- end
280
- pin_slices.each do |cycle|
281
- slices[cycle].nil? ? slices[cycle] = name : slices[cycle] = "#{slices[cycle]},#{name}"
282
- end
283
- slices[cycle_count + options[:repeat]] = '' if pin_slices[-1] != cycle_count + options[:repeat]
284
- end
285
- slices.keys.sort.each do |edge_cycles|
286
- # puts "Toggle #{slices[edge_cycles]} on #{edge_cycles}"
287
- repeat_ary.push([edge_cycles, slices[edge_cycles].split(',')])
288
- end
289
-
290
- (repeat_ary.count - 1).downto(1).each { |i| repeat_ary[i][0] = repeat_ary[i][0] - repeat_ary[i - 1][0] }
291
- repeat_ary[1..-1]
292
- end
293
-
294
- def pins_need_toggling
295
- toggle_ary = []
296
- clocks_running.each do |name, clock_pin|
297
- toggle_ary.push("#{name}") if clock_pin.next_edge == cycle_count
298
- end
299
- toggle_ary
300
- end
301
-
302
- def update_running_clocks
303
- clocks_running.each do |name, clock_pin|
304
- clock_pin.update_clock
305
- end
306
- end
307
-
308
- def transaction
309
- yield
310
- true
311
- end
312
-
313
- def source_memory_config
314
- @source_memory_config ||= {}
315
- end
316
-
317
- def capture_memory_config
318
- @capture_memory_config ||= {}
319
- end
320
-
321
- # Configure source memory to a non-default setting
322
- #
323
- # This method changes the way the instruments statement gets rendered
324
- # if the tester's source memory is used.
325
- #
326
- # @example
327
- # tester.source_memory :default do |mem|
328
- # mem.pin :tdi, size: 32, format: :long
329
- # end
330
- #
331
- # If called without a block, this method will return
332
- # the instance of type OrigenTesters::MemoryStyle for
333
- # the corresponding memory type
334
- #
335
- # @example
336
- # mem_style = tester.source_memory(:default)
337
- # mem_style.contained_pins.each do |pin|
338
- # attributes_hash = mem_style.accumulate_attributes(pin)
339
- #
340
- # end
341
- def source_memory(type = :default)
342
- type = :subroutine if type == :default
343
- source_memory_config[type] = OrigenTesters::MemoryStyle.new unless source_memory_config.key?(type)
344
- if block_given?
345
- yield source_memory_config[type]
346
- else
347
- source_memory_config[type]
348
- end
349
- end
350
-
351
- # Configure capture memory to a non-default setting
352
- #
353
- # This method changes the way the instruments statement gets rendered
354
- # if the tester's capture memory is used.
355
- #
356
- # @example
357
- # tester.capture_memory :default do |mem|
358
- # mem.pin :tdo, size: 32, format: :long
359
- # end
360
- #
361
- # If called without a block, this method will return
362
- # the instance of type OrigenTesters::MemoryStyle for
363
- # the corresponding memory type
364
- #
365
- # @example
366
- # mem_style = tester.capture_memory(:default)
367
- # if mem_style.contains_pin?(:tdo)
368
- # attributes_hash = mem_style.accumulate_attributes(:tdo)
369
- #
370
- # end
371
- def capture_memory(type = :default)
372
- type = :hram if type == :default
373
- capture_memory_config[type] = OrigenTesters::MemoryStyle.new unless capture_memory_config.key?(type)
374
- if block_given?
375
- yield capture_memory_config[type]
376
- else
377
- capture_memory_config[type]
378
- end
379
- end
380
- end
381
- end
1
+ module OrigenTesters
2
+ # This module implements the basic set of methods that a tester must have
3
+ # in order for Origen to talk to it.
4
+ #
5
+ # They can be overridden by tester specific classes and who may go on to add
6
+ # additional methods of their own.
7
+ #
8
+ # Essentially this API means that any class that includes Origen::Tester will
9
+ # function as a tester, although it might not do very much!
10
+ module API
11
+ attr_accessor :includes
12
+ attr_accessor :comment_level
13
+ attr_accessor :generating
14
+ # Get/Set the overlay style
15
+ #
16
+ # This method changes the way overlay is handled.
17
+ # The default value and possible settings is dependent on the individual tester.
18
+ #
19
+ # @example
20
+ # tester.overlay_style = :label
21
+ attr_accessor :overlay_style
22
+ # Get/Set the capture style
23
+ #
24
+ # This method changes the way tester.store() implements the store
25
+ # The default value and possible settings is dependent on the individual tester.
26
+ #
27
+ # @example
28
+ # tester.capture_style = :hram
29
+ attr_accessor :capture_style
30
+
31
+ def name
32
+ @name || self.class
33
+ end
34
+
35
+ def generate?
36
+ true
37
+ end
38
+
39
+ def generating_pattern?
40
+ @generating == :pattern
41
+ end
42
+
43
+ def generating_program?
44
+ @generating == :program
45
+ end
46
+
47
+ def pat_extension
48
+ @pat_extension || 'txt'
49
+ end
50
+ alias_method :pattern_extension, :pat_extension
51
+
52
+ def comment_char
53
+ @comment_char || '//'
54
+ end
55
+
56
+ def program_comment_char
57
+ @program_comment_char || comment_char
58
+ end
59
+
60
+ def pattern_header(*args)
61
+ end
62
+
63
+ def pattern_footer(*args)
64
+ end
65
+
66
+ def step_comment_prefix
67
+ @step_comment_prefix || '##'
68
+ end
69
+
70
+ def is_vector_based?
71
+ return @vector_based if defined?(@vector_based)
72
+ true
73
+ end
74
+
75
+ def is_command_based?
76
+ !is_vector_based?
77
+ end
78
+
79
+ def stil?
80
+ defined?(OrigenTesters::StilBasedTester::Base) &&
81
+ is_a?(OrigenTesters::StilBasedTester::Base)
82
+ end
83
+
84
+ def j750?
85
+ is_a?(OrigenTesters::IGXLBasedTester::J750)
86
+ end
87
+
88
+ def j750_hpt?
89
+ is_a?(OrigenTesters::IGXLBasedTester::J750_HPT)
90
+ end
91
+
92
+ def v93k?
93
+ is_a?(OrigenTesters::SmartestBasedTester::V93K)
94
+ end
95
+
96
+ def ultraflex?
97
+ is_a?(OrigenTesters::IGXLBasedTester::UltraFLEX)
98
+ end
99
+ alias_method :uflex?, :ultraflex?
100
+
101
+ def link?
102
+ !!(self.class.to_s =~ /^OrigenLink::/)
103
+ end
104
+
105
+ def doc?
106
+ false
107
+ end
108
+
109
+ def annotate(msg, options = {})
110
+ end
111
+
112
+ def diff_friendly_output=(value)
113
+ @diff_friendly_output = value
114
+ end
115
+
116
+ def diff_friendly_output?
117
+ !!@diff_friendly_output
118
+ end
119
+ alias_method :diff_friendly_output, :diff_friendly_output?
120
+
121
+ # Ignore fails on the given pins for the duration of the given block, this
122
+ # has the effect of temporarily setting the states of the given pins to
123
+ # don't care.
124
+ def ignore_fails(*pins)
125
+ pins.each(&:suspend)
126
+ yield
127
+ pins.each(&:resume)
128
+ end
129
+
130
+ # Output a comment in the pattern, normally you would not call this directly
131
+ # and instead use these shorthand methods:
132
+ # cc "Some comment"
133
+ # ss "A single line step comment"
134
+ # step_comment do
135
+ # cc "A multi line"
136
+ # cc "step comment"
137
+ # end
138
+ def c1(msg, options = {})
139
+ prefix = comment_char + ' '
140
+ prefix += step_comment_prefix + ' ' if @step_comment_on
141
+ push_comment(prefix + msg.to_s)
142
+ end
143
+
144
+ def c2(msg, options = {})
145
+ c1(msg, options)
146
+ end
147
+
148
+ def pattern_section(msg)
149
+ if generating_program?
150
+ yield
151
+ else
152
+ step_comment(msg)
153
+ yield
154
+ end
155
+ end
156
+
157
+ def ss(msg = nil)
158
+ div = step_comment_prefix.length
159
+ div = 1 if div == 0
160
+ c1(step_comment_prefix * (70 / div))
161
+ @step_comment_on = true
162
+ if block_given?
163
+ yield
164
+ else
165
+ c1(msg)
166
+ end
167
+ @step_comment_on = false
168
+ if $_testers_enable_vector_comments
169
+ timestamp = " #{execution_time_in_ns}ns #{step_comment_prefix}"
170
+ str = step_comment_prefix * (70 / div)
171
+ c1 str.sub(/#{step_comment_prefix}{#{timestamp.length - 1}}$/, timestamp)
172
+ else
173
+ c1(step_comment_prefix * (70 / div))
174
+ end
175
+ end
176
+
177
+ def snip(number, options = {})
178
+ yield
179
+ end
180
+
181
+ # Allows a section to be run without actually generating any vectors. This can be useful
182
+ # to ensure the pin states end up as they otherwise would have if the section had been run.
183
+ # Classic example of this is a subroutine pattern, wrap this around a call to the startup
184
+ # routine to ensure the pin states are as they would have been immediately after the startup.
185
+ # ==== Example
186
+ # # Setup state as if I had run startup without actually doing so
187
+ # $tester.inhibit_vectors_and_comments do
188
+ # $soc.startup
189
+ # $top.startup
190
+ # end
191
+ def inhibit_vectors_and_comments
192
+ inhibit_vectors = @inhibit_vectors
193
+ inhibit_comments = @inhibit_comments
194
+ @inhibit_vectors = true
195
+ @inhibit_comments = true
196
+ yield
197
+ @inhibit_vectors = inhibit_vectors # Restore to their initial state
198
+ @inhibit_comments = inhibit_comments
199
+ end
200
+
201
+ # Generate a vector.
202
+ # Calling this method will generate a vector in the output pattern based on the
203
+ # current pin states and timeset.
204
+ def cycle(options = {})
205
+ options = {
206
+ microcode: '',
207
+ timeset: current_timeset,
208
+ pin_vals: current_pin_vals,
209
+ repeat: nil
210
+ }.merge(options)
211
+
212
+ if any_clocks_running?
213
+ update_running_clocks
214
+ if options[:repeat]
215
+ slice_repeats(options).each do |slice|
216
+ options[:repeat] = slice[0]
217
+ delay(options.delete(:repeat), options) do |options|
218
+ push_vector(options)
219
+ end
220
+ slice[1].each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
221
+ options[:pin_vals] = current_pin_vals
222
+ end
223
+ pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
224
+ else
225
+ push_vector(options)
226
+ pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
227
+ end
228
+ else
229
+ if options[:repeat]
230
+ delay(options.delete(:repeat), options) do |options|
231
+ push_vector(options)
232
+ end
233
+ else
234
+ push_vector(options)
235
+ end
236
+ end
237
+ end
238
+
239
+ def import_test_time(file, options = {})
240
+ puts "Sorry but an importer doesn't exist for: #{Origen.tester.class}"
241
+ end
242
+
243
+ def any_clocks_running?
244
+ @clocks_running.nil? ? false : @clocks_running.count > 0
245
+ end
246
+
247
+ def clocks_running
248
+ @clocks_running
249
+ end
250
+ alias_method :running_clocks, :clocks_running
251
+
252
+ def push_running_clock(pin)
253
+ @clocks_running.nil? ? @clocks_running = { pin.name.to_s => pin } : @clocks_running[pin.name.to_s] = pin
254
+ end
255
+
256
+ def pop_running_clock(pin)
257
+ fail "ERROR: No clocks running, doesn't make sense to pop one" unless any_clocks_running?
258
+ @clocks_running.delete(pin.name.to_s)
259
+ end
260
+
261
+ def slice_repeats(options = {})
262
+ slices = {}
263
+ repeat_ary = []
264
+ clocks_running.each do |name, clock_pin|
265
+ if clock_pin.next_edge < (cycle_count + options[:repeat])
266
+ if clock_pin.respond_to?(:duty_cycles)
267
+ d0, d1 = clock_pin.duty_cycles
268
+ else
269
+ # keep legacy support for older pin_clock styling, supports only 50% duty-cycle
270
+ d0 = clock_pin.half_period
271
+ d1 = clock_pin.half_period
272
+ end
273
+ pin_slices = (clock_pin.next_edge..(cycle_count + options[:repeat])).step(d0 + d1).to_a
274
+ pin_slices += ((clock_pin.next_edge + d0)..(cycle_count + options[:repeat])).step(d0 + d1).to_a
275
+ pin_slices.sort!
276
+ pin_slices.insert(0, cycle_count)
277
+ else
278
+ pin_slices = [cycle_count]
279
+ end
280
+ pin_slices.each do |cycle|
281
+ slices[cycle].nil? ? slices[cycle] = name : slices[cycle] = "#{slices[cycle]},#{name}"
282
+ end
283
+ slices[cycle_count + options[:repeat]] = '' if pin_slices[-1] != cycle_count + options[:repeat]
284
+ end
285
+ slices.keys.sort.each do |edge_cycles|
286
+ # puts "Toggle #{slices[edge_cycles]} on #{edge_cycles}"
287
+ repeat_ary.push([edge_cycles, slices[edge_cycles].split(',')])
288
+ end
289
+
290
+ (repeat_ary.count - 1).downto(1).each { |i| repeat_ary[i][0] = repeat_ary[i][0] - repeat_ary[i - 1][0] }
291
+ repeat_ary[1..-1]
292
+ end
293
+
294
+ def pins_need_toggling
295
+ toggle_ary = []
296
+ clocks_running.each do |name, clock_pin|
297
+ toggle_ary.push("#{name}") if clock_pin.next_edge == cycle_count
298
+ end
299
+ toggle_ary
300
+ end
301
+
302
+ def update_running_clocks
303
+ clocks_running.each do |name, clock_pin|
304
+ clock_pin.update_clock
305
+ end
306
+ end
307
+
308
+ def transaction
309
+ yield
310
+ true
311
+ end
312
+
313
+ def source_memory_config
314
+ @source_memory_config ||= {}
315
+ end
316
+
317
+ def capture_memory_config
318
+ @capture_memory_config ||= {}
319
+ end
320
+
321
+ # Configure source memory to a non-default setting
322
+ #
323
+ # This method changes the way the instruments statement gets rendered
324
+ # if the tester's source memory is used.
325
+ #
326
+ # @example
327
+ # tester.source_memory :default do |mem|
328
+ # mem.pin :tdi, size: 32, format: :long
329
+ # end
330
+ #
331
+ # If called without a block, this method will return
332
+ # the instance of type OrigenTesters::MemoryStyle for
333
+ # the corresponding memory type
334
+ #
335
+ # @example
336
+ # mem_style = tester.source_memory(:default)
337
+ # mem_style.contained_pins.each do |pin|
338
+ # attributes_hash = mem_style.accumulate_attributes(pin)
339
+ #
340
+ # end
341
+ def source_memory(type = :default)
342
+ type = :subroutine if type == :default
343
+ source_memory_config[type] = OrigenTesters::MemoryStyle.new unless source_memory_config.key?(type)
344
+ if block_given?
345
+ yield source_memory_config[type]
346
+ else
347
+ source_memory_config[type]
348
+ end
349
+ end
350
+
351
+ # Configure capture memory to a non-default setting
352
+ #
353
+ # This method changes the way the instruments statement gets rendered
354
+ # if the tester's capture memory is used.
355
+ #
356
+ # @example
357
+ # tester.capture_memory :default do |mem|
358
+ # mem.pin :tdo, size: 32, format: :long
359
+ # end
360
+ #
361
+ # If called without a block, this method will return
362
+ # the instance of type OrigenTesters::MemoryStyle for
363
+ # the corresponding memory type
364
+ #
365
+ # @example
366
+ # mem_style = tester.capture_memory(:default)
367
+ # if mem_style.contains_pin?(:tdo)
368
+ # attributes_hash = mem_style.accumulate_attributes(:tdo)
369
+ #
370
+ # end
371
+ def capture_memory(type = :default)
372
+ type = :hram if type == :default
373
+ capture_memory_config[type] = OrigenTesters::MemoryStyle.new unless capture_memory_config.key?(type)
374
+ if block_given?
375
+ yield capture_memory_config[type]
376
+ else
377
+ capture_memory_config[type]
378
+ end
379
+ end
380
+ end
381
+ end