origen_testers 0.41.0 → 0.42.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 (347) hide show
  1. checksums.yaml +4 -4
  2. data/approved/j750/decompiler/sample/sample.atp +16 -0
  3. data/config/application.rb +6 -0
  4. data/config/boot.rb +3 -0
  5. data/config/commands.rb +148 -3
  6. data/config/global_commands.rb +0 -0
  7. data/config/shared_commands.rb +0 -0
  8. data/config/users.rb +0 -0
  9. data/config/version.rb +1 -1
  10. data/lib/commands/build.rb +0 -0
  11. data/lib/commands/convert.rb +16 -10
  12. data/lib/commands/run.rb +0 -0
  13. data/lib/origen_testers.rb +5 -0
  14. data/lib/origen_testers/api.rb +4 -0
  15. data/lib/origen_testers/atp.rb +0 -0
  16. data/lib/origen_testers/atp/ast/extractor.rb +0 -0
  17. data/lib/origen_testers/atp/ast/node.rb +0 -0
  18. data/lib/origen_testers/atp/flow.rb +0 -0
  19. data/lib/origen_testers/atp/flow_api.rb +0 -0
  20. data/lib/origen_testers/atp/formatter.rb +0 -0
  21. data/lib/origen_testers/atp/formatters/basic.rb +0 -0
  22. data/lib/origen_testers/atp/formatters/datalog.rb +0 -0
  23. data/lib/origen_testers/atp/parser.rb +0 -0
  24. data/lib/origen_testers/atp/processor.rb +0 -0
  25. data/lib/origen_testers/atp/processors/add_ids.rb +0 -0
  26. data/lib/origen_testers/atp/processors/add_set_result.rb +0 -0
  27. data/lib/origen_testers/atp/processors/adjacent_if_combiner.rb +0 -0
  28. data/lib/origen_testers/atp/processors/append_to.rb +0 -0
  29. data/lib/origen_testers/atp/processors/apply_post_group_actions.rb +0 -0
  30. data/lib/origen_testers/atp/processors/condition.rb +0 -0
  31. data/lib/origen_testers/atp/processors/continue_implementer.rb +0 -0
  32. data/lib/origen_testers/atp/processors/else_remover.rb +0 -0
  33. data/lib/origen_testers/atp/processors/empty_branch_remover.rb +0 -0
  34. data/lib/origen_testers/atp/processors/extract_set_flags.rb +0 -0
  35. data/lib/origen_testers/atp/processors/flag_optimizer.rb +0 -0
  36. data/lib/origen_testers/atp/processors/flattener.rb +0 -0
  37. data/lib/origen_testers/atp/processors/flow_id.rb +0 -0
  38. data/lib/origen_testers/atp/processors/marshal.rb +0 -0
  39. data/lib/origen_testers/atp/processors/on_pass_fail_remover.rb +0 -0
  40. data/lib/origen_testers/atp/processors/one_flag_per_test.rb +0 -0
  41. data/lib/origen_testers/atp/processors/pre_cleaner.rb +0 -0
  42. data/lib/origen_testers/atp/processors/redundant_condition_remover.rb +0 -0
  43. data/lib/origen_testers/atp/processors/relationship.rb +0 -0
  44. data/lib/origen_testers/atp/processors/sub_flow_remover.rb +0 -0
  45. data/lib/origen_testers/atp/program.rb +0 -0
  46. data/lib/origen_testers/atp/runner.rb +0 -0
  47. data/lib/origen_testers/atp/validator.rb +0 -0
  48. data/lib/origen_testers/atp/validators/condition.rb +0 -0
  49. data/lib/origen_testers/atp/validators/duplicate_ids.rb +0 -0
  50. data/lib/origen_testers/atp/validators/flags.rb +0 -0
  51. data/lib/origen_testers/atp/validators/jobs.rb +0 -0
  52. data/lib/origen_testers/atp/validators/missing_ids.rb +0 -0
  53. data/lib/origen_testers/atp_deprecation.rb +0 -0
  54. data/lib/origen_testers/basic_test_setups.rb +0 -0
  55. data/lib/origen_testers/callback_handlers.rb +0 -0
  56. data/lib/origen_testers/command_based_tester.rb +0 -0
  57. data/lib/origen_testers/decompiler.rb +9 -0
  58. data/lib/origen_testers/decompiler/decompiler_api.rb +163 -0
  59. data/lib/origen_testers/decompiler/nodes.rb +141 -0
  60. data/lib/origen_testers/decompiler/pattern.rb +304 -0
  61. data/lib/origen_testers/decompiler/pattern/elements/base.rb +44 -0
  62. data/lib/origen_testers/decompiler/pattern/elements/comment_block.rb +28 -0
  63. data/lib/origen_testers/decompiler/pattern/elements/frontmatter.rb +42 -0
  64. data/lib/origen_testers/decompiler/pattern/elements/pinlist.rb +44 -0
  65. data/lib/origen_testers/decompiler/pattern/elements/vector.rb +59 -0
  66. data/lib/origen_testers/decompiler/pattern/elements/vector_body_element.rb +105 -0
  67. data/lib/origen_testers/decompiler/pattern/enumerable_ext.rb +173 -0
  68. data/lib/origen_testers/decompiler/pattern/parsers.rb +111 -0
  69. data/lib/origen_testers/decompiler/pattern/spec_helpers.rb +41 -0
  70. data/lib/origen_testers/decompiler/pattern/splitter.rb +166 -0
  71. data/lib/origen_testers/decompiler/pattern/vector_delimiter_base.rb +70 -0
  72. data/lib/origen_testers/flow.rb +0 -0
  73. data/lib/origen_testers/generator/identity_map.rb +0 -0
  74. data/lib/origen_testers/generator/placeholder.rb +0 -0
  75. data/lib/origen_testers/generator/test_numberer.rb +0 -0
  76. data/lib/origen_testers/igxl_based_tester.rb +3 -0
  77. data/lib/origen_testers/igxl_based_tester/base.rb +8 -1
  78. data/lib/origen_testers/igxl_based_tester/base/custom_test_instance.rb +0 -0
  79. data/lib/origen_testers/igxl_based_tester/base/flow.rb +0 -0
  80. data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +0 -0
  81. data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +0 -0
  82. data/lib/origen_testers/igxl_based_tester/base/patgroups.rb +0 -0
  83. data/lib/origen_testers/igxl_based_tester/base/patset.rb +0 -0
  84. data/lib/origen_testers/igxl_based_tester/base/patset_pattern.rb +0 -0
  85. data/lib/origen_testers/igxl_based_tester/base/patsets.rb +0 -0
  86. data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +0 -0
  87. data/lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb +0 -0
  88. data/lib/origen_testers/igxl_based_tester/base/patsubrs.rb +0 -0
  89. data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +0 -0
  90. data/lib/origen_testers/igxl_based_tester/base/test_instances.rb +0 -0
  91. data/lib/origen_testers/igxl_based_tester/base/test_instances/custom_til.rb +0 -0
  92. data/lib/origen_testers/igxl_based_tester/decompiler.rb +72 -0
  93. data/lib/origen_testers/igxl_based_tester/decompiler/atp.rb +98 -0
  94. data/lib/origen_testers/igxl_based_tester/decompiler/nodes.rb +77 -0
  95. data/lib/origen_testers/igxl_based_tester/files.rb +0 -0
  96. data/lib/origen_testers/igxl_based_tester/j750.rb +1 -1
  97. data/lib/origen_testers/igxl_based_tester/j750/custom_test_instance.rb +0 -0
  98. data/lib/origen_testers/igxl_based_tester/j750/flow.rb +0 -0
  99. data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +0 -0
  100. data/lib/origen_testers/igxl_based_tester/j750/generator.rb +0 -0
  101. data/lib/origen_testers/igxl_based_tester/j750/patgroup.rb +0 -0
  102. data/lib/origen_testers/igxl_based_tester/j750/patgroups.rb +0 -0
  103. data/lib/origen_testers/igxl_based_tester/j750/patset.rb +0 -0
  104. data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +0 -0
  105. data/lib/origen_testers/igxl_based_tester/j750/patsets.rb +0 -0
  106. data/lib/origen_testers/igxl_based_tester/j750/patsubr.rb +0 -0
  107. data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +0 -0
  108. data/lib/origen_testers/igxl_based_tester/j750/patsubrs.rb +0 -0
  109. data/lib/origen_testers/igxl_based_tester/j750/templates/flow.txt.erb +0 -0
  110. data/lib/origen_testers/igxl_based_tester/j750/templates/instances.txt.erb +0 -0
  111. data/lib/origen_testers/igxl_based_tester/j750/templates/patgroups.txt.erb +0 -0
  112. data/lib/origen_testers/igxl_based_tester/j750/templates/patsets.txt.erb +0 -0
  113. data/lib/origen_testers/igxl_based_tester/j750/templates/patsubrs.txt.erb +0 -0
  114. data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +0 -0
  115. data/lib/origen_testers/igxl_based_tester/j750/test_instance_group.rb +0 -0
  116. data/lib/origen_testers/igxl_based_tester/j750/test_instances.rb +0 -0
  117. data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +0 -0
  118. data/lib/origen_testers/igxl_based_tester/j750_hpt/custom_test_instance.rb +0 -0
  119. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow.rb +0 -0
  120. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow_line.rb +0 -0
  121. data/lib/origen_testers/igxl_based_tester/j750_hpt/generator.rb +0 -0
  122. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroup.rb +0 -0
  123. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroups.rb +0 -0
  124. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset.rb +0 -0
  125. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset_pattern.rb +0 -0
  126. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsets.rb +0 -0
  127. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr.rb +0 -0
  128. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr_pattern.rb +0 -0
  129. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubrs.rb +0 -0
  130. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +0 -0
  131. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance_group.rb +0 -0
  132. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instances.rb +0 -0
  133. data/lib/origen_testers/igxl_based_tester/parser.rb +0 -0
  134. data/lib/origen_testers/igxl_based_tester/parser/ac_spec.rb +0 -0
  135. data/lib/origen_testers/igxl_based_tester/parser/ac_specs.rb +0 -0
  136. data/lib/origen_testers/igxl_based_tester/parser/dc_spec.rb +0 -0
  137. data/lib/origen_testers/igxl_based_tester/parser/dc_specs.rb +0 -0
  138. data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +0 -0
  139. data/lib/origen_testers/igxl_based_tester/parser/flow.rb +0 -0
  140. data/lib/origen_testers/igxl_based_tester/parser/flow_line.rb +0 -0
  141. data/lib/origen_testers/igxl_based_tester/parser/flows.rb +0 -0
  142. data/lib/origen_testers/igxl_based_tester/parser/pattern_set.rb +0 -0
  143. data/lib/origen_testers/igxl_based_tester/parser/pattern_sets.rb +0 -0
  144. data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +0 -0
  145. data/lib/origen_testers/igxl_based_tester/parser/test_instances.rb +0 -0
  146. data/lib/origen_testers/igxl_based_tester/parser/timeset.rb +0 -0
  147. data/lib/origen_testers/igxl_based_tester/parser/timesets.rb +0 -0
  148. data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +0 -0
  149. data/lib/origen_testers/igxl_based_tester/ultraflex/generator.rb +0 -0
  150. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroup.rb +0 -0
  151. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroups.rb +0 -0
  152. data/lib/origen_testers/igxl_based_tester/ultraflex/patset.rb +0 -0
  153. data/lib/origen_testers/igxl_based_tester/ultraflex/patset_pattern.rb +0 -0
  154. data/lib/origen_testers/igxl_based_tester/ultraflex/patsets.rb +0 -0
  155. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr.rb +0 -0
  156. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +0 -0
  157. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubrs.rb +0 -0
  158. data/lib/origen_testers/igxl_based_tester/ultraflex/pinmap.rb +0 -0
  159. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/flow.txt.erb +0 -0
  160. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/instances.txt.erb +0 -0
  161. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patgroups.txt.erb +0 -0
  162. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsets.txt.erb +0 -0
  163. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsubrs.txt.erb +0 -0
  164. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance_group.rb +0 -0
  165. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instances.rb +0 -0
  166. data/lib/origen_testers/labview_based_tester.rb +0 -0
  167. data/lib/origen_testers/memory_style.rb +0 -0
  168. data/lib/origen_testers/no_interface.rb +0 -0
  169. data/lib/origen_testers/origen_ext/application/runner.rb +0 -0
  170. data/lib/origen_testers/origen_ext/generator.rb +0 -0
  171. data/lib/origen_testers/origen_ext/generator/flow.rb +0 -0
  172. data/lib/origen_testers/origen_ext/generator/pattern.rb +0 -0
  173. data/lib/origen_testers/origen_ext/generator/resources.rb +0 -0
  174. data/lib/origen_testers/origen_ext/pins/timing.rb +57 -0
  175. data/lib/origen_testers/origen_ext/pins/timing/timeset.rb +29 -0
  176. data/lib/origen_testers/parser.rb +0 -0
  177. data/lib/origen_testers/parser/description_lookup.rb +0 -0
  178. data/lib/origen_testers/parser/searchable_array.rb +0 -0
  179. data/lib/origen_testers/parser/searchable_hash.rb +0 -0
  180. data/lib/origen_testers/pattern_compilers.rb +0 -0
  181. data/lib/origen_testers/pattern_compilers/assembler.rb +0 -0
  182. data/lib/origen_testers/pattern_compilers/base.rb +0 -0
  183. data/lib/origen_testers/pattern_compilers/igxl_based.rb +0 -0
  184. data/lib/origen_testers/pattern_compilers/j750.rb +0 -0
  185. data/lib/origen_testers/pattern_compilers/job.rb +0 -0
  186. data/lib/origen_testers/pattern_compilers/runner.rb +0 -0
  187. data/lib/origen_testers/pattern_compilers/templates/template.aiv.erb +0 -0
  188. data/lib/origen_testers/pattern_compilers/ultraflex.rb +0 -0
  189. data/lib/origen_testers/pattern_compilers/v93k.rb +0 -0
  190. data/lib/origen_testers/pattern_compilers/v93k/digcap.rb +13 -8
  191. data/lib/origen_testers/pattern_compilers/v93k/multiport.rb +0 -0
  192. data/lib/origen_testers/program_generators.rb +0 -0
  193. data/lib/origen_testers/smartest_based_tester.rb +2 -0
  194. data/lib/origen_testers/smartest_based_tester/base.rb +2 -2
  195. data/lib/origen_testers/smartest_based_tester/base/flow.rb +0 -0
  196. data/lib/origen_testers/smartest_based_tester/base/generator.rb +0 -0
  197. data/lib/origen_testers/smartest_based_tester/base/limits_file.rb +0 -0
  198. data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +0 -0
  199. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +0 -0
  200. data/lib/origen_testers/smartest_based_tester/base/processors/extract_bin_names.rb +0 -0
  201. data/lib/origen_testers/smartest_based_tester/base/processors/extract_flow_vars.rb +0 -0
  202. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +0 -0
  203. data/lib/origen_testers/smartest_based_tester/base/test_methods.rb +0 -0
  204. data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +0 -0
  205. data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +0 -0
  206. data/lib/origen_testers/smartest_based_tester/base/test_methods/custom_tml.rb +0 -0
  207. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +0 -0
  208. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +0 -0
  209. data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +0 -0
  210. data/lib/origen_testers/smartest_based_tester/base/variables_file.rb +0 -0
  211. data/lib/origen_testers/smartest_based_tester/decompiler.rb +43 -0
  212. data/lib/origen_testers/smartest_based_tester/decompiler/avc.rb +76 -0
  213. data/lib/origen_testers/smartest_based_tester/decompiler/nodes.rb +23 -0
  214. data/lib/origen_testers/smartest_based_tester/smt7.rb +0 -0
  215. data/lib/origen_testers/smartest_based_tester/smt8.rb +0 -0
  216. data/lib/origen_testers/smartest_based_tester/v93k.rb +0 -0
  217. data/lib/origen_testers/smartest_based_tester/v93k/builder.rb +0 -0
  218. data/lib/origen_testers/smartest_based_tester/v93k/builder/flow.rb +0 -0
  219. data/lib/origen_testers/smartest_based_tester/v93k/builder/pattern_master.rb +0 -0
  220. data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +0 -0
  221. data/lib/origen_testers/smartest_based_tester/v93k/generator.rb +0 -0
  222. data/lib/origen_testers/smartest_based_tester/v93k/limits_file.rb +0 -0
  223. data/lib/origen_testers/smartest_based_tester/v93k/pattern_compiler.rb +0 -0
  224. data/lib/origen_testers/smartest_based_tester/v93k/pattern_master.rb +0 -0
  225. data/lib/origen_testers/smartest_based_tester/v93k/templates/limits.csv.erb +0 -0
  226. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.aiv.erb +0 -0
  227. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.pmfl.erb +0 -0
  228. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.tf.erb +0 -0
  229. data/lib/origen_testers/smartest_based_tester/v93k/templates/vars.tf.erb +0 -0
  230. data/lib/origen_testers/smartest_based_tester/v93k/test_method.rb +0 -0
  231. data/lib/origen_testers/smartest_based_tester/v93k/test_methods.rb +0 -0
  232. data/lib/origen_testers/smartest_based_tester/v93k/test_suites.rb +0 -0
  233. data/lib/origen_testers/smartest_based_tester/v93k/variables_file.rb +0 -0
  234. data/lib/origen_testers/smartest_based_tester/v93k_smt8.rb +0 -0
  235. data/lib/origen_testers/smartest_based_tester/v93k_smt8/flow.rb +0 -0
  236. data/lib/origen_testers/smartest_based_tester/v93k_smt8/generator.rb +0 -0
  237. data/lib/origen_testers/smartest_based_tester/v93k_smt8/limits_file.rb +0 -0
  238. data/lib/origen_testers/smartest_based_tester/v93k_smt8/limits_workbook.rb +0 -0
  239. data/lib/origen_testers/smartest_based_tester/v93k_smt8/templates/limits.csv.erb +0 -0
  240. data/lib/origen_testers/smartest_based_tester/v93k_smt8/templates/template.flow.erb +0 -0
  241. data/lib/origen_testers/smartest_based_tester/v93k_smt8/test_suite.rb +0 -0
  242. data/lib/origen_testers/stil_based_tester.rb +0 -0
  243. data/lib/origen_testers/stil_based_tester/base.rb +6 -6
  244. data/lib/origen_testers/stil_based_tester/d10.rb +0 -0
  245. data/lib/origen_testers/stil_based_tester/stil.rb +0 -0
  246. data/lib/origen_testers/test/basic_interface.rb +0 -0
  247. data/lib/origen_testers/test/block.rb +0 -0
  248. data/lib/origen_testers/test/complex_timing.rb +22 -0
  249. data/lib/origen_testers/test/custom_test_interface.rb +0 -0
  250. data/lib/origen_testers/test/dummy_decompiler.rb +106 -0
  251. data/lib/origen_testers/test/dut.rb +12 -0
  252. data/lib/origen_testers/test/dut2.rb +19 -6
  253. data/lib/origen_testers/test/dut_adv_timing.rb +0 -0
  254. data/lib/origen_testers/test/empty_dut.rb +12 -0
  255. data/lib/origen_testers/test/interface.rb +0 -0
  256. data/lib/origen_testers/test/nvm.rb +0 -0
  257. data/lib/origen_testers/timing.rb +108 -305
  258. data/lib/origen_testers/timing/timeset.rb +141 -0
  259. data/lib/origen_testers/timing/timing_api.rb +307 -0
  260. data/lib/origen_testers/vector.rb +0 -0
  261. data/lib/origen_testers/vector_based_tester.rb +0 -0
  262. data/lib/origen_testers/vector_generator.rb +1 -0
  263. data/lib/origen_testers/vector_pipeline.rb +0 -0
  264. data/pattern/bitmap.rb +0 -0
  265. data/pattern/dc_instr.rb +0 -0
  266. data/pattern/decompile.rb +4 -0
  267. data/pattern/delay.rb +0 -0
  268. data/pattern/freq_counter.rb +0 -0
  269. data/pattern/mem_test.rb +0 -0
  270. data/pattern/multi_vector.rb +0 -0
  271. data/pattern/multi_vector_plus1.rb +0 -0
  272. data/pattern/nvm/j750/add_late_pins.rb +0 -0
  273. data/pattern/nvm/j750/iterator_postfix_test_x_bx.rb +0 -0
  274. data/pattern/nvm/j750/iterator_test_x_bx.rb +0 -0
  275. data/pattern/nvm/j750/j750_halt.rb +0 -0
  276. data/pattern/nvm/j750/j750_workout.rb +0 -0
  277. data/pattern/nvm/j750/timing.rb +4 -4
  278. data/pattern/nvm/v93k/v93k_workout.rb +0 -0
  279. data/pattern/pin_flip.rb +9 -0
  280. data/pattern/read_write_reg.rb +0 -0
  281. data/pattern/reset.rb +0 -0
  282. data/pattern/simple.rb +4 -0
  283. data/pattern/single_overlay_store.rb +0 -0
  284. data/pattern/subroutines.rb +0 -0
  285. data/pattern/tester_overlay.rb +0 -0
  286. data/pattern/tester_store.rb +0 -0
  287. data/program/_additional_erase.rb +0 -0
  288. data/program/_efa_resources.rb +0 -0
  289. data/program/_erase.rb +0 -0
  290. data/program/_erase_vfy.rb +0 -0
  291. data/program/_iv_resources.rb +0 -0
  292. data/program/basic_interface.rb +0 -0
  293. data/program/components/_deep_nested.rb +0 -0
  294. data/program/components/_prb2_main.rb +0 -0
  295. data/program/components/_small.rb +0 -0
  296. data/program/components/_temp.rb +0 -0
  297. data/program/custom_tests.rb +0 -0
  298. data/program/flow_control.rb +0 -0
  299. data/program/prb1.rb +0 -0
  300. data/program/prb1_resources.rb +0 -0
  301. data/program/prb2.rb +0 -0
  302. data/program/test.rb +0 -0
  303. data/templates/example.txt.erb +0 -0
  304. data/templates/j750/_vt_flow.txt.erb +0 -0
  305. data/templates/j750/_vt_instances.txt.erb +0 -0
  306. data/templates/j750/program_sheet.txt.erb +0 -0
  307. data/templates/manifest/v93k.yaml.erb +0 -0
  308. data/templates/origen_guides/decompilation/decompilerapi.md.erb +192 -0
  309. data/templates/origen_guides/decompilation/overview.md.erb +214 -0
  310. data/templates/origen_guides/decompilation/platformspecifics.md.erb +291 -0
  311. data/templates/origen_guides/decompilation/universalapi.md.erb +598 -0
  312. data/templates/origen_guides/pattern/common.md.erb +0 -0
  313. data/templates/origen_guides/pattern/creating.md.erb +0 -0
  314. data/templates/origen_guides/pattern/custom.md.erb +0 -0
  315. data/templates/origen_guides/pattern/documenting.md.erb +0 -0
  316. data/templates/origen_guides/pattern/introduction.md.erb +0 -0
  317. data/templates/origen_guides/pattern/j750.md.erb +0 -0
  318. data/templates/origen_guides/pattern/name.md.erb +0 -0
  319. data/templates/origen_guides/pattern/pins.md.erb +0 -0
  320. data/templates/origen_guides/pattern/registers.md.erb +0 -0
  321. data/templates/origen_guides/pattern/running.md.erb +0 -0
  322. data/templates/origen_guides/pattern/stil.md.erb +0 -0
  323. data/templates/origen_guides/pattern/timing.md.erb +205 -2
  324. data/templates/origen_guides/pattern/ultraflex.md.erb +0 -0
  325. data/templates/origen_guides/pattern/v93k.md.erb +0 -0
  326. data/templates/origen_guides/program/code.md.erb +0 -0
  327. data/templates/origen_guides/program/custom.md.erb +0 -0
  328. data/templates/origen_guides/program/doc.md.erb +0 -0
  329. data/templates/origen_guides/program/flowapi.md.erb +0 -0
  330. data/templates/origen_guides/program/flows.md.erb +0 -0
  331. data/templates/origen_guides/program/generating.md.erb +0 -0
  332. data/templates/origen_guides/program/interface.md.erb +0 -0
  333. data/templates/origen_guides/program/introduction.md.erb +0 -0
  334. data/templates/origen_guides/program/j750.md.erb +0 -0
  335. data/templates/origen_guides/program/philosophy.md.erb +0 -0
  336. data/templates/origen_guides/program/resources.md.erb +0 -0
  337. data/templates/origen_guides/program/ultraflex.md.erb +0 -0
  338. data/templates/origen_guides/program/v93k.md.erb +0 -0
  339. data/templates/origen_guides/program/v93ksmt7.md.erb +0 -0
  340. data/templates/origen_guides/program/v93ksmt8.md.erb +0 -0
  341. data/templates/web/index.md.erb +0 -0
  342. data/templates/web/layouts/_basic.html.erb +0 -0
  343. data/templates/web/layouts/_guides.html.erb +0 -0
  344. data/templates/web/partials/_navbar.html.erb +0 -0
  345. data/templates/web/partials/_placeholder.md.erb +0 -0
  346. data/templates/web/release_notes.md.erb +0 -0
  347. metadata +61 -3
