origen_testers 0.4.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 (199) hide show
  1. checksums.yaml +7 -0
  2. data/config/application.rb +140 -0
  3. data/config/commands.rb +73 -0
  4. data/config/development.rb +12 -0
  5. data/config/environment.rb +1 -0
  6. data/config/shared_commands.rb +47 -0
  7. data/config/users.rb +18 -0
  8. data/config/version.rb +8 -0
  9. data/lib/commands/build.rb +69 -0
  10. data/lib/origen_testers.rb +23 -0
  11. data/lib/origen_testers/api.rb +258 -0
  12. data/lib/origen_testers/basic_test_setups.rb +105 -0
  13. data/lib/origen_testers/callback_handlers.rb +58 -0
  14. data/lib/origen_testers/generator.rb +279 -0
  15. data/lib/origen_testers/generator/flow_control_api.rb +611 -0
  16. data/lib/origen_testers/generator/identity_map.rb +23 -0
  17. data/lib/origen_testers/generator/placeholder.rb +11 -0
  18. data/lib/origen_testers/generator/test_numberer.rb +23 -0
  19. data/lib/origen_testers/igxl_based_tester.rb +12 -0
  20. data/lib/origen_testers/igxl_based_tester/base.rb +641 -0
  21. data/lib/origen_testers/igxl_based_tester/base/flow.rb +171 -0
  22. data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +322 -0
  23. data/lib/origen_testers/igxl_based_tester/base/generator.rb +217 -0
  24. data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +109 -0
  25. data/lib/origen_testers/igxl_based_tester/base/patgroups.rb +38 -0
  26. data/lib/origen_testers/igxl_based_tester/base/patset.rb +68 -0
  27. data/lib/origen_testers/igxl_based_tester/base/patset_pattern.rb +56 -0
  28. data/lib/origen_testers/igxl_based_tester/base/patsets.rb +38 -0
  29. data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +68 -0
  30. data/lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb +56 -0
  31. data/lib/origen_testers/igxl_based_tester/base/patsubrs.rb +38 -0
  32. data/lib/origen_testers/igxl_based_tester/base/test_instance.rb +326 -0
  33. data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +58 -0
  34. data/lib/origen_testers/igxl_based_tester/base/test_instances.rb +179 -0
  35. data/lib/origen_testers/igxl_based_tester/files.rb +43 -0
  36. data/lib/origen_testers/igxl_based_tester/j750.rb +248 -0
  37. data/lib/origen_testers/igxl_based_tester/j750/flow.rb +10 -0
  38. data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +19 -0
  39. data/lib/origen_testers/igxl_based_tester/j750/generator.rb +19 -0
  40. data/lib/origen_testers/igxl_based_tester/j750/patgroup.rb +9 -0
  41. data/lib/origen_testers/igxl_based_tester/j750/patgroups.rb +10 -0
  42. data/lib/origen_testers/igxl_based_tester/j750/patset.rb +9 -0
  43. data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +18 -0
  44. data/lib/origen_testers/igxl_based_tester/j750/patsets.rb +10 -0
  45. data/lib/origen_testers/igxl_based_tester/j750/patsubr.rb +9 -0
  46. data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +18 -0
  47. data/lib/origen_testers/igxl_based_tester/j750/patsubrs.rb +10 -0
  48. data/lib/origen_testers/igxl_based_tester/j750/templates/flow.txt.erb +9 -0
  49. data/lib/origen_testers/igxl_based_tester/j750/templates/instances.txt.erb +16 -0
  50. data/lib/origen_testers/igxl_based_tester/j750/templates/patgroups.txt.erb +8 -0
  51. data/lib/origen_testers/igxl_based_tester/j750/templates/patsets.txt.erb +10 -0
  52. data/lib/origen_testers/igxl_based_tester/j750/templates/patsubrs.txt.erb +10 -0
  53. data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +547 -0
  54. data/lib/origen_testers/igxl_based_tester/j750/test_instance_group.rb +9 -0
  55. data/lib/origen_testers/igxl_based_tester/j750/test_instances.rb +10 -0
  56. data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +34 -0
  57. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow.rb +9 -0
  58. data/lib/origen_testers/igxl_based_tester/j750_hpt/flow_line.rb +9 -0
  59. data/lib/origen_testers/igxl_based_tester/j750_hpt/generator.rb +19 -0
  60. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroup.rb +9 -0
  61. data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroups.rb +9 -0
  62. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset.rb +9 -0
  63. data/lib/origen_testers/igxl_based_tester/j750_hpt/patset_pattern.rb +9 -0
  64. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsets.rb +9 -0
  65. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr.rb +9 -0
  66. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr_pattern.rb +9 -0
  67. data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubrs.rb +9 -0
  68. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +515 -0
  69. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance_group.rb +9 -0
  70. data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instances.rb +9 -0
  71. data/lib/origen_testers/igxl_based_tester/parser.rb +102 -0
  72. data/lib/origen_testers/igxl_based_tester/parser/ac_spec.rb +9 -0
  73. data/lib/origen_testers/igxl_based_tester/parser/ac_specs.rb +0 -0
  74. data/lib/origen_testers/igxl_based_tester/parser/dc_spec.rb +33 -0
  75. data/lib/origen_testers/igxl_based_tester/parser/dc_specs.rb +48 -0
  76. data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +339 -0
  77. data/lib/origen_testers/igxl_based_tester/parser/flow.rb +109 -0
  78. data/lib/origen_testers/igxl_based_tester/parser/flow_line.rb +203 -0
  79. data/lib/origen_testers/igxl_based_tester/parser/flows.rb +21 -0
  80. data/lib/origen_testers/igxl_based_tester/parser/pattern_set.rb +92 -0
  81. data/lib/origen_testers/igxl_based_tester/parser/pattern_sets.rb +31 -0
  82. data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +341 -0
  83. data/lib/origen_testers/igxl_based_tester/parser/test_instances.rb +24 -0
  84. data/lib/origen_testers/igxl_based_tester/parser/timeset.rb +13 -0
  85. data/lib/origen_testers/igxl_based_tester/parser/timesets.rb +0 -0
  86. data/lib/origen_testers/igxl_based_tester/ultraflex.rb +477 -0
  87. data/lib/origen_testers/igxl_based_tester/ultraflex/flow.rb +10 -0
  88. data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +19 -0
  89. data/lib/origen_testers/igxl_based_tester/ultraflex/generator.rb +19 -0
  90. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroup.rb +9 -0
  91. data/lib/origen_testers/igxl_based_tester/ultraflex/patgroups.rb +10 -0
  92. data/lib/origen_testers/igxl_based_tester/ultraflex/patset.rb +9 -0
  93. data/lib/origen_testers/igxl_based_tester/ultraflex/patset_pattern.rb +18 -0
  94. data/lib/origen_testers/igxl_based_tester/ultraflex/patsets.rb +10 -0
  95. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr.rb +9 -0
  96. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +18 -0
  97. data/lib/origen_testers/igxl_based_tester/ultraflex/patsubrs.rb +10 -0
  98. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/flow.txt.erb +9 -0
  99. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/instances.txt.erb +16 -0
  100. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patgroups.txt.erb +9 -0
  101. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsets.txt.erb +10 -0
  102. data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsubrs.txt.erb +10 -0
  103. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance.rb +270 -0
  104. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance_group.rb +9 -0
  105. data/lib/origen_testers/igxl_based_tester/ultraflex/test_instances.rb +10 -0
  106. data/lib/origen_testers/interface.rb +183 -0
  107. data/lib/origen_testers/parser.rb +22 -0
  108. data/lib/origen_testers/parser/description_lookup.rb +62 -0
  109. data/lib/origen_testers/parser/searchable_array.rb +30 -0
  110. data/lib/origen_testers/parser/searchable_hash.rb +30 -0
  111. data/lib/origen_testers/pattern_compilers.rb +116 -0
  112. data/lib/origen_testers/pattern_compilers/assembler.rb +88 -0
  113. data/lib/origen_testers/pattern_compilers/job.rb +96 -0
  114. data/lib/origen_testers/pattern_compilers/ultraflex_pattern_compiler.rb +599 -0
  115. data/lib/origen_testers/program_generators.rb +55 -0
  116. data/lib/origen_testers/smartest_based_tester.rb +8 -0
  117. data/lib/origen_testers/smartest_based_tester/base.rb +411 -0
  118. data/lib/origen_testers/smartest_based_tester/base/flow.rb +188 -0
  119. data/lib/origen_testers/smartest_based_tester/base/flow_node.rb +476 -0
  120. data/lib/origen_testers/smartest_based_tester/base/generator.rb +123 -0
  121. data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +23 -0
  122. data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +47 -0
  123. data/lib/origen_testers/smartest_based_tester/base/test_method.rb +143 -0
  124. data/lib/origen_testers/smartest_based_tester/base/test_methods.rb +73 -0
  125. data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +33 -0
  126. data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +38 -0
  127. data/lib/origen_testers/smartest_based_tester/base/test_methods/custom_tml.rb +19 -0
  128. data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +147 -0
  129. data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +43 -0
  130. data/lib/origen_testers/smartest_based_tester/base/test_suite.rb +166 -0
  131. data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +58 -0
  132. data/lib/origen_testers/smartest_based_tester/v93k.rb +8 -0
  133. data/lib/origen_testers/smartest_based_tester/v93k/builder.rb +89 -0
  134. data/lib/origen_testers/smartest_based_tester/v93k/builder/flow.rb +169 -0
  135. data/lib/origen_testers/smartest_based_tester/v93k/builder/pattern_master.rb +54 -0
  136. data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +10 -0
  137. data/lib/origen_testers/smartest_based_tester/v93k/flow_node.rb +9 -0
  138. data/lib/origen_testers/smartest_based_tester/v93k/generator.rb +19 -0
  139. data/lib/origen_testers/smartest_based_tester/v93k/pattern_compiler.rb +10 -0
  140. data/lib/origen_testers/smartest_based_tester/v93k/pattern_master.rb +10 -0
  141. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.aiv.erb +17 -0
  142. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.flow.erb +201 -0
  143. data/lib/origen_testers/smartest_based_tester/v93k/templates/template.pmfl.erb +13 -0
  144. data/lib/origen_testers/smartest_based_tester/v93k/test_method.rb +9 -0
  145. data/lib/origen_testers/smartest_based_tester/v93k/test_methods.rb +9 -0
  146. data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +9 -0
  147. data/lib/origen_testers/smartest_based_tester/v93k/test_suites.rb +9 -0
  148. data/lib/origen_testers/test/basic_interface.rb +17 -0
  149. data/lib/origen_testers/test/block.rb +21 -0
  150. data/lib/origen_testers/test/dut.rb +184 -0
  151. data/lib/origen_testers/test/dut2.rb +76 -0
  152. data/lib/origen_testers/test/j750_base_interface.rb +119 -0
  153. data/lib/origen_testers/test/j750_hpt_interface.rb +8 -0
  154. data/lib/origen_testers/test/j750_interface.rb +8 -0
  155. data/lib/origen_testers/test/nvm.rb +94 -0
  156. data/lib/origen_testers/test/ultraflex_interface.rb +110 -0
  157. data/lib/origen_testers/test/v93k_interface.rb +115 -0
  158. data/lib/origen_testers/timing.rb +362 -0
  159. data/lib/origen_testers/vector.rb +203 -0
  160. data/lib/origen_testers/vector_based_tester.rb +42 -0
  161. data/lib/origen_testers/vector_generator.rb +623 -0
  162. data/lib/origen_testers/vector_pipeline.rb +288 -0
  163. data/pattern/dc_instr.rb +7 -0
  164. data/pattern/delay.rb +7 -0
  165. data/pattern/mem_test.rb +8 -0
  166. data/pattern/multi_vector.rb +117 -0
  167. data/pattern/multi_vector_plus1.rb +125 -0
  168. data/pattern/nvm/j750/add_late_pins.rb +3 -0
  169. data/pattern/nvm/j750/iterator_postfix_test_x_bx.rb +8 -0
  170. data/pattern/nvm/j750/iterator_test_x_bx.rb +8 -0
  171. data/pattern/nvm/j750/j750_halt.rb +159 -0
  172. data/pattern/nvm/j750/j750_workout.rb +202 -0
  173. data/pattern/nvm/j750/timing.rb +73 -0
  174. data/pattern/nvm/v93k/v93k_workout.rb +136 -0
  175. data/pattern/read_write_reg.rb +58 -0
  176. data/pattern/reset.rb +4 -0
  177. data/pattern/subroutines.rb +38 -0
  178. data/program/_additional_erase.rb +7 -0
  179. data/program/_efa_resources.rb +7 -0
  180. data/program/_erase.rb +25 -0
  181. data/program/_erase_vfy.rb +5 -0
  182. data/program/_iv_resources.rb +10 -0
  183. data/program/basic_interface.rb +5 -0
  184. data/program/components/_prb2_main.rb +6 -0
  185. data/program/flow_control.rb +164 -0
  186. data/program/prb1.rb +226 -0
  187. data/program/prb1_resources.rb +28 -0
  188. data/program/prb2.rb +40 -0
  189. data/program/test.rb +20 -0
  190. data/templates/example.txt.erb +53 -0
  191. data/templates/j750/_vt_flow.txt.erb +8 -0
  192. data/templates/j750/_vt_instances.txt.erb +4 -0
  193. data/templates/j750/program_sheet.txt.erb +9 -0
  194. data/templates/manifest/v93k.yaml.erb +22 -0
  195. data/templates/web/index.md.erb +51 -0
  196. data/templates/web/layouts/_basic.html.erb +15 -0
  197. data/templates/web/partials/_navbar.html.erb +22 -0
  198. data/templates/web/release_notes.md.erb +5 -0
  199. metadata +332 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 178b8cf6021e69d8d2aaae349f0859c17fd0f24c
