origen 0.34.3 → 0.52.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +5 -5
  2. data/bin/origen +1 -231
  3. data/config/application.rb +12 -3
  4. data/config/boot.rb +2 -7
  5. data/config/commands.rb +3 -74
  6. data/config/rubocop/easy_disabled.yml +4 -0
  7. data/config/rubocop/easy_enabled.yml +0 -4
  8. data/config/rubocop/strict_disabled.yml +4 -0
  9. data/config/rubocop/strict_enabled.yml +0 -4
  10. data/config/version.rb +2 -3
  11. data/lib/origen.rb +27 -14
  12. data/lib/origen/application.rb +88 -2
  13. data/lib/origen/application/deployer.rb +3 -1
  14. data/lib/origen/application/release.rb +2 -2
  15. data/lib/origen/application/runner.rb +35 -20
  16. data/lib/origen/boot.rb +302 -0
  17. data/lib/origen/boot/api.rb +13 -0
  18. data/lib/origen/boot/app.rb +284 -0
  19. data/lib/origen/code_generators.rb +30 -10
  20. data/lib/origen/code_generators/actions.rb +244 -34
  21. data/lib/origen/code_generators/base.rb +9 -2
  22. data/lib/origen/code_generators/block.rb +203 -0
  23. data/lib/origen/code_generators/block_common.rb +100 -0
  24. data/lib/origen/code_generators/dut.rb +62 -0
  25. data/lib/origen/code_generators/feature.rb +50 -0
  26. data/lib/origen/code_generators/klass.rb +41 -0
  27. data/lib/origen/code_generators/model.rb +60 -0
  28. data/lib/origen/code_generators/module.rb +92 -0
  29. data/lib/origen/commands.rb +30 -13
  30. data/lib/origen/commands/archive.rb +175 -0
  31. data/lib/origen/commands/extract.rb +43 -0
  32. data/lib/origen/commands/generate.rb +1 -0
  33. data/lib/origen/commands/lint.rb +6 -1
  34. data/lib/origen/commands/new.rb +48 -24
  35. data/lib/origen/commands/new_resource.rb +41 -0
  36. data/lib/origen/commands/site.rb +52 -0
  37. data/lib/origen/commands/web.rb +11 -6
  38. data/lib/origen/commands_global.rb +9 -7
  39. data/lib/origen/core_ext/numeric.rb +20 -0
  40. data/lib/{option_parser → origen/core_ext/option_parser}/optparse.rb +0 -0
  41. data/lib/origen/dependencies.rb +0 -0
  42. data/lib/origen/file_handler.rb +18 -6
  43. data/lib/origen/generator.rb +19 -10
  44. data/lib/origen/generator/comparator.rb +2 -1
  45. data/lib/origen/generator/flow.rb +3 -1
  46. data/lib/origen/generator/job.rb +60 -16
  47. data/lib/origen/generator/pattern.rb +132 -72
  48. data/lib/origen/generator/pattern_finder.rb +3 -3
  49. data/lib/origen/generator/pattern_sequence.rb +201 -0
  50. data/lib/origen/generator/pattern_sequencer.rb +99 -0
  51. data/lib/origen/generator/pattern_thread.rb +175 -0
  52. data/lib/origen/loader.rb +381 -0
  53. data/lib/origen/log.rb +250 -108
  54. data/lib/origen/model.rb +22 -1
  55. data/lib/origen/model/exporter.rb +50 -10
  56. data/lib/origen/model_initializer.rb +5 -1
  57. data/lib/origen/operating_systems.rb +4 -0
  58. data/lib/origen/parameters.rb +96 -4
  59. data/lib/origen/parameters/set.rb +4 -3
  60. data/lib/origen/pins.rb +10 -8
  61. data/lib/origen/pins/pin.rb +61 -46
  62. data/lib/origen/ports/port.rb +5 -0
  63. data/lib/origen/registers.rb +5 -0
  64. data/lib/origen/registers/bit.rb +57 -53
  65. data/lib/origen/registers/bit_collection.rb +100 -43
  66. data/lib/origen/registers/msb0_delegator.rb +47 -0
  67. data/lib/origen/registers/reg.rb +114 -99
  68. data/lib/origen/revision_control.rb +1 -1
  69. data/lib/origen/revision_control/git.rb +23 -3
  70. data/lib/origen/site_config.rb +251 -60
  71. data/lib/origen/site_config/config.rb +217 -0
  72. data/lib/origen/sub_blocks.rb +106 -31
  73. data/lib/origen/top_level.rb +11 -0
  74. data/lib/origen/users/user.rb +3 -2
  75. data/lib/origen/utility/mailer.rb +42 -9
  76. data/lib/origen/value/bin_str_val.rb +1 -1
  77. data/lib/origen/value/hex_str_val.rb +1 -1
  78. data/lib/origen/version_string.rb +6 -1
  79. data/lib/tasks/gem.rake +6 -1
  80. data/origen_app_generators/Gemfile +19 -0
  81. data/origen_app_generators/Gemfile.lock +152 -0
  82. data/origen_app_generators/LICENSE +21 -0
  83. data/origen_app_generators/README.md +368 -0
  84. data/{templates/code_generators/rakefile.rb → origen_app_generators/Rakefile} +0 -0
  85. data/origen_app_generators/bin/boot.rb +39 -0
  86. data/origen_app_generators/config/application.rb +153 -0
  87. data/origen_app_generators/config/boot.rb +1 -0
  88. data/origen_app_generators/config/commands.rb +63 -0
  89. data/origen_app_generators/config/shared_commands.rb +177 -0
  90. data/origen_app_generators/config/version.rb +8 -0
  91. data/origen_app_generators/doc/history +223 -0
  92. data/origen_app_generators/lbin/bundle +105 -0
  93. data/origen_app_generators/lbin/byebug +29 -0
  94. data/origen_app_generators/lbin/coderay +29 -0
  95. data/origen_app_generators/lbin/htmldiff +29 -0
  96. data/origen_app_generators/lbin/httparty +29 -0
  97. data/origen_app_generators/lbin/httpclient +29 -0
  98. data/origen_app_generators/lbin/kramdown +29 -0
  99. data/origen_app_generators/lbin/ldiff +29 -0
  100. data/origen_app_generators/lbin/nanoc +29 -0
  101. data/origen_app_generators/lbin/nokogiri +29 -0
  102. data/origen_app_generators/lbin/origen +62 -0
  103. data/origen_app_generators/lbin/pry +29 -0
  104. data/origen_app_generators/lbin/rackup +29 -0
  105. data/origen_app_generators/lbin/rake +29 -0
  106. data/origen_app_generators/lbin/rspec +29 -0
  107. data/origen_app_generators/lbin/rubocop +29 -0
  108. data/origen_app_generators/lbin/ruby-parse +29 -0
  109. data/origen_app_generators/lbin/ruby-rewrite +29 -0
  110. data/origen_app_generators/lbin/thor +29 -0
  111. data/origen_app_generators/lbin/tilt +29 -0
  112. data/origen_app_generators/lbin/yard +29 -0
  113. data/origen_app_generators/lbin/yardoc +29 -0
  114. data/origen_app_generators/lbin/yri +29 -0
  115. data/origen_app_generators/lib/origen_app_generators.rb +125 -0
  116. data/origen_app_generators/lib/origen_app_generators/application.rb +62 -0
  117. data/origen_app_generators/lib/origen_app_generators/base.rb +257 -0
  118. data/origen_app_generators/lib/origen_app_generators/empty_application.rb +15 -0
  119. data/origen_app_generators/lib/origen_app_generators/empty_plugin.rb +15 -0
  120. data/origen_app_generators/lib/origen_app_generators/new.rb +170 -0
  121. data/origen_app_generators/lib/origen_app_generators/new_app_tests.rb +4 -0
  122. data/origen_app_generators/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +107 -0
  123. data/origen_app_generators/lib/origen_app_generators/plugin.rb +55 -0
  124. data/origen_app_generators/lib/origen_app_generators/test_engineering/common.rb +29 -0
  125. data/origen_app_generators/lib/origen_app_generators/test_engineering/stand_alone_application.rb +64 -0
  126. data/origen_app_generators/lib/origen_app_generators/test_engineering/test_block.rb +61 -0
  127. data/origen_app_generators/origen_app_generators.gemspec +33 -0
  128. data/{templates/code_generators → origen_app_generators/spec}/spec_helper.rb +0 -0
  129. data/origen_app_generators/target/debug.rb +8 -0
  130. data/origen_app_generators/target/default.rb +8 -0
  131. data/origen_app_generators/target/production.rb +0 -0
  132. data/origen_app_generators/templates/app_generators/application/.gitignore +37 -0
  133. data/origen_app_generators/templates/app_generators/application/.irbrc +9 -0
  134. data/origen_app_generators/templates/app_generators/application/.rspec +1 -0
  135. data/origen_app_generators/templates/app_generators/application/.travis.yml +11 -0
  136. data/origen_app_generators/templates/app_generators/application/Gemfile +34 -0
  137. data/origen_app_generators/templates/app_generators/application/Rakefile +7 -0
  138. data/origen_app_generators/templates/app_generators/application/app/blocks/top_level.rb +12 -0
  139. data/origen_app_generators/templates/app_generators/application/app/lib/module.rb +6 -0
  140. data/origen_app_generators/templates/app_generators/application/app/templates/web/index.md.erb +19 -0
  141. data/origen_app_generators/templates/app_generators/application/app/templates/web/layouts/_basic.html.erb +13 -0
  142. data/origen_app_generators/templates/app_generators/application/app/templates/web/partials/_navbar.html.erb +20 -0
  143. data/origen_app_generators/templates/app_generators/application/app/templates/web/release_notes.md.erb +5 -0
  144. data/origen_app_generators/templates/app_generators/application/config/application.rb +121 -0
  145. data/origen_app_generators/templates/app_generators/application/config/boot.rb +4 -0
  146. data/origen_app_generators/templates/app_generators/application/config/commands.rb +79 -0
  147. data/origen_app_generators/templates/app_generators/application/config/maillist_dev.txt +4 -0
  148. data/origen_app_generators/templates/app_generators/application/config/maillist_prod.txt +3 -0
  149. data/origen_app_generators/templates/app_generators/application/config/version.rb +8 -0
  150. data/origen_app_generators/templates/app_generators/application/doc/history +0 -0
  151. data/origen_app_generators/templates/app_generators/application/dot_keep +0 -0
  152. data/origen_app_generators/templates/app_generators/application/origen_core_session +2 -0
  153. data/origen_app_generators/templates/app_generators/application/spec/spec_helper.rb +44 -0
  154. data/origen_app_generators/templates/app_generators/application/target/debug.rb +8 -0
  155. data/origen_app_generators/templates/app_generators/application/target/default.rb +1 -0
  156. data/origen_app_generators/templates/app_generators/application/target/production.rb +4 -0
  157. data/origen_app_generators/templates/app_generators/new/generator.rb +102 -0
  158. data/origen_app_generators/templates/app_generators/new/info.md.erb +9 -0
  159. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/application.rb +54 -0
  160. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/base.rb +55 -0
  161. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/module.rb +28 -0
  162. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/plugin.rb +64 -0
  163. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +6 -0
  164. data/origen_app_generators/templates/app_generators/plugin/Gemfile +32 -0
  165. data/origen_app_generators/templates/app_generators/plugin/Rakefile +10 -0
  166. data/origen_app_generators/templates/app_generators/plugin/app/templates/web/index.md.erb +37 -0
  167. data/origen_app_generators/templates/app_generators/plugin/app/templates/web/partials/_navbar_external.html.erb +20 -0
  168. data/origen_app_generators/templates/app_generators/plugin/app/templates/web/partials/_navbar_internal.html.erb +20 -0
  169. data/origen_app_generators/templates/app_generators/plugin/config/boot.rb +24 -0
  170. data/origen_app_generators/templates/app_generators/plugin/gemspec.rb +43 -0
  171. data/origen_app_generators/templates/app_generators/test_engineering/environment/j750.rb +1 -0
  172. data/origen_app_generators/templates/app_generators/test_engineering/environment/uflex.rb +1 -0
  173. data/origen_app_generators/templates/app_generators/test_engineering/environment/v93k.rb +1 -0
  174. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/.keep +0 -0
  175. data/origen_app_generators/templates/app_generators/test_engineering/test_block/.keep +0 -0
  176. data/origen_site_config.yml +55 -5
  177. data/templates/code_generators/attributes.rb +20 -0
  178. data/templates/code_generators/class.rb +9 -0
  179. data/templates/code_generators/controller.rb +87 -0
  180. data/templates/code_generators/model.rb +21 -0
  181. data/templates/code_generators/module.rb +4 -0
  182. data/templates/code_generators/parameters.rb +19 -0
  183. data/templates/code_generators/pins.rb +28 -0
  184. data/templates/code_generators/registers.rb +20 -0
  185. data/templates/code_generators/sub_blocks.rb +24 -0
  186. data/templates/code_generators/timesets.rb +24 -0
  187. data/templates/code_generators/version.rb +0 -1
  188. data/templates/git/gitignore.erb +0 -1
  189. data/vendor/lib/models/origen/export1.rb +77 -0
  190. data/vendor/lib/models/origen/export1/block1.rb +13 -0
  191. data/vendor/lib/models/origen/export1/block1/x.rb +36 -0
  192. data/vendor/lib/models/origen/non_origen_meta_data.md +1 -0
  193. metadata +149 -68
  194. data/bin/fix_my_workspace +0 -100
  195. data/lib/c99/ate_interface.rb +0 -77
  196. data/lib/c99/nvm.rb +0 -110
  197. data/lib/c99/target/mock2.rb +0 -1
  198. data/lib/c99/target/subdir/mock3.rb +0 -1
  199. data/lib/origen/code_generators/bundler.rb +0 -17
  200. data/lib/origen/code_generators/gem_setup.rb +0 -49
  201. data/lib/origen/code_generators/rake.rb +0 -13
  202. data/lib/origen/code_generators/rspec.rb +0 -12
  203. data/lib/origen/commands/add.rb +0 -12
  204. data/lib/tasks/private/build.rake +0 -8
  205. data/templates/code_generators/gemfile_app.rb +0 -4
  206. data/templates/code_generators/gemfile_plugin.rb +0 -6
  207. data/templates/code_generators/gemspec.rb +0 -33