@@ -0,0 +1,106 @@
1
+ module OrigenTesters
2
+ module Test
3
+ module Decompiler
4
+ module Dummy
5
+ extend OrigenTesters::Decompiler::API
6
+
7
+ class DummyTester
8
+ include VectorBasedTester
9
+ end
10
+
11
+ class PatternParsersMissing < OrigenTesters::Decompiler::Pattern
12
+ end
13
+
14
+ class PatternParseFrontmatterOnly < OrigenTesters::Decompiler::Pattern
15
+ def self.parse_frontmatter(raw_frontmatter:, context:)
16
+ OrigenTesters::Decompiler::Nodes::Frontmatter.new(context: context, pattern_header: [], comments: [])
17
+ end
18
+ end
19
+
20
+ class PatternParseFrontmatterPinlist < PatternParseFrontmatterOnly
21
+ def self.parse_pinlist(raw_pinlist:, context:)
22
+ OrigenTesters::Decompiler::Nodes::Pinlist.new(context: context, pattern_header: [], comments: [])
23
+ end
24
+ end
25
+
26
+ class PatternParseFrontmatterPinlistVector < PatternParseFrontmatterPinlist
27
+ def self.parse_vector(raw_vector:, context:)
28
+ OrigenTesters::Decompiler::Nodes::Vector.new(
29
+ context: context,
30
+ repeat: 0,
31
+ timeset: 'timeset',
32
+ pin_states: %w(p1 p2),
33
+ comment: 'Comment'
34
+ )
35
+ end
36
+ end
37
+
38
+ class Pattern < PatternParseFrontmatterPinlistVector
39
+ @platform = 'dummy'
40
+ @platform_tokens = {
41
+ comment_start: '#',
42
+ test_token: '!'
43
+ }
44
+
45
+ @splitter_config = {
46
+ pinlist_start: 0,
47
+ vectors_start: 0,
48
+ vectors_end: -1
49
+ }
50
+
51
+ @parser_config = {
52
+ platform_grammar_name: 'OrigenTesters::Decompiler::BaseGrammar::VectorBased',
53
+ include_base_tokens_grammar: true,
54
+ include_vector_based_grammar: true
55
+ }
56
+ end
57
+
58
+ class PatternIncomplete < PatternParseFrontmatterPinlistVector
59
+ @platform = 'dummy_incomplete'
60
+ end
61
+
62
+ class PatternNoParserConfig < PatternParseFrontmatterPinlistVector
63
+ @platform = 'pattern_no_parser_config'
64
+ @parser_config = nil
65
+ @splitter_config = {
66
+ pinlist_start: 0,
67
+ vectors_start: 0,
68
+ vectors_end: -1
69
+ }
70
+ end
71
+
72
+ class PatternNoSplitterConfig < PatternParseFrontmatterPinlistVector
73
+ @platform = 'pattern_no_splitter_config'
74
+ @parser_config = {}
75
+ @splitter_config = nil
76
+ end
77
+
78
+ class PatternIncompleteSplitterConfig < PatternParseFrontmatterPinlistVector
79
+ @platform = 'pattern_incomplete_splitter_config'
80
+ @parser_config = {}
81
+ @splitter_config = {
82
+ vectors_end: -1
83
+ }
84
+ end
85
+
86
+ class PatternNoVerify < PatternParseFrontmatterPinlistVector
87
+ @platform = 'pattern_no_verify'
88
+ @no_verify = true
89
+ end
90
+ end
91
+
92
+ module DummyWithDecompiler
93
+ def self.suitable_decompiler_for(pattern: nil, tester: nil, **options)
94
+ if pattern && (Pathname(pattern).extname == '.atp')
95
+ OrigenTesters::IGXLBasedTester
96
+ elsif tester && (tester == 'j750' || tester == 'uflex' || tester == 'ultraflex')
97
+ OrigenTesters::IGXLBasedTester
98
+ end
99
+ end
100
+ end
101
+
102
+ module DummyWithDecompilerMissingMethod
103
+ end
104
+ end
105
+ end
106
+ end
@@ -39,6 +39,18 @@ module OrigenTesters
39
39
  add_pin_group :pa, :pa2, :pa1, :pa0