4
+ data.tar.gz: f0319a6493a112d78e9da2adb9a60d88231cdd0f
5
+ SHA512:
6
+ metadata.gz: ea7347a99664f973ccb5ccd28509c83ccfe833b5ef9d6e46ab6c6b2d0ccd796a454d79457622d361e9a9b5e4ecd96cb4b8e85d32cf51c8a018adbae7296f70e1
7
+ data.tar.gz: 7b049c9a0fc92729dda392d35271314c0a7484dcece3792e4a24c9614ff265abb0a726eabce9d171e423f2c7d103e2b49514f91588f3aa7f72757cbc2574c12d
@@ -0,0 +1,140 @@
1
+ class OrigenTestersApplication < Origen::Application
2
+ # See http://origen.freescale.net/origen/latest/api/Origen/Application/Configuration.html
3
+ # for a full list of the configuration options available
4
+
5
+ config.shared = {
6
+ :command_launcher => "config/shared_commands.rb"
7
+ }
8
+
9
+ # This information is used in headers and email templates, set it specific
10
+ # to your application
11
+ config.name = 'Origen Testers'
12
+ config.initials = 'OrigenTesters'
13
+ self.name = 'origen_testers'
14
+ self.namespace = 'OrigenTesters'
15
+ config.rc_url = "git@github.com:Origen-SDK/origen_testers.git"
16
+ config.release_externally = true
17
+
18
+ # Added list of directory to exclude when run running origen rc unman
19
+ config.unmanaged_dirs = %w[spec/patterns/bin]
20
+
21
+ config.unmanaged_files = %w[]
22
+
23
+ config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/testers"
24
+ config.web_domain = "http://origen-sdk.org/testers"
25
+
26
+ # When false Origen will be less strict about checking for some common coding errors,
27
+ # it is recommended that you leave this to true for better feedback and easier debug.
28
+ # This will be the default setting in Origen v3.
29
+ config.strict_errors = true
30
+
31
+ config.semantically_version = true
32
+
33
+ # By default all generated output will end up in ./output.
34
+ # Here you can specify an alternative directory entirely, or make it dynamic such that
35
+ # the output ends up in a setup specific directory.
36
+ config.output_directory do
37
+ "#{Origen.root}/output/#{$tester.name}"
38
+ end
39
+
40
+ # Similary for the reference files, generally you want to setup the reference directory
41
+ # structure to mirror that of your output directory structure.
42
+ config.reference_directory do
43
+ "#{Origen.root}/.ref/#{$tester.name}"
44
+ end
45
+
46
+ # Setting this to the spec area for testing of compiler
47
+ config.pattern_output_directory do
48
+ "#{Origen.root}/spec/patterns/atp"
49
+ end
50
+
51
+ # Run the tests before deploying to generate test coverage numbers
52
+ def before_deploy_site
53
+ Dir.chdir Origen.root do
54
+ system 'origen examples -c'
55
+ system 'origen specs -c'
56
+ dir = "#{Origen.root}/web/output/coverage"
57
+ FileUtils.remove_dir(dir, true) if File.exist?(dir)
58
+ system "mv #{Origen.root}/coverage #{dir}"
59
+ end
60
+ end
61
+
62
+ # This will automatically deploy your documentation after every tag
63
+ def after_release_email(tag, note, type, selector, options)
64
+ command = 'origen web compile --remote --api'
65
+ Dir.chdir Origen.root do
66
+ system command
67
+ end
68
+ end
69
+
70
+ # Ensure that all tests pass before allowing a release to continue
71
+ def validate_release
72
+ if !system("origen examples") # || !system("origen specs")
73
+ puts "Sorry but you can't release with failing tests, please fix them and try again."
74
+ exit 1
75
+ else
76
+ puts "All tests passing, proceeding with release process!"
77
+ end
78
+ end
79
+
80
+ # Help to find patterns based on an iterator
81
+ config.pattern_name_translator do |name|
82
+ if name == 'dummy_name'
83
+ { :source => 'timing', :output => 'timing' }
84
+ else
85
+ name.gsub(/_b\d/, '_bx')
86
+ end
87
+ end
88
+
89
+ if current? # Standalone only configs
90
+
91
+ # By block iterator
92
+ config.pattern_iterator do |iterator|
93
+ iterator.key = :by_block
94
+
95
+ iterator.loop do |&pattern|
96
+ $nvm.blocks.each do |block|
97
+ pattern.call(block)
98
+ end
99
+ end
100
+
101
+ iterator.setup do |block|
102
+ blk = $nvm.find_block_by_id(block.id)
103
+ blk.select
104
+ blk
105
+ end
106
+
107
+ iterator.pattern_name do |name, block|
108
+ name.gsub('_bx', "_b#{block.id}")
109
+ end
110
+ end
111
+
112
+ # By setting iterator
113
+ config.pattern_iterator do |iterator|
114
+ iterator.key = :by_setting
115
+
116
+ iterator.loop do |settings, &pattern|
117
+ settings.each do |setting|
118
+ pattern.call(setting)
119
+ end
120
+ end
121
+
122
+ iterator.pattern_name do |name, setting|
123
+ name.gsub('_x', "_#{setting}")
124
+ end
125
+ end
126
+
127
+ end # standalone only configs
128
+
129
+ # Set up lint test
130
+ config.lint_test = {
131
+ # Require the lint tests to pass before allowing a release to proceed
132
+ :run_on_tag => true,
133
+ # Auto correct violations where possible whenever 'origen lint' is run
134
+ :auto_correct => true,
135
+ # Limit the testing for large legacy applications
136
+ #:level => :easy,
137
+ # Run on these directories/files by default
138
+ #:files => ["lib", "config/application.rb"],
139
+ }
140
+ end
@@ -0,0 +1,73 @@
1
+ # This file should be used to extend the origen command line tool with tasks
2
+ # specific to your application.
3
+ # The comments below should help to get started and you can also refer to
4
+ # lib/origen/commands.rb in your Origen core workspace for more examples and
5
+ # inspiration.
6
+ #
7
+ # Also see the official docs on adding commands:
8
+ # http://origen.freescale.net/origen/latest/guides/custom/commands/
9
+
10
+ # Map any command aliases here, for example to allow origen -x to refer to a
11
+ # command called execute you would add a reference as shown below:
12
+ aliases = {
13
+ # "-x" => "execute",
14
+ "g" => "generate"
15
+ }
16
+
17
+ # The requested command is passed in here as @command, this checks it against
18
+ # the above alias table and should not be removed.
19
+ @command = aliases[@command] || @command
20
+
21
+ # Now branch to the specific task code
22
+ case @command
23
+
24
+ # Run the unit tests
25
+ when "specs"
26
+ require "rspec"
27
+ exit RSpec::Core::Runner.run(['spec'])
28
+
29
+ # Run the example-based (diff) tests
30
+ when "examples", "test"
31
+ Origen.load_application
32
+ status = 0
33
+
34
+ Dir["#{Origen.root}/examples/*.rb"].each do |example|
35
+ require example
36
+ end
37
+
38
+ # Compiler tests
39
+ # ARGV = %w(templates/example.txt.erb -t debug -r approved)
40
+ # load "origen/commands/compile.rb"
41
+
42
+ if Origen.app.stats.changed_files == 0 &&
43
+ Origen.app.stats.new_files == 0 &&
44
+ Origen.app.stats.changed_patterns == 0 &&
45
+ Origen.app.stats.new_patterns == 0
46
+
47
+ Origen.app.stats.report_pass
48
+ else
49
+ Origen.app.stats.report_fail
50
+ status = 1
51
+ end
52
+ puts
53
+ if @command == "test"
54
+ Origen.app.unload_target!
55
+ require "rspec"
56
+ result = RSpec::Core::Runner.run(['spec'])
57
+ status = status == 1 ? 1 : result
58
+ end
59
+ exit status # Exit with a 1 on the event of a failure per std unix result codes
60
+
61
+ # Always leave an else clause to allow control to fall back through to the
62
+ # Origen command handler.
63
+ # You probably want to also add the command details to the help shown via
64
+ # origen -h, you can do this be assigning the required text to @application_commands
65
+ # before handing control back to Origen. Un-comment the example below to get started.
66
+ else
67
+ @application_commands = <<-EOT
68
+ specs Run the specs (tests), -c will enable coverage
69
+ examples Run the examples (tests), -c will enable coverage
70
+ test Run both specs and examples, -c will enable coverage
71
+ EOT
72
+
73
+ end
@@ -0,0 +1,12 @@
1
+ # This file is only loaded when the testers is running standalone,
2
+ # therefore anything required here will be loaded for development only
3
+ require "origen_testers/test/dut.rb"
4
+ require "origen_testers/test/block.rb"
5
+ require "origen_testers/test/dut2.rb"
6
+ require "origen_testers/test/nvm.rb"
7
+
8
+ require "origen_testers/test/j750_interface"
9
+ require "origen_testers/test/ultraflex_interface"
10
+ require "origen_testers/test/j750_hpt_interface"
11
+ require "origen_testers/test/v93k_interface"
12
+ require "origen_testers/test/basic_interface"
@@ -0,0 +1 @@
1
+ require "origen_testers"
@@ -0,0 +1,47 @@
1
+ # This file should be used to extend the origen command line tool with tasks
2
+ # specific to your application.
3
+ # The comments below should help to get started and you can also refer to
4
+ # lib/origen/commands.rb in your Origen core workspace for more examples and
5
+ # inspiration.
6
+ #
7
+ # Also see the official docs on adding commands:
8
+ # http://origen.freescale.net/origen/latest/guides/custom/commands/
9
+
10
+ # Map any command aliases here, for example to allow origen -x to refer to a
11
+ # command called execute you would add a reference as shown below:
12
+ aliases ={
13
+ "g" => "generate"
14
+ }
15
+
16
+ # The requested command is passed in here as @command, this checks it against
17
+ # the above alias table and should not be removed.
18
+ @command = aliases[@command] || @command
19
+
20
+ case @command
21
+
22
+ #when "latpc"
23
+ # require "#{Origen.root(:testers)}/lib/commands/latpc"
24
+ # Need to see if --compile is included and setup compiler
25
+ when "generate"
26
+ @application_options << ["--compile", "Compile the current pattern or the list"]
27
+ @application_options << ["-v", "--vector_comments", "Add the vector and cycle number to the vector comments"]
28
+ if ARGV.include?('--compile')
29
+ compiler_instance_name = ARGV[ARGV.index('--compile')+1]
30
+ if compiler_instance_name.nil?
31
+ $compiler = :use_app_default
32
+ else
33
+ ARGV.delete(compiler_instance_name)
34
+ $compiler = compiler_instance_name.to_sym
35
+ end
36
+ ARGV.delete("--compile")
37
+ end
38
+ $_testers_enable_vector_comments = ARGV.delete("-v") || ARGV.delete("--vector_comments")
39
+
40
+ when "testers:build"
41
+ require "#{Origen.root!}/lib/commands/build"
42
+ exit 0
43
+
44
+ else
45
+ @plugin_commands << " testers:build Build a test program from a collection of sub-programs"
46
+
47
+ end
data/config/users.rb ADDED
@@ -0,0 +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
data/config/version.rb ADDED
@@ -0,0 +1,8 @@
1
+ module OrigenTesters
2
+ MAJOR = 0
3
+ MINOR = 4
4
+ BUGFIX = 0
5
+ DEV = nil
6
+
7
+ VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
+ end
@@ -0,0 +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)
@@ -0,0 +1,23 @@
1
+ require 'origen'
2
+ require 'active_support/concern'
3
+ require 'require_all'
4
+
5
+ module OrigenTesters
6
+ autoload :VectorBasedTester, 'origen_testers/vector_based_tester'
7
+ autoload :Vector, 'origen_testers/vector'
8
+ autoload :VectorPipeline, 'origen_testers/vector_pipeline'
9
+ autoload :Interface, 'origen_testers/interface'
10
+ autoload :Generator, 'origen_testers/generator'
11
+ autoload :Parser, 'origen_testers/parser'
12
+ autoload :BasicTestSetups, 'origen_testers/basic_test_setups'
13
+ autoload :ProgramGenerators, 'origen_testers/program_generators'
14
+ # not yet autoload :Time, 'origen_testers/time'
15
+ end
16
+
17
+ require 'origen_testers/igxl_based_tester'
18
+ require 'origen_testers/smartest_based_tester'
19
+ require 'origen_testers/pattern_compilers'
20
+
21
+ require 'origen_testers/callback_handlers'
22
+ require_relative '../config/application.rb'
23
+ require_relative '../config/environment.rb'
@@ -0,0 +1,258 @@
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
+
15
+ def name
16
+ @name || self.class
17
+ end
18
+
19
+ def generate?
20
+ true
21
+ end
22
+
23
+ def generating_pattern?
24
+ @generating == :pattern
25
+ end
26
+
27
+ def generating_program?
28
+ @generating == :program
29
+ end
30
+
31
+ def pat_extension
32
+ @pat_extension || 'txt'
33
+ end
34
+ alias_method :pattern_extension, :pat_extension
35
+
36
+ def comment_char
37
+ @comment_char || '//'
38
+ end
39
+
40
+ def program_comment_char
41
+ @program_comment_char || comment_char
42
+ end
43
+
44
+ def pattern_header(*args)
45
+ end
46
+
47
+ def pattern_footer(*args)
48
+ end
49
+
50
+ def step_comment_prefix
51
+ @step_comment_prefix || '##'
52
+ end
53
+
54
+ def is_vector_based?
55
+ return @vector_based if defined?(@vector_based)
56
+ true
57
+ end
58
+
59
+ def is_command_based?
60
+ !is_vector_based?
61
+ end
62
+
63
+ def j750?
64
+ is_a?(OrigenTesters::IGXLBasedTester::J750)
65
+ end
66
+
67
+ def j750_hpt?
68
+ is_a?(OrigenTesters::IGXLBasedTester::J750_HPT)
69
+ end
70
+
71
+ def v93k?
72
+ is_a?(OrigenTesters::SmartestBasedTester::V93K)
73
+ end
74
+
75
+ def ultraflex?
76
+ is_a?(OrigenTesters::IGXLBasedTester::UltraFLEX)
77
+ end
78
+ alias_method :uflex?, :ultraflex?
79
+
80
+ def doc?
81
+ false
82
+ end
83
+
84
+ def annotate(msg, options = {})
85
+ end
86
+
87
+ # Ignore fails on the given pins for the duration of the given block, this
88
+ # has the effect of temporarily setting the states of the given pins to
89
+ # don't care.
90
+ def ignore_fails(*pins)
91
+ pins.each(&:suspend)
92
+ yield
93
+ pins.each(&:resume)
94
+ end
95
+
96
+ # Output a comment in the pattern, normally you would not call this directly
97
+ # and instead use these shorthand methods:
98
+ # cc "Some comment"
99
+ # ss "A single line step comment"
100
+ # step_comment do
101
+ # cc "A multi line"
102
+ # cc "step comment"
103
+ # end
104
+ def c1(msg, options = {})
105
+ prefix = comment_char + ' '
106
+ prefix += step_comment_prefix + ' ' if @step_comment_on
107
+ push_comment(prefix + msg.to_s)
108
+ end
109
+
110
+ def c2(msg, options = {})
111
+ c1(msg, options)
112
+ end
113
+
114
+ def pattern_section(msg)
115
+ if generating_program?
116
+ yield
117
+ else
118
+ step_comment(msg)
119
+ yield
120
+ end
121
+ end
122
+
123
+ def ss(msg = nil)
124
+ div = step_comment_prefix.length
125
+ div = 1 if div == 0
126
+ c1(step_comment_prefix * (70 / div))
127
+ @step_comment_on = true
128
+ if block_given?
129
+ yield
130
+ else
131
+ c1(msg)
132
+ end
133
+ @step_comment_on = false
134
+ c1(step_comment_prefix * (70 / div))
135
+ end
136
+
137
+ def snip(number, options = {})
138
+ yield
139
+ end
140
+
141
+ # Allows a section to be run without actually generating any vectors. This can be useful
142
+ # to ensure the pin states end up as they otherwise would have if the section had been run.
143
+ # Classic example of this is a subroutine pattern, wrap this around a call to the startup
144
+ # routine to ensure the pin states are as they would have been immediately after the startup.
145
+ # ==== Example
146
+ # # Setup state as if I had run startup without actually doing so
147
+ # $tester.inhibit_vectors_and_comments do
148
+ # $soc.startup
149
+ # $top.startup
150
+ # end
151
+ def inhibit_vectors_and_comments
152
+ inhibit_vectors = @inhibit_vectors
153
+ inhibit_comments = @inhibit_comments
154
+ @inhibit_vectors = true
155
+ @inhibit_comments = true
156
+ yield
157
+ @inhibit_vectors = inhibit_vectors # Restore to their initial state
158
+ @inhibit_comments = inhibit_comments
159
+ end
160
+
161
+ # Generate a vector.
162
+ # Calling this method will generate a vector in the output pattern based on the
163
+ # current pin states and timeset.
164
+ def cycle(options = {})
165
+ options = {
166
+ microcode: '',
167
+ timeset: current_timeset,
168
+ pin_vals: current_pin_vals,
169
+ repeat: nil
170
+ }.merge(options)
171
+
172
+ if any_clocks_running?
173
+ update_running_clocks
174
+ if options[:repeat]
175
+ slice_repeats(options).each do |slice|
176
+ options[:repeat] = slice[0]
177
+ delay(options.delete(:repeat), options) do |options|
178
+ push_vector(options)
179
+ end
180
+ slice[1].each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
181
+ options[:pin_vals] = current_pin_vals
182
+ end
183
+ else
184
+ push_vector(options)
185
+ pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
186
+ end
187
+ else
188
+ if options[:repeat]
189
+ delay(options.delete(:repeat), options) do |options|
190
+ push_vector(options)
191
+ end
192
+ else
193
+ push_vector(options)
194
+ end
195
+ end
196
+ end
197
+
198
+ def import_test_time(file, options = {})
199
+ puts "Sorry but an importer doesn't exist for: #{Origen.tester.class}"
200
+ end
201
+
202
+ def any_clocks_running?
203
+ @clocks_running.nil? ? false : @clocks_running.count > 0
204
+ end
205
+
206
+ def clocks_running
207
+ @clocks_running
208
+ end
209
+ alias_method :running_clocks, :clocks_running
210
+
211
+ def push_running_clock(pin)
212
+ @clocks_running.nil? ? @clocks_running = { pin.name.to_s => pin } : @clocks_running[pin.name.to_s] = pin
213
+ end
214
+
215
+ def pop_running_clock(pin)
216
+ fail "ERROR: No clocks running, doesn't make sense to pop one" unless any_clocks_running?
217
+ @clocks_running.delete(pin.name.to_s)
218
+ end
219
+
220
+ def slice_repeats(options = {})
221
+ slices = {}
222
+ repeat_ary = []
223
+ clocks_running.each do |name, clock_pin|
224
+ if clock_pin.next_edge < (cycle_count + options[:repeat])
225
+ pin_slices = (clock_pin.next_edge..(cycle_count + options[:repeat])).step(clock_pin.half_period).to_a
226
+ pin_slices.insert(0, cycle_count)
227
+ else
228
+ pin_slices = [cycle_count]
229
+ end
230
+ pin_slices.each do |cycle|
231
+ slices[cycle].nil? ? slices[cycle] = name : slices[cycle] = "#{slices[cycle]},#{name}"
232
+ end
233
+ slices[cycle_count + options[:repeat]] = '' if pin_slices[-1] != cycle_count + options[:repeat]
234
+ end
235
+ slices.keys.sort.each do |edge_cycles|
236
+ # puts "Toggle #{slices[edge_cycles]} on #{edge_cycles}"
237
+ repeat_ary.push([edge_cycles, slices[edge_cycles].split(',')])
238
+ end
239
+
240
+ (repeat_ary.count - 1).downto(1).each { |i| repeat_ary[i][0] = repeat_ary[i][0] - repeat_ary[i - 1][0] }
241
+ repeat_ary[1..-1]
242
+ end
243
+
244
+ def pins_need_toggling
245
+ toggle_ary = []
246
+ clocks_running.each do |name, clock_pin|
247
+ toggle_ary.push("#{name}") if clock_pin.next_edge == cycle_count
248
+ end
249
+ toggle_ary
250
+ end
251
+
252
+ def update_running_clocks
253
+ clocks_running.each do |name, clock_pin|
254
+ clock_pin.update_clock
255
+ end
256
+ end
257
+ end
258
+ end