@@ -0,0 +1,34 @@
1
+ <% if (@audience != :external) && (Origen.site_config.gem_server_pull || Origen.site_config.gem_server) -%>
2
+ <% Array(Origen.site_config.gem_server_pull || Origen.site_config.gem_server).each do |server| -%>
3
+ source '<%= server %>'
4
+ <% end -%>
5
+ <% else %>
6
+ source 'https://rubygems.org'
7
+ <% end -%>
8
+
9
+ gem 'origen', '>= <%= @latest_origen_version %>'
10
+
11
+ gem 'origen_doc_helpers'
12
+ <% if @development_dependencies -%>
13
+ <% @development_dependencies.each do |dep| -%>
14
+ gem <%= dep.map{ |d| "\"#{d}\"" }.join(', ') %>
15
+ <% end -%>
16
+ <% end -%>
17
+
18
+ gem 'byebug', '~>8' # You can remove this version constraint if you don't care about your app
19
+ # supporting earlier versions of Ruby 2
20
+ <% if RUBY_VERSION < "2.3.0" -%>
21
+
22
+ # Lock this version of nokogiri to enable compatibility with Ruby 2.2, if you don't need
23
+ # that then you can remove this line
24
+ gem 'nokogiri', '1.8.5'
25
+ <% end -%>
26
+ <% if (@audience != :external) && Origen.site_config.gem_push_plugins -%>
27
+ <% Array(Origen.site_config.gem_push_plugins).each do |plugin| -%>
28
+ gem <%= plugin.map{ |d| "\"#{d}\"" }.join(', ') %>
29
+ <% end -%>
30
+ <% end -%>
31
+
32
+ # Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
33
+ #gem 'ruby-debug-ide'
34
+ #gem 'debase'
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/<%= @name %>.rake, and they will automatically
3
+ # be available to Rake.
4
+ require "bundler/setup"
5
+ require "origen"
6
+
7
+ Origen.app.load_tasks
@@ -0,0 +1,12 @@
1
+ module <%= @namespace %>
2
+ class TopLevel
3
+ # A simple method to get you going, to see this in action run a console session like this:
4
+ #
5
+ # origen i
6
+ #
7
+ # > dut.hi
8
+ def hi
9
+ puts "Hello master!"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ require 'origen'
2
+ <% if @type == :plugin -%>
3
+ require_relative '../../config/application.rb'
4
+ <% end -%>
5
+ module <%= @namespace %>
6
+ end
@@ -0,0 +1,19 @@
1
+ % render "layouts/basic.html" do
2
+
3
+ %# HTML tags can be embedded in mark down files if you want to do specific custom
4
+ %# formatting like this, but in most cases that is not required.
5
+ <h1><%= Origen.app.namespace %> <span style="font-size: 14px">(<%= Origen.app.version %>)</span></h1>
6
+
7
+ ### Purpose
8
+
9
+ This application...
10
+
11
+ ### How To Use
12
+
13
+ Add quickstart documentation here...
14
+
15
+ ### How To Setup the Application Environment
16
+
17
+ Describe how a user would setup a new workspace for this application...
18
+
19
+ % end
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: <%= options[:title] || Origen.config.name %>
3
+ ---
4
+ <%= render "partials/navbar.html", tab: options[:tab] %>
5
+
6
+ <div class="row">
7
+ %# The markdown attribute is important if you are going to include content written
8
+ %# in markdown, without this is will be included verbatim
9
+ <div class="span12" markdown="1">
10
+ <%= yield %>
11
+
12
+ </div>
13
+ </div>
@@ -0,0 +1,20 @@
1
+ <nav class="navbar navbar-inverse navbar-fixed-top">
2
+ <div class="container">
3
+ <div class="navbar-header">
4
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
5
+ <span class="sr-only">Toggle navigation</span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ <span class="icon-bar"></span>
9
+ </button>
10
+ <a class="navbar-brand" href="<%= path "/" %>">Home</a>
11
+ </div>
12
+ <div id="navbar" class="collapse navbar-collapse">
13
+ <ul class="nav navbar-nav">
14
+ <li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
15
+ <li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
16
+ </ul>
17
+ <%= import "origen/web/logo.html" %>
18
+ </div><!--/.nav-collapse -->
19
+ </div>
20
+ </nav>
@@ -0,0 +1,5 @@
1
+ % render "layouts/basic.html", tab: :release do
2
+
3
+ <%= render "#{Origen.root}/doc/history" %>
4
+
5
+ % end
@@ -0,0 +1,121 @@
1
+ require 'origen'
2
+ class <%= @namespace %>Application < Origen::Application
3
+ # See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
4
+ # for a full list of the configuration options available
5
+
6
+ # These attributes should never be changed, the duplication here will be resolved in future
7
+ # by condensing these attributes that do similar things
8
+ self.name = '<%= @name %>'
9
+ self.namespace = '<%= @namespace %>'
10
+ config.name = '<%= @name %>'
11
+ config.initials = '<%= @namespace %>'
12
+ # Change this to point to the revision control repository for this <%= @type %>
13
+ <% if @audience == :external -%>
14
+ # config.rc_url = "ssh://git@github.com:myaccount/<%= @name %>.git"
15
+ <% else -%>
16
+ # config.rc_url = "ssh://git@sw-stash.mycompany.net/myproject/<%= @name %>.git"
17
+ <% end -%>
18
+ <% if @audience == :external -%>
19
+ config.release_externally = true
20
+ <% end -%>
21
+
22
+ # To enable deployment of your documentation to a web server (via the 'origen web'
23
+ # command) fill in these attributes.
24
+ <% if @audience == :external -%>
25
+ # config.web_directory = 'git@github.com:Origen-SDK/Origen-SDK.github.io.git/<%= @name %>'
26
+ # config.web_domain = 'http://origen-sdk.org/<%= @name %>'
27
+ <% else -%>
28
+ # config.web_directory = '/path/to/server/<%= @name %>'
29
+ # config.web_domain = 'http://origen.mycompany.net/<%= @name %>'
30
+ <% end -%>
31
+
32
+ # When false Origen will be less strict about checking for some common coding errors,
33
+ # it is recommended that you leave this to true for better feedback and easier debug.
34
+ # This will be the default setting in Origen v3.
35
+ config.strict_errors = true
36
+
37
+ # See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
38
+ config.lint_test = {
39
+ # Require the lint tests to pass before allowing a release to proceed
40
+ run_on_tag: true,
41
+ # Auto correct violations where possible whenever 'origen lint' is run
42
+ auto_correct: true,
43
+ # Run on these directories/files by default
44
+ files: ['app', 'config/application.rb']
45
+ }
46
+
47
+ config.semantically_version = true
48
+
49
+ # An example of how to set application specific LSF parameters
50
+ # config.lsf.project = "msg.te"
51
+
52
+ # An example of how to specify a prefix to add to all generated patterns
53
+ # config.pattern_prefix = "nvm"
54
+
55
+ # An example of how to add header comments to all generated patterns
56
+ # config.pattern_header do
57
+ # cc "This is a pattern created by the example origen application"
58
+ # end
59
+
60
+ # By default all generated output will end up in ./output.
61
+ # Here you can specify an alternative directory entirely, or make it dynamic such that
62
+ # the output ends up in a setup specific directory.
63
+ # config.output_directory do
64
+ # "#{Origen.root}/output/#{$dut.class}"
65
+ # end
66
+
67
+ # Similarly for the reference files, generally you want to setup the reference directory
68
+ # structure to mirror that of your output directory structure.
69
+ # config.reference_directory do
70
+ # "#{Origen.root}/.ref/#{$dut.class}"
71
+ # end
72
+
73
+ # This will automatically deploy your documentation after every tag
74
+ # def after_release_email(tag, note, type, selector, options)
75
+ # command = "origen web compile --remote --api"
76
+ # Dir.chdir Origen.root do
77
+ # system command
78
+ # end
79
+ # end
80
+ <% if @validate_release_tests -%>
81
+ # Ensure that all tests pass before allowing a release to continue
82
+ def validate_release
83
+ if <%= Array(@validate_release_tests).map { |t| "!system('#{t}')" }.join(' || ') %>
84
+ puts "Sorry but you can't release with failing tests, please fix them and try again."
85
+ exit 1
86
+ else
87
+ puts 'All tests passing, proceeding with release process!'
88
+ end
89
+ end
90
+ <% else -%>
91
+ # Ensure that all tests pass before allowing a release to continue
92
+ # def validate_release
93
+ # if !system('origen specs') || !system('origen examples')
94
+ # puts "Sorry but you can't release with failing tests, please fix them and try again."
95
+ # exit 1
96
+ # else
97
+ # puts 'All tests passing, proceeding with release process!'
98
+ # end
99
+ # end
100
+ <% end -%>
101
+
102
+ # To enabled source-less pattern generation create a class (for example PatternDispatcher)
103
+ # to generate the pattern. This should return false if the requested pattern has been
104
+ # dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
105
+ # def before_pattern_lookup(requested_pattern)
106
+ # PatternDispatcher.new.dispatch_or_return(requested_pattern)
107
+ # end
108
+
109
+ # If you use pattern iterators you may come across the case where you request a pattern
110
+ # like this:
111
+ # origen g example_pat_b0.atp
112
+ #
113
+ # However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
114
+ # In the case where the pattern cannot be found Origen will pass the name to this translator
115
+ # if it exists, and here you can make any substitutions to help Origen find the file you
116
+ # want. In this example any instances of _b\d, where \d means a number, are replaced by
117
+ # _bx.
118
+ # config.pattern_name_translator do |name|
119
+ # name.gsub(/_b\d/, "_bx")
120
+ # end
121
+ end
@@ -0,0 +1,4 @@
1
+ # This file will be loaded by Origen to boot your application, just leave it as
2
+ # is and modify lib/<%= @name %>.rb to load the additional resources that your
3
+ # application requires
4
+ require "<%= @name %>"
@@ -0,0 +1,79 @@
1
+ # This file should be used to extend the origen with application specific commands
2
+
3
+ # Map any command aliases here, for example to allow 'origen ex' to refer to a
4
+ # command called execute you would add a reference as shown below:
5
+ aliases ={
6
+ # "ex" => "execute",
7
+ }
8
+
9
+ # The requested command is passed in here as @command, this checks it against
10
+ # the above alias table and should not be removed.
11
+ @command = aliases[@command] || @command
12
+
13
+ # Now branch to the specific task code
14
+ case @command
15
+
16
+ # (Working) example of how to create an application specific comment, here to generate
17
+ # a tags file for you application to enable method definition lookup and similar within
18
+ # editors/IDEs
19
+ when "tags"
20
+ # Here the logic is just written in-line, alternatively it could be written in a
21
+ # dedicated file and required here, e.g.
22
+ #require "<%= @name %>/commands/my_command" # Would load file lib/<%= @name %>/commands/my_command.rb
23
+ Dir.chdir Origen.root do
24
+ system("ripper-tags -R")
25
+ end
26
+ # You must always exit upon successfully capturing and executing a command to prevent
27
+ # control flowing back to Origen
28
+ exit 0
29
+
30
+ ## Example of how to make a command to run unit tests, this simply invokes RSpec on
31
+ ## the spec directory
32
+ #when "specs"
33
+ # require "rspec"
34
+ # exit RSpec::Core::Runner.run(['spec'])
35
+
36
+ ## Example of how to make a command to run diff-based tests
37
+ #when "examples", "test"
38
+ # Origen.load_application
39
+ # status = 0
40
+ #
41
+ # # Compiler tests
42
+ # ARGV = %w(templates/example.txt.erb -t debug -r approved)
43
+ # load "origen/commands/compile.rb"
44
+ # # Pattern generator tests
45
+ # #ARGV = %w(some_pattern -t debug -r approved)
46
+ # #load "#{Origen.top}/lib/origen/commands/generate.rb"
47
+ #
48
+ # if Origen.app.stats.changed_files == 0 &&
49
+ # Origen.app.stats.new_files == 0 &&
50
+ # Origen.app.stats.changed_patterns == 0 &&
51
+ # Origen.app.stats.new_patterns == 0
52
+ #
53
+ # Origen.app.stats.report_pass
54
+ # else
55
+ # Origen.app.stats.report_fail
56
+ # status = 1
57
+ # end
58
+ # puts
59
+ # if @command == "test"
60
+ # Origen.app.unload_target!
61
+ # require "rspec"
62
+ # result = RSpec::Core::Runner.run(['spec'])
63
+ # status = status == 1 ? 1 : result
64
+ # end
65
+ # exit status # Exit with a 1 on the event of a failure per std unix result codes
66
+
67
+ # Always leave an else clause to allow control to fall back through to the
68
+ # Origen command handler.
69
+ else
70
+ # You probably want to also add the your commands to the help shown via
71
+ # origen -h, you can do this by assigning the required text to @application_commands
72
+ # before handing control back to Origen.
73
+ @application_commands = <<-EOT
74
+ tags Build a tags file for this app
75
+ EOT
76
+ # specs Run the specs (tests), -c will enable coverage
77
+ # examples Run the examples (tests), -c will enable coverage
78
+ # test Run both specs and examples, -c will enable coverage
79
+ end
@@ -0,0 +1,4 @@
1
+ # Any email addresses listed here will be automatically sent an email whenever you
2
+ # run 'origen rc tag'
3
+ # See here for more info: http://origen-sdk.org/origen/guides/misc/users/#Maillists
4
+ <%= User.current.email %>
@@ -0,0 +1,3 @@
1
+ # Any email addresses listed here will be automatically sent an email whenever you
2
+ # run 'origen rc tag' and select a PRODUCTION release
3
+ # See here for more info: http://origen-sdk.org/origen/guides/misc/users/#Maillists
@@ -0,0 +1,8 @@
1
+ module <%= @namespace %>
2
+ MAJOR = 0
3
+ MINOR = 1
4
+ BUGFIX = 0
5
+ DEV = nil
6
+
7
+ VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
+ end
@@ -0,0 +1,2 @@
1
+ {: refresh_interval_in_minutesiA: modeI"
2
+ debug:EF
@@ -0,0 +1,44 @@
1
+ $VERBOSE=nil # Don't care about world writable dir warnings and the like
2
+
3
+ require 'pathname'
4
+ if File.exist? File.expand_path("../Gemfile", Pathname.new(__FILE__).realpath)
5
+ require 'rubygems'
6
+ require 'bundler/setup'
7
+ else
8
+ # If running on windows, can't use Origen helpers 'till we load it...
9
+ if RUBY_PLATFORM == 'i386-mingw32'
10
+ `where origen`.split("\n").find do |match|
11
+ match =~ /(.*)\\bin\\origen$/
12
+ end
13
+ origen_top = $1.gsub("\\", "/")
14
+ else
15
+ origen_top = `which origen`.strip.sub("/bin/origen", "")
16
+ end
17
+
18
+ $LOAD_PATH.unshift "#{origen_top}/lib"
19
+ end
20
+
21
+ require "origen"
22
+
23
+ require "rspec/legacy_formatters"
24
+ require "#{Origen.top}/spec/format/origen_formatter"
25
+ require "byebug"
26
+ require 'pry'
27
+
28
+ def load_target(target="default")
29
+ Origen.target.switch_to target
30
+ Origen.target.load!
31
+ end
32
+
33
+ RSpec.configure do |config|
34
+ config.formatter = OrigenFormatter
35
+ # rspec-expectations config goes here. You can use an alternate
36
+ # assertion/expectation library such as wrong or the stdlib/minitest
37
+ # assertions if you prefer.
38
+ config.expect_with :rspec do |expectations|
39
+ # Enable only the newer, non-monkey-patching expect syntax.
40
+ # For more details, see:
41
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
42
+ expectations.syntax = :should
43
+ end
44
+ end
@@ -0,0 +1,8 @@
1
+ # Production mode will require that there are no modified files in the workspace
2
+ # and any other conditions that you add to your application.
3
+ # Normally production targets define the target and then debug targets
4
+ # are setup to load the production target before switching Origen to debug
5
+ # mode as shown below.
6
+ load "#{Origen.root}/target/production.rb"
7
+
8
+ Origen.mode = :debug
@@ -0,0 +1 @@
1
+ # Use this file to instantiate the device model you are targeting
@@ -0,0 +1,4 @@
1
+ # The target file is run before *every* Origen operation and is used to instantiate
2
+ # the runtime environment - usually this means instantiating a top-level SoC or
3
+ # IP model.
4
+ <%= @namespace %>::TopLevel.new # Instantiate a DUT instance
@@ -0,0 +1,102 @@
1
+ module <%= @namespace %>
2
+ module <%= @domain_namespace %>
3
+ # Generates a generic application shell
4
+ class <%= @classname %> < <%= @parentclass %>
5
+
6
+ desc "<%= @summary %>"
7
+
8
+ # Any methods that are not protected will get invoked in the order that they are
9
+ # defined when the generator is run, method naming is irrelevant unless you want
10
+ # to override a method that is defined by the parent class
11
+
12
+ def get_user_input
13
+ # The methods to get the common user input that applies to all applications will
14
+ # get called at the start automatically, you have a chance here to ask any additional
15
+ # questions that are specific to the type of application being generated.
16
+ # See the following links for some examples of how to ask questions:
17
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/base.rb#L94
18
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/plugin.rb#L44
19
+ end
20
+
21
+ def generate_files
22
+ # Calling this will build all files, directories and symlinks contained in the
23
+ # hash returned by the filelist method below
24
+ build_filelist
25
+ end
26
+
27
+ def modify_files
28
+ # Here you can add or remove things post-generation.
29
+ # Alternatively, you can copy any master file to the equivalent sub-directory of
30
+ # templates/app_generators/<%= @domain_namespace.underscore %>/<%= @classname.underscore %>
31
+ # and this will override the version in the master directory.
32
+ #
33
+ # However, post generation modification is recommended when possible since it means that your
34
+ # generated applications will automatically stay up to date with any improvements made to the
35
+ # master file.
36
+ # The downside is that creating a post-generation modification takes a bit more effort to create
37
+ # compared to simply copying and modifying the file manually.
38
+ # To help with creating modifications, you have access to all of the Thor Action methods described here:
39
+ # http://www.rubydoc.info/github/wycats/thor/Thor/Actions
40
+ # See the enable method for an example of using these here:
41
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/new.rb#L25
42
+ end
43
+
44
+ def conclude
45
+ # Print out anything you think the user should know about their new application at the end
46
+ puts "New app created at: #{destination_root}"
47
+ end
48
+
49
+ protected
50
+
51
+ # Defines the filelist for the generator, the default list is inherited from the
52
+ # parent class (<%= @namespace %>::<%= @parentclass %>).
53
+ # <% if @parentclass == 'Plugin' -%>
54
+ # Since this is a plugin generator, the default list of files comprises the application list,
55
+ # which you can see here:
56
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/application.rb
57
+ # And this is then modified by the base plugin generator which you can see here:
58
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/plugin.rb
59
+ # Additionally, this application could have made further modifications to the default list
60
+ # within lib/<%= @namespace.underscore %>/plugin.rb
61
+ <% else %>
62
+ # See here for the default list of files included in an application:
63
+ # https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/application.rb
64
+ # Additionally, this application could have made further modifications to the default list
65
+ # within lib/<%= @namespace.underscore %>/application.rb
66
+ <% end -%>
67
+ #
68
+ # The filelist can contain references to generate files, directories or symlinks in the
69
+ # new application.
70
+ #
71
+ # To make your generator more maintainable, try and re-use as much as possible
72
+ # from the parent generator, this means that your generators will automatically stay up
73
+ # to date with the latest conventions.
74
+ #
75
+ # Additional files can be added or removed from the filelist as shown below.
76
+ def filelist
77
+ @filelist ||= begin
78
+ list = super # Always pick up the parent list
79
+ # Example of how to remove a file from the parent list
80
+ # list.delete(:web_doc_layout)
81
+ # Example of how to add a file, in this case the file will be compiled and copied to
82
+ # the same location in the new app
83
+ # list[:config_shared_commands] = { source: 'config/shared_commands.rb' }
84
+ # Alternatively specifying a different destination, typically you would do this when
85
+ # the final location is dynamic
86
+ # list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
87
+ # Example of how to create a directory
88
+ # list[:pattern_dir] = { dest: "pattern", type: :directory }
89
+ # By default, directories created in this way will contain a .keep file, to inhibit this:
90
+ # list[:pattern_dir] = { dest: "pattern", type: :directory, nokeep: true }
91
+ # Example of how to create a symlink
92
+ # list[:target_default] = { source: 'debug.rb', # Relative to the file being linked to
93
+ # dest: 'target/default.rb', # Relative to destination_root
94
+ # type: :symlink }
95
+ # Remember to return the final list
96
+ list
97
+ end
98
+ end
99
+
100
+ end
101
+ end
102
+ end