40
40
  add_pin_alias :tdi_a, :tdi
41
41
  end
42
+
43
+ if options[:extra_pins]
44
+ options[:extra_pins].times do |i|
45
+ add_pin "PIN_#{i}".to_sym
46
+ end
47
+ end
48
+ # Add capitalized equivalent pins
49
+ add_pin_alias :TCLK, :tclk
50
+ add_pin_alias :TDI, :tdi
51
+ add_pin_alias :TDO, :tdo
52
+ add_pin_alias :TMS, :tms
53
+
42
54
  # add_pin_group :jtag, :tdi, :tdo, :tms
43
55
  add_power_pin_group :vdd1
44
56
  add_power_pin_group :vdd2
@@ -19,17 +19,30 @@ module OrigenTesters
19
19
  add_pin :tclk, reset: :drive_lo
20
20
  add_pin :trst, reset: :drive_hi
21
21
 
22
- add_pin_alias :extal, :clk
23
- add_pin_alias :extal_mux, :clk_mux
24
- add_pin_alias :tms, :done
25
- add_pin_alias :tdo, :fail
26
- add_pin_alias :tdi, :invoke
27
- add_pin_alias :resetb, :ahvtst
22
+ add_pin_alias :extal, :clk
23
+ add_pin_alias :extal_mux, :clk_mux
24
+ add_pin_alias :tms, :done
25
+ add_pin_alias :tdo, :fail
26
+ add_pin_alias :tdi, :invoke
27
+ add_pin_alias :resetb, :ahvtst
28
+ add_pin_alias :nvm_reset, :reset
29
+ add_pin_alias :nvm_clk, :clk
30
+ add_pin_alias :nvm_clk_mux, :clk_mux
31
+ add_pin_alias :nvm_invoke, :invoke
32
+ add_pin_alias :nvm_done, :done
33
+ add_pin_alias :nvm_fail, :fail
34
+ add_pin_alias :nvm_alvtst, :alvtst
35
+ add_pin_alias :nvm_ahvtst, :ahvtst
36
+ add_pin_alias :nvm_dtst, :dtst
28
37
 
29
38
  add_pin_alias :pa5, :porta, pin: 5
30
39
  add_pin_alias :pa_lower, :porta, pins: [3..0]
31
40
  add_pin_alias :pa_upper, :porta, pins: [7, 6, 5, 4]
32
41
  add_pin_alias :porta_alias, :porta
42
+
43
+ pins.each do |name, pin|
44
+ add_pin_alias(name.upcase, name) unless has_pin?(name.upcase)
45
+ end
33
46
  end
34
47
 
35
48
  def startup(options)
@@ -0,0 +1,12 @@
1
+ module OrigenTesters
2
+ module Test
3
+ class EmptyDUT
4
+ include OrigenARMDebug
5
+ include Origen::TopLevel
6
+ include OrigenJTAG
7
+
8
+ def initialize(options = {})
9
+ end
10
+ end
11
+ end
12
+ end
File without changes
File without changes
@@ -1,6 +1,21 @@
1
1
  module OrigenTesters
2
2
  module Timing
3
+ require 'origen_testers/timing/timeset'
4
+ require 'origen_testers/timing/timing_api'
5
+
3
6
  extend ActiveSupport::Concern
7
+ include TimingAPI
8
+
9
+ # Each time the toplevel is instantiated, we'll reset the timing, preserving
10
+ # the behavior when the timesets were stored on the tester object directly.
11
+ class TopLevelWatcher
12
+ include Origen::PersistentCallbacks
13
+
14
+ def before_load_target
15
+ OrigenTesters::Timing.reset!
16
+ end
17
+ end
18
+ @top_level_watcher = TopLevelWatcher.new
4
19
 
5
20
  included do
6
21
  # When set to true all pattern vectors will be converted to use the same period (the
@@ -29,359 +44,147 @@ module OrigenTesters
29
44
  attr_writer :timing_toggled_pins
30
45
  end
31
46
 
32
- class Timeset
33
- attr_accessor :name, :period_in_ns
47
+ def self.timesets!
48
+ @timesets = {}.with_indifferent_access
49
+ end
50
+
51
+ def self.reset!
52
+ timesets!
53
+ @timeset = nil
54
+ @_last_timeset_change = nil
55
+ @min_period_timeset = nil
56
+ end
34
57
 
35
- def initialize(attrs = {})
36
- attrs.each do |name, value|
37
- send("#{name}=", value)
58
+ def self.set_timeset(timeset, period_in_ns = nil)
59
+ def self._set_timeset_(timeset, period_in_ns = nil)
60
+ # If the period_in_ns was given, use that.
61
+ # Alternatively, the period_in_ns may have been set on the Timeset object
62
+ # already.
63
+ # If not, then complain that we need a period_in_ns before proceeding.
64
+ if period_in_ns
65
+ timeset._period_in_ns_ = period_in_ns
66
+ # elsif !timeset.period_in_ns?
67
+ # fail 'You must supply a period_in_ns argument to set_timeset'
38
68
  end
39
- end
40
69
 
41
- # Returns true if the timeset has a shorter period than the supplied timeset
42
- def shorter_period_than?(timeset)
43
- period_in_ns < timeset.period_in_ns
70
+ if @timeset
71
+ timeset_changed(timeset)
72
+ else
73
+ @timeset = timeset
74
+ end
75
+ timeset.called = true
76
+ @timeset = timeset
77
+ timeset
44
78
  end
45
- end
46
-
47
- # @see Timing#level_period
48
- #
49
- # When period levelling is enabled, vectors will be expanded like this:
50
- # $tester.set_timeset("fast", 40)
51
- # 2.cycles # fast 1 0 0 1 0
52
- # # fast 1 0 0 1 0
53
- # # Without levelling enabled
54
- # $tester.set_timeset("slow", 80)
55
- # 2.cycles # slow 1 0 0 1 0
56
- # # slow 1 0 0 1 0
57
- # # With levelling enabled
58
- # $tester.set_timeset("slow", 80)
59
- # 2.cycles # fast 1 0 0 1 0
60
- # # fast 1 0 0 1 0
61
- # # fast 1 0 0 1 0
62
- # # fast 1 0 0 1 0
63
- #
64
- # The overall time of the levelled/expanded vectors matches that of the unlevelled
65
- # case. i.e. 4 cycles at fast speed (4 * 40ns = 160ns) is equivalent to 2 cycles
66
- # at slow speed (2 * 80ns = 160ns).
67
- #
68
- # However, what if pin 1 in the example above was a clk pin where the 1 -> 0 transition
69
- # was handled by the timing setup for that pin.
70
- # In that case the levelled code is no longer functionally correct since it contains
71
- # 4 clock pulses while the unlevelled code only has 2.
72
- #
73
- # Such pins can be specified via this attribute and the levelling logic will then
74
- # automatically adjust the drive state to keep the number of pulses correct.
75
- # It would automatically adjust to the alternative logic state where 0 means 'on'
76
- # and 1 means 'off' if applicable.
77
- #
78
- # $tester.timing_toggled_pins << $dut.pin(:tclk) # This is pin 1
79
- #
80
- # $tester.set_timeset("fast", 40)
81
- # 2.cycles # fast 1 0 0 1 0
82
- # # fast 1 0 0 1 0
83
- # # Without levelling enabled
84
- # $tester.set_timeset("slow", 80)
85
- # 2.cycles # slow 1 0 0 1 0
86
- # # slow 1 0 0 1 0
87
- # # With levelling enabled
88
- # $tester.set_timeset("slow", 80)
89
- # 2.cycles # fast 1 0 0 1 0
90
- # # fast 0 0 0 1 0
91
- # # fast 1 0 0 1 0
92
- # # fast 0 0 0 1 0
93
- #
94
- # Multiple pins an be specified like this:
95
- # $tester.timing_toggled_pins = [$dut.pin(:tclk), $dut.pin(:clk)] # Overrides any pins added elsewhere
96
- # $tester.timing_toggled_pins << [$dut.pin(:tclk), $dut.pin(:clk)] # In addition to any pins added elsewhere
97
- def timing_toggled_pins
98
- @timing_toggled_pins ||= []
99
- @timing_toggled_pins.flatten!
100
- @timing_toggled_pins
101
- end
102
79
 
103
- # Set the timeset for the next vectors, this will remain in place until the next
104
- # time this is called.
105
- #
106
- # $tester.set_timeset("bist_25mhz", 40)
107
- #
108
- # This method also accepts a block in which case the contained vectors will generate
109
- # with the supplied timeset and subsequent vectors will return to the previous timeset
110
- # automatically.
111
- #
112
- # $tester.set_timeset("bist_25mhz", 40) do
113
- # $tester.cycle
114
- # end
115
- #
116
- # The arguments can also be supplied as a single array, or not at all. In the latter case
117
- # the existing timeset will simply be preserved. This is useful if you have timesets that
118
- # can be conditionally set based on the target.
119
- #
120
- # # Target 1
121
- # $soc.readout_timeset = ["readout", 120]
122
- # # Target 2
123
- # $soc.readout_timeset = false
124
- #
125
- # # This code is compatible with both targets, in the first case the timeset will switch
126
- # # over, in the second case the existing timeset will be preserved.
127
- # $tester.set_timeset($soc.readout_timeset) do
128
- # $tester.cycle
129
- # end
130
- def set_timeset(timeset, period_in_ns = nil)
131
80
  if timeset.is_a?(Array)
132
81
  timeset, period_in_ns = timeset[0], timeset[1]
133
82
  end
134
83
  timeset ||= @timeset
135
- unless timeset.is_a?(Timeset)
136
- fail 'You must supply a period_in_ns argument to set_timeset' unless period_in_ns
137
- timeset = Timeset.new(name: timeset.to_s.chomp, period_in_ns: period_in_ns)
138
- end
139
- called_timesets << timeset unless called_timesets.map(&:name).include?(timeset.name)
140
- if @min_period_timeset
141
- @min_period_timeset = timeset if timeset.shorter_period_than?(@min_period_timeset)
142
- else
143
- @min_period_timeset = timeset
84
+ if timeset.is_a?(Origen::Pins::Timing::Timeset) || timeset.is_a?(OrigenTesters::Timing::Timeset)
85
+ timeset = timeset.id.to_sym
144
86
  end
87
+ timeset = (timesets[timeset] || lookup_or_register_timeset(timeset.to_s.chomp, period_in_ns: period_in_ns))
88
+
145
89
  if block_given?
146
90
  original = @timeset
147
- timeset_changed(timeset)
148
- @timeset = timeset
149
- _if_dut do
150
- dut.timeset = timeset.name if dut.timesets[timeset.name]
151
- dut.current_timeset_period = timeset.period_in_ns
152
- end
91
+ _set_timeset_(timeset, period_in_ns)
153
92
  yield
154
- timeset_changed(original)
155
- @timeset = original
156
- _if_dut do
157
- dut.timeset = original.name if dut.timesets[original.name]
158
- dut.current_timeset_period = original.period_in_ns
159
- end
160
- else
161
- timeset_changed(timeset)
162
- @timeset = timeset
163
- _if_dut do
164
- dut.timeset = timeset.name if dut.timesets[timeset.name]
165
- dut.current_timeset_period = timeset.period_in_ns
166
- end
93
+ timeset = original
94
+ period_in_ns = timeset.period_in_ns
167
95
  end
168
- end
96
+ _set_timeset_(timeset, period_in_ns)
169
97
 
170
- # @api private
171
- def _if_dut
172
- if dut
173
- yield
98
+ if @min_period_timeset && period_in_ns
99
+ @min_period_timeset = timeset if timeset.shorter_period_than?(@min_period_timeset)
174
100
  else
175
- Origen.log.warning 'It looks like you are calling tester.set_timeset before the DUT is instantiated, you should avoid doing that until the dut object is available'
101
+ @min_period_timeset = timeset
176
102
  end
103
+ timeset
177
104
  end
105
+ singleton_class.send(:alias_method, :with_timeset, :set_timeset)
178
106
 
179
- # Returns the timeset (a Timeset object) with the shortest period that has been
180
- # encountered so far in the course of generating the current pattern.
181
- #
182
- # A tester object is re-instantiated at the start of every pattern which will reset
183
- # this variable.
184
- def min_period_timeset
107
+ def self.min_period_timeset
185
108
  @min_period_timeset
186
109
  end
187
110
 
188
- def timeset_changed(timeset)
189
- if last_vector && last_vector.timeset != timeset
190
- change = { old: last_vector.timeset, new: timeset }
191
- # Suppress any duplicate calls
192
- if !@_last_timeset_change ||
193
- (@_last_timeset_change[:new] != change[:new] &&
194
- @_last_timeset_change[:old] != change[:old])
195
- before_timeset_change(change)
196
- end
197
- @_last_timeset_change = change
198
- end
199
- if dut.timesets[timeset.name]
200
- dut.timeset = timeset.name
201
- dut.current_timeset_period = timeset.period_in_ns
202
- end
203
- end
204
-
205
- def before_timeset_change(options = {})
206
- end
207
-
208
- # Cause the pattern to wait.
209
- # The following options are available to help you specify the time to wait:
210
- # * :cycles - delays specified in raw cycles, the test model is responsible for translating this into a sequence of valid repeat statements
211
- # * :time_in_ns - time specified in nano-seconds
212
- # * :time_in_us - time specified in micro-seconds
213
- # * :time_in_ms - time specified in milli-seconds
214
- # * :time_in_s - time specified in seconds
215
- # If more than one option is supplied they will get added together to give a final
216
- # delay time expressed in cycles.
217
- # ==== Examples
218
- # $tester.wait(cycles: 100, time_in_ns: 200) # Wait for 100 cycles + 200ns
219
- # This method can also be used to trigger a match loop in which case the supplied time
220
- # becomes the time out for the match. See the J750#match method for full details of the
221
- # available options.
222
- # $tester.wait(match: true, state: :high, pin: $dut.pin(:done), time_in_ms: 500)
223
- def wait(options = {})
224
- options = {
225
- cycles: 0,
226
- time_in_cycles: 0,
227
- time_in_us: 0,
228
- time_in_ns: 0,
229
- time_in_ms: 0,
230
- time_in_s: 0,
231
- match: false, # Set to true to invoke a match loop where the supplied delay
232
- # will become the timeout duration
233
- }.merge(options)
234
-
235
- cycles = 0
236
- cycles += options[:cycles] + options[:time_in_cycles]
237
- cycles += s_to_cycles(options[:time_in_s])
238
- cycles += ms_to_cycles(options[:time_in_ms])
239
- cycles += us_to_cycles(options[:time_in_us])
240
- cycles += ns_to_cycles(options[:time_in_ns])
241
-
242
- time = cycles * current_period_in_ns # Total delay in ns
243
- case
244
- when time < 1000 # When less than 1us
245
- cc "Wait for #{'a maximum of ' if options[:match]}#{time}ns"
246
- when time < 1_000_000 # When less than 1ms
247
- cc "Wait for #{'a maximum of ' if options[:match]}#{(time.to_f / 1000).round(1)}us" # Display delay in us
248
- when time < 1_000_000_000 # When less than 1s
249
- cc "Wait for #{'a maximum of ' if options[:match]}#{(time.to_f / 1_000_000).round(1)}ms"
250
- else
251
- cc "Wait for #{'a maximum of ' if options[:match]}%.2fs" % (time.to_f / 1_000_000_000)
252
- end
253
-
254
- if cycles > 0 # Allow this function to be called with 0 in which case it will just return
255
- if options[:match]
256
- if block_given?
257
- match_block(cycles, options) { yield }
258
- else
259
- match(options[:pin], options[:state], cycles, options)
260
- end
261
- else
262
- delay(cycles)
263
- end
264
- end
111
+ def self.timesets
112
+ @timesets || timesets!
265
113
  end
266
114
 
267
- # @see Timing#wait
268
- # @api private
269
- # This should not be called directly, call via tester#wait
270
- def delay(cycles, options = {})
271
- (cycles / max_repeat_loop).times do
272
- if block_given?
273
- yield options.merge(repeat: max_repeat_loop)
274
- else
275
- cycle(options.merge(repeat: max_repeat_loop))
276
- end
277
- end
278
- if block_given?
279
- yield options.merge(repeat: (cycles % max_repeat_loop))
115
+ # Given a timeset name or object, either returns it, if it exists, or creates it, and returns
116
+ # the newly created timeset.
117
+ def self.lookup_or_register_timeset(t, period_in_ns: nil)
118
+ if t.is_a?(Origen::Pins::Timing::Timeset)
119
+ timesets[t.id] ||= Timeset.new(name: t.id, period_in_ns: period_in_ns)
280
120
  else
281
- cycle(options.merge(repeat: (cycles % max_repeat_loop)))
121
+ timesets[t] ||= Timeset.new(name: t, period_in_ns: period_in_ns)
282
122
  end
283
123
  end
284
124
 
285
- def max_repeat_loop
286
- @max_repeat_loop || 65_535
287
- end
288
-
289
- def min_repeat_loop
290
- @min_repeat_loop
291
- end
292
-
293
- def called_timesets
294
- @called_timesets ||= []
295
- end
296
-
297
- def current_period_in_ns
298
- if @timeset
299
- @timeset.period_in_ns
125
+ # Returns true if the current timeset is defined. False otherwise.
126
+ def self.timeset?(t)
127
+ if t.respond_to?(:name)
128
+ timesets.key?(t.name)
300
129
  else
301
- fail 'No timeset has been specified yet!'
130
+ timesets.key?(t)
302
131
  end
303
132
  end
304
- alias_method :current_period, :current_period_in_ns
305
- alias_method :period, :current_period_in_ns
306
133
 
307
- def current_timeset
134
+ def self.timeset
308
135
  @timeset
309
136
  end
310
- alias_method :timeset, :current_timeset
311
137
 
312
- # Convert the supplied number of cycles to a time, based on the SoC defined cycle period
313
- def cycles_to_time(cycles) # :nodoc:
314
- (cycles * current_period_in_ns).to_f / 1_000_000_000
138
+ def self.current_timeset
139
+ @timeset
315
140
  end
316
141
 
317
- # This function can be used to generate a clock or some other repeating function
318
- # that spans accross a range of vectors.
319
- # The period of each cycle and the duration of the sequence are supplied via the following
320
- # options:
321
- # * :period_in_cycles
322
- # * :period_in_ns
323
- # * :period_in_us
324
- # * :period_in_ms
325
- # * :duration_in_cycles
326
- # * :duration_in_ns
327
- # * :duration_in_us
328
- # * :duration_in_ms
329
- # If multiple definitions for either option are supplied then they will be added
330
- # together.
331
- # ==== Example
332
- # # Supply a clock pulse on :pinA for 100ms
333
- # $tester.count(:period_in_cycles => 10, :duration_in_ms => 100) do
334
- # $top.pin(:pinA).drive!(1)
335
- # $top.pin(:pinA).drive!(0)
336
- # end
337
- def count(options = {})
338
- options = { period_in_cycles: 0, period_in_ms: 0, period_in_us: 0, period_in_ns: 0,
339
- duration_in_cycles: 0, duration_in_ms: 0, duration_in_us: 0, duration_in_ns: 0
340
- }.merge(options)
341
-
342
- period_cycles = options[:period_in_cycles] + ms_to_cycles(options[:period_in_ms]) +
343
- us_to_cycles(options[:period_in_us]) + ns_to_cycles(options[:period_in_ns])
344
-
345
- duration_cycles = options[:duration_in_cycles] + ms_to_cycles(options[:duration_in_ms]) +
346
- us_to_cycles(options[:duration_in_us]) + ns_to_cycles(options[:duration_in_ns])
347
-
348
- total = 0
349
- while total < duration_cycles
350
- wait(time_in_cycles: period_cycles)
351
- yield # Return control back to caller
352
- total += period_cycles
142
+ def self.period_in_ns
143
+ if timeset
144
+ timeset.period_in_ns
353
145
  end
354
146
  end
355
147
 
356
- private
357
-
358
- def s_to_cycles(time) # :nodoc:
359
- ((time.to_f) * 1000 * 1000 * 1000 / current_period_in_ns).to_int
360
- end
361
-
362
- def ms_to_cycles(time) # :nodoc:
363
- ((time.to_f) * 1000 * 1000 / current_period_in_ns).to_int
364
- end
365
-
366
- def us_to_cycles(time) # :nodoc:
367
- ((time.to_f * 1000) / current_period_in_ns).to_int
148
+ def self.timeset_changed(timeset)
149
+ if tester && tester.last_vector && tester.last_vector.timeset != timeset
150
+ change = { old: tester.last_vector.timeset, new: timeset }
151
+ # Suppress any duplicate calls
152
+ if !@_last_timeset_change ||
153
+ (@_last_timeset_change[:new] != change[:new] &&
154
+ @_last_timeset_change[:old] != change[:old])
155
+ tester.before_timeset_change(change)
156
+ end
157
+ @_last_timeset_change = change
158
+ end
368
159
  end
369
160
 
370
- def ns_to_cycles(time) # :nodoc:
371
- (time.to_f / current_period_in_ns).to_int
161
+ def self.current_period_in_ns
162
+ if timeset
163
+ timeset.period_in_ns
164
+ end
372
165
  end
166
+ singleton_class.send(:alias_method, :period, :current_period_in_ns)
167
+ singleton_class.send(:alias_method, :current_period, :current_period_in_ns)
168
+ singleton_class.send(:alias_method, :period_in_ns, :current_period_in_ns)
373
169
 
374
- def cycles_to_us(cycles) # :nodoc:
375
- ((cycles.to_f * current_period_in_ns) / (1000)).ceil
170
+ def self.period_in_secs
171
+ if timeset
172
+ timeset.period_in_secs
173
+ end
376
174
  end
175
+ singleton_class.send(:alias_method, :period_in_seconds, :period_in_secs)
377
176
 
378
- def cycles_to_ms(cycles) # :nodoc:
379
- ((cycles.to_f * current_period_in_ns) / (1000 * 1000)).ceil
177
+ # Returns any timesets that have been called during this execution.
178
+ # @return [Array] Array of OrigenTesters::Timing::Timeset objects that have been used so far.
179
+ def self.called_timesets
180
+ timesets.select { |n, t| t.called? }.values
380
181
  end
182
+ # alias_method :called_timesets_by_instance, :called_timesets
381
183
 
382
- # Cycles to tenths of a second
383
- def cycles_to_ts(cycles) # :nodoc:
384
- ((cycles.to_f * current_period_in_ns) / (1000 * 1000 * 100)).ceil
184
+ # Similar to {#called_timesets}, but returns the name of the timesets instead.
185
+ # @return [Array] Array of names corresponding to the timesets that have been used so far.
186
+ def self.called_timesets_by_name
187
+ timesets.select { |n, t| t.called? }.keys
385
188
  end
386
189
  end
387
190
  end