origen 0.34.3 → 0.52.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 (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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fb9589bd8d0179a20919b1adf594cd400fa7f882
4
- data.tar.gz: e898d8031d277cc479d1c84ebc36c775f15b419e
2
+ SHA256:
3
+ metadata.gz: 66da9dd0e7daf45df9ed1b3296be702222ccfbdd9a7daa9d4258e13b8170a2d9
4
+ data.tar.gz: d4e0594b55959d9d98a8971f08e87d2fd62074f72076c21a5a75b3d667996638
5
5
  SHA512:
6
- metadata.gz: 54571cf52125b281cd1613800dde84b6c8ddb639076b7dd89328ebaed4c32e6d3e45c27723b4fb7b179c72ca59d278f986ff7b8b3da721542e27d06483fb7fa8
7
- data.tar.gz: fefb815678df5803d5f9f6b76de81ce52254455c3b7fd2a1e7d47e475bf99c98ac41611abbcd8a48fc1bffc765b76c8fdd7d4d4a63015a55dffcb9254631ac7a
6
+ metadata.gz: 25583f8f1033819423e649ddd3743e7b7a4a523b12724985e34b2b06d5dd83d3495e8eae9949cd5e6049b94548374a2c2ee3f9088815667a85c1d3e17633787a
7
+ data.tar.gz: e4d661a56516345b15ad2fa812fdb11ed171a3a067d6b5c86dc837bf4429c11244ab43ebe7677f9db16f442bf882aafbb7dcf2091cf4b14cfb0f14c86627e676
data/bin/origen CHANGED
@@ -1,232 +1,2 @@
1
1
  #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- require 'pathname'
5
- require 'fileutils'
6
- #require 'byebug' # Un-comment to debug this file
7
-
8
- class OrigenBootError < StandardError
9
- end
10
-
11
- # Keep a note of the pwd at the time when Origen was first loaded, this is initially used
12
- # by the site_config lookup.
13
- $_origen_invocation_pwd ||= Pathname.pwd
14
-
15
- load File.expand_path('../../lib/origen/operating_systems.rb', __FILE__)
16
- load File.expand_path('../../lib/origen/site_config.rb', __FILE__)
17
-
18
- # This will be referenced later in ruby_version_check, the origen used to launch
19
- # the process is different than the one that actually runs under bundler
20
- $origen_launch_root = Pathname.new(File.dirname(__FILE__)).parent
21
-
22
- # Override any influence from $LANG in the users environment
23
- Encoding.default_external = Encoding::UTF_8
24
- Encoding.default_internal = Encoding::UTF_8
25
- ENV['LC_ALL'] = nil
26
- ENV['LANG'] = nil
27
- ENV['LANG'] = 'en_US.UTF-8'
28
-
29
- # Work out what Origen.root is if we are running inside an Origen application, this will be
30
- # later used to execute from that app's bundle even if the origen executable lives somewhere
31
- # else (e.g. in the tools repository)
32
- app_config = File.join('config', 'application.rb')
33
- if File.exist?(app_config)
34
- origen_root = Dir.pwd
35
- else
36
- path = Pathname.new(Dir.pwd)
37
- until path.root? || origen_root
38
- if File.exist?(File.join(path, app_config))
39
- origen_root = path.to_s
40
- else
41
- path = path.parent
42
- end
43
- end
44
- end
45
-
46
- # If running inside an application workspace
47
- if origen_root
48
- # Force everyone to have a consistent way of installing gems with bundler
49
- ENV['BUNDLE_GEMFILE'] = File.join(origen_root, 'Gemfile')
50
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
51
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
52
-
53
- # If it looks like a bundled binstub of origen exists, and we have not been invoked through that,
54
- # then run that instead.
55
- if Origen.site_config.gem_manage_bundler && File.exist?("#{origen_root}/lbin/origen") && !ENV['BUNDLE_BIN_PATH'] &&
56
- File.exist?(File.expand_path(Origen.site_config.gem_install_dir))
57
- exec Gem.ruby, "#{origen_root}/lbin/origen", *ARGV
58
- exit 0
59
- end
60
-
61
- boot_app = true
62
-
63
- # If running outside an application and a user or central tool Origen bundle is to be used
64
- elsif Origen.site_config.gem_manage_bundler && (Origen.site_config.user_install_enable || Origen.site_config.tool_repo_install_dir)
65
- # Force everyone to have a consistent way of installing gems with bundler.
66
- # In this case, we aren't running from an Origen application, so build everything at Origen.home instead
67
- # Have two options here: if user_install_enable is true, use user_install_dir. Otherwise, use the tool_repo_install_dir
68
- Origen.site_config.user_install_enable ? origen_root = File.expand_path(Origen.site_config.user_install_dir) : origen_root = File.expand_path(Origen.site_config.tool_repo_install_dir)
69
- unless Dir.exists?(origen_root)
70
- load File.expand_path('../../lib/origen/utility/input_capture.rb', __FILE__)
71
- include Origen::Utility::InputCapture
72
-
73
- puts "Root directory '#{origen_root}' does not exist. Would you like to create it?"
74
- if get_text(confirm: :return_boolean)
75
- FileUtils.mkdir(origen_root)
76
- else
77
- puts "Exiting with creating Origen install"
78
- exit!
79
- end
80
- end
81
-
82
- gemfile = File.join(origen_root, 'Gemfile')
83
- unless File.exists?(gemfile)
84
- # Create a default Gemfile that can be further customized by the user.
85
- # Initial Gemfile only requires Origen. Nothing else. Essentially a blank installation.
86
- Dir.chdir(origen_root) do
87
- `bundle init`
88
- end
89
- # The above will give a general Gemfile from Bundler. We'll just append "gem 'origen' to the end.
90
- File.open(gemfile, 'a') do |f|
91
- f << "gem 'origen'\n"
92
- end
93
- end
94
- ENV['BUNDLE_GEMFILE'] = gemfile
95
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
96
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
97
-
98
- origen_exec = File.join(ENV['BUNDLE_BIN'], 'origen')
99
-
100
- # If the user/tool bundle already exists but we have not been invoked through that, abort this thread
101
- # and re-launch under the required bundler environment
102
- if File.exist?(origen_exec) && !ENV['BUNDLE_BIN_PATH'] && File.exist?(ENV['BUNDLE_PATH'])
103
- exec Gem.ruby, origen_exec, *ARGV
104
- exit 0
105
- else
106
- boot_app = false
107
- end
108
- end
109
-
110
- if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_manage_bundler && (boot_app || Origen.site_config.user_install_enable || Origen.site_config.tool_repo_install_dir)
111
- # Overriding bundler here so that bundle install can be automated as required
112
- require 'bundler/shared_helpers'
113
- if Bundler::SharedHelpers.in_bundle?
114
- require 'bundler'
115
- if STDOUT.tty?
116
- begin
117
- fail OrigenBootError unless File.exist?(ENV['BUNDLE_BIN'])
118
- Bundler.setup
119
- fail OrigenBootError unless File.exist?(ENV['BUNDLE_BIN'])
120
- rescue Gem::LoadError, Bundler::BundlerError, OrigenBootError => e
121
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
122
- # puts cmd
123
- puts 'Installing required gems...'
124
- puts
125
- `chmod o-w #{origen_root}` # Stops some annoying world writable warnings during install
126
- `chmod o-w #{origen_root}/bin` if File.exist?("#{origen_root}/bin")
127
- `chmod o-w #{origen_root}/.bin` if File.exist?("#{origen_root}/.bin")
128
- result = false
129
-
130
- Bundler.with_clean_env do
131
- if Origen.os.unix?
132
- if Origen.site_config.gem_build_switches
133
- Origen.site_config.gem_build_switches.each do |switches|
134
- `bundle config build.#{switches}`
135
- end
136
- end
137
- end
138
- result = system(cmd)
139
- end
140
- `chmod o-w #{ENV['BUNDLE_BIN']}`
141
- # Make .bat versions of all executables, Bundler should really be doing this when running
142
- # on windows
143
- if Origen.os.windows?
144
- bat_present = File.exist? "#{origen_root}/lbin/origen.bat"
145
- Dir.glob("#{origen_root}/lbin/*").each do |bin|
146
- unless bin =~ /.bat$/
147
- bat = "#{bin}.bat"
148
- unless File.exist?(bat)
149
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
150
- end
151
- end
152
- end
153
- if !bat_present && !result
154
- puts 'Some Windows specific updates to your workspace were required, please re-run the last command'
155
- exit 0
156
- end
157
- end
158
- if result
159
- exec "origen #{ARGV.join(' ')}"
160
- exit 0
161
- else
162
- puts
163
- puts "If you have just updated a gem version and are now getting an error that Bundler cannot find compatible versions for it then first try running 'bundle update <gemname>'."
164
- puts "For example if you have just changed the version of origen_core run 'bundle update origen_core'."
165
- exit 1
166
- end
167
- end
168
- else
169
- Bundler.setup
170
- end
171
- end
172
- require 'bundler/setup'
173
- require 'origen'
174
- else
175
- $LOAD_PATH.unshift "#{File.expand_path(File.dirname(__FILE__))}/../lib"
176
- require 'origen'
177
- end
178
-
179
- begin
180
- # If this script has been invoked from within an Origen application then open
181
- # up all commands, if not then only allow the command to create a new Origen
182
- # application.
183
- if origen_root && boot_app
184
- require 'origen/commands'
185
- else
186
- require 'origen/commands_global'
187
- end
188
- rescue Exception => e
189
- # A formatted stack dump will not be printed if the application ends via 'exit 0' or 'exit 1'. In that
190
- # case the application code is responsible for printing a helpful error message.
191
- # This will intercept all other exits, e.g. via 'fail "Something has done wrong"', and split the stack
192
- # dump to separate all in-application references from Origen core/plugin references.
193
- if e.is_a?(SystemExit)
194
- exit e.status
195
- else
196
- puts
197
- if Origen.app_loaded?
198
- puts 'COMPLETE CALL STACK'
199
- puts '-------------------'
200
- puts e.message unless e.is_a?(SystemExit)
201
- puts e.backtrace
202
-
203
- puts
204
- puts 'APPLICATION CALL STACK'
205
- puts '----------------------'
206
- puts e.message unless e.is_a?(SystemExit)
207
- # Only print out the application stack trace by default, if verbose logging is
208
- # enabled then output the full thing
209
- e.backtrace.each do |line|
210
- path = Pathname.new(line)
211
- if path.absolute?
212
- if line =~ /^#{Origen.root}/ && line !~ /^#{Origen.root}\/lbin/
213
- puts line
214
- end
215
- else
216
- puts line unless line =~ /^.\/lbin/
217
- end
218
- end
219
- else
220
- puts 'COMPLETE CALL STACK'
221
- puts '-------------------'
222
- puts e.message unless e.is_a?(SystemExit)
223
- puts e.backtrace
224
- end
225
- exit 1
226
- end
227
- ensure
228
- if Origen.app_loaded?
229
- Origen.app.listeners_for(:on_origen_shutdown).each(&:on_origen_shutdown)
230
- Origen.app.runner.shutdown
231
- end
232
- end
2
+ load File.expand_path('../../lib/origen/boot.rb', __FILE__)
@@ -38,7 +38,8 @@ class OrigenCoreApplication < Origen::Application
38
38
 
39
39
  #config.lsf.project = "origen core"
40
40
 
41
- config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/origen"
41
+ config.web_directory = "https://github.com/Origen-SDK/Origen-SDK.github.io.git/origen"
42
+ #config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/origen"
42
43
  config.web_domain = "http://origen-sdk.org/origen"
43
44
 
44
45
  config.pattern_prefix = "nvm"
@@ -78,13 +79,13 @@ class OrigenCoreApplication < Origen::Application
78
79
  iterator.key = :by_block
79
80
 
80
81
  iterator.loop do |&pattern|
81
- $nvm.blocks.each do |block|
82
+ dut.nvm.blocks.each do |block|
82
83
  pattern.call(block)
83
84
  end
84
85
  end
85
86
 
86
87
  iterator.setup do |block|
87
- blk = $nvm.find_block_by_id(block.id)
88
+ blk = dut.nvm.find_block_by_id(block.id)
88
89
  blk.select
89
90
  blk
90
91
  end
@@ -119,6 +120,14 @@ class OrigenCoreApplication < Origen::Application
119
120
  end
120
121
  end
121
122
 
123
+ def before_release_gem
124
+ Dir.chdir Origen.root do
125
+ FileUtils.rm_rf('origen_app_generators') if File.exist?('origen_app_generators')
126
+ FileUtils.cp_r(Origen.app(:origen_app_generators).root, 'origen_app_generators')
127
+ FileUtils.rm_rf(File.join('origen_app_generators', '.git'))
128
+ end
129
+ end
130
+
122
131
  # Ensure that all tests pass before allowing a release to continue
123
132
  def validate_release
124
133
  if !system("origen specs") || !system("origen examples")
data/config/boot.rb CHANGED
@@ -1,8 +1,3 @@
1
- # Interfaces must be required, can't autoload
2
- require "c99/ate_interface"
3
- # The majority of this class is defined in the support application,
4
- # this is to test that the importing application can override and
5
- # extend imported classes.
6
- require_relative "../lib/c99/nvm"
7
-
8
1
  require_relative "../helpers/guides"
2
+
3
+ require "#{Origen.root(:origen_sim)}/config/boot"
data/config/commands.rb CHANGED
@@ -15,83 +15,12 @@ when "tags"
15
15
  exit 0
16
16
 
17
17
  when "specs"
18
+ Origen.app.session.origen_core[:mode] = 'debug'
18
19
  require "rspec"
19
-
20
- options = {}
21
- opt_parser = OptionParser.new do |opts|
22
- opts.banner = [
23
- 'Run the specs unit tests',
24
- 'Usage: origen specs [filename_substrings...] [options]',
25
- "Note: all files must reside in #{Origen.app.root}/specs for filename substrings",
26
- "E.g.: origen specs site_config #=> runs only specs in filenames matching 'site_config'"
27
- ].join("\n")
28
- opts.on('-h', '--help', 'Show this help message') do |h|
29
- puts opt_parser
30
- exit!
31
- end
32
- end
33
- opt_parser.parse! ARGV
34
-
35
- # Search for the filenames given.
36
- spec_files = ARGV.map do |file|
37
- f = Pathname.new(file)
38
- dir = Origen.app.root.join('spec')
39
-
40
- # Find any files that match the name. Include all these files.
41
- # Note that this will map a string to an array, so we'll flatten the array later.
42
- # Also, we'll only search for .rb files in spec. Append that to the glob if no file ext is provided.
43
- if f.exist? && f.extname == '.rb'
44
- # This is a hard-coded path. Don't glob this, just make sure its witin the spec directory.
45
- File.expand_path(f)
46
- elsif f.extname == '.rb'
47
- # Search includes the extension, so don't add it.
48
- # (limited to .rb files)
49
- Dir.glob(dir.join("**/*#{f}"))
50
- else
51
- # Search for matching ruby files.
52
- # (limited to .rb files)
53
- Dir.glob(dir.join("**/*#{f}*.rb"))
54
- end
55
- end
56
- spec_files.flatten!
57
-
58
- if ARGV.empty?
59
- # No filename substrings given. Run all *_spec files in spec/ directory
60
- spec_files = ['spec']
61
- elsif spec_files.empty? && !ARGV.empty?
62
- # The spec files to run is empty, but file substring were given.
63
- # Report that no files were found and exit.
64
- Origen.app!.fail!(message: "No matching spec files could be found at #{Origen.app.root}/spec for patterns: #{ARGV.join(', ')}")
65
- else
66
- # Filename substrings were given and matching files were found. List the files just for user awareness.
67
- Origen.log.info "Found matching specs files for patterns: #{ARGV.join(', ')}"
68
- spec_files.each { |f| Origen.log.info(f) }
69
- end
70
-
71
- current_mode = Origen.mode.instance_variable_get(:@current_mode)
72
- Origen.mode = :debug
73
- Origen.app.session.origen_core[:mode] = Origen.mode.to_s
74
- begin
75
- status = RSpec::Core::Runner.run(spec_files)
76
- rescue SystemExit => e
77
- Origen.log.error "Unexpected SystemExit reached. Reporting failure status..."
78
- status = 1
79
- end
80
- Origen.mode = current_mode
81
- Origen.app.session.origen_core[:mode] = Origen.mode.to_s
82
-
83
- # One kind of confusing thing is that Specs can still print the 'pass'/'success' verbiage even when it actually failed.
84
- # This is due to rspec itself catching the errors, so there's no exception to catch from outside Rspec.
85
- # Most likely the user will see red and see that nothing was actually run, but print a reassuring message from Origen saying that the specs actually failed,
86
- # despite what Rspec's verbiage says.
87
- if status == 1
88
- Origen.log.error "Some errors occurred outside of the examples: received exit status 1 (failure). Please review RSpec output for details."
89
- end
90
-
91
- exit(status)
20
+ exit RSpec::Core::Runner.run(['spec'])
92
21
 
93
22
  when "examples", "test"
94
- Origen.load_application
23
+ Origen.app.session.origen_core[:mode] = 'debug'
95
24
  status = 0
96
25
  Dir["#{Origen.root}/examples/*.rb"].each do |example|
97
26
  require example
@@ -269,3 +269,7 @@ Rails/ScopeArgs:
269
269
  Rails/Validation:
270
270
  Description: 'Use validates :attribute, hash of validations.'
271
271
  Enabled: false
272
+
273
+ Style/ClassAndModuleChildren:
274
+ Description: 'Checks style of children classes and modules.'
275
+ Enabled: false
@@ -78,10 +78,6 @@ Style/CharacterLiteral:
78
78
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
79
79
  Enabled: true
80
80
 
81
- Style/ClassAndModuleChildren:
82
- Description: 'Checks style of children classes and modules.'
83
- Enabled: true
84
-
85
81
  Style/ClassCheck:
86
82
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
87
83
  Enabled: true
@@ -245,3 +245,7 @@ Rails/ScopeArgs:
245
245
  Rails/Validation:
246
246
  Description: 'Use validates :attribute, hash of validations.'
247
247
  Enabled: false
248
+
249
+ Style/ClassAndModuleChildren:
250
+ Description: 'Checks style of children classes and modules.'
251
+ Enabled: false
@@ -88,10 +88,6 @@ Style/CharacterLiteral:
88
88
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
89
89
  Enabled: true
90
90
 
91
- Style/ClassAndModuleChildren:
92
- Description: 'Checks style of children classes and modules.'
93
- Enabled: true
94
-
95
91
  Style/ClassCheck:
96
92
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
97
93
  Enabled: true
data/config/version.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
- MINOR = 34
4
- BUGFIX = 3
3
+ MINOR = 52
4
+ BUGFIX = 0
5
5
  DEV = nil
6
-
7
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
7
  end
data/lib/origen.rb CHANGED
@@ -12,8 +12,10 @@ unless defined? RGen::ORIGENTRANSITION
12
12
  # by the site_config lookup.
13
13
  $_origen_invocation_pwd ||= Pathname.pwd
14
14
  require 'fileutils'
15
- require 'origen/site_config'
16
- require 'origen/operating_systems'
15
+ # Force these to re-load since they could have been loaded from an earlier version of Origen during boot
16
+ load 'origen/loader.rb'
17
+ load 'origen/site_config.rb'
18
+ load 'origen/operating_systems.rb'
17
19
  require 'origen/core_ext'
18
20
  require 'origen/acronyms'
19
21
  require 'origen/callbacks'
@@ -24,11 +26,13 @@ unless defined? RGen::ORIGENTRANSITION
24
26
  require 'origen/remote_manager'
25
27
  require 'origen/utility'
26
28
  require 'origen/logger_methods'
27
- require 'option_parser/optparse'
29
+ require 'origen/core_ext/option_parser/optparse'
28
30
  require 'bundler'
29
31
  require 'origen/undefined'
30
32
  require 'origen/componentable'
31
33
 
34
+ autoload :PatSeq, 'origen/generator/pattern_sequencer'
35
+
32
36
  module Origen
33
37
  autoload :Features, 'origen/features'
34
38
  autoload :Bugs, 'origen/bugs'
@@ -74,17 +78,14 @@ unless defined? RGen::ORIGENTRANSITION
74
78
 
75
79
  APP_CONFIG = File.join('config', 'application.rb')
76
80
 
77
- class OrigenError < StandardError
78
- def self.status_code(code)
79
- define_method(:status_code) { code }
80
- end
81
- end
82
-
83
- class PerforceError < OrigenError; status_code(11); end
84
- class GitError < OrigenError; status_code(11); end
85
- class DesignSyncError < OrigenError; status_code(12); end
86
- class RevisionControlUninitializedError < OrigenError; status_code(13); end
87
- class SyntaxError < OrigenError; status_code(14); end
81
+ class OrigenError < StandardError; end
82
+ class PerforceError < OrigenError; end
83
+ class GitError < OrigenError; end
84
+ class DesignSyncError < OrigenError; end
85
+ class RevisionControlUninitializedError < OrigenError; end
86
+ class SyntaxError < OrigenError; end
87
+ class BinStrValError < OrigenError; end
88
+ class HexStrValError < OrigenError; end
88
89
 
89
90
  class << self
90
91
  include Origen::Utility::TimeAndDate
@@ -290,6 +291,7 @@ unless defined? RGen::ORIGENTRANSITION
290
291
 
291
292
  # Returns true if Origen is running in an application workspace
292
293
  def in_app_workspace?
294
+ return @in_app_workspace if defined? @in_app_workspace
293
295
  @in_app_workspace ||= begin
294
296
  path = Pathname.new(Dir.pwd)
295
297
  until path.root? || File.exist?(File.join(path, APP_CONFIG))
@@ -660,6 +662,10 @@ unless defined? RGen::ORIGENTRANSITION
660
662
  @running_remotely = val
661
663
  end
662
664
 
665
+ def running_simulation?
666
+ !!(defined?(OrigenSim) && Origen.tester && Origen.tester.sim?)
667
+ end
668
+
663
669
  # Returns true if Origen is running interactively. That is, the command was 'origen i'
664
670
  def running_interactively?
665
671
  !!@running_interactively
@@ -776,6 +782,13 @@ unless defined? RGen::ORIGENTRANSITION
776
782
  end
777
783
  end
778
784
 
785
+ # OS agnostic split of a caller line into file and line number
786
+ def split_caller_line(line)
787
+ arr = line.split(':')
788
+ arr[0] = arr[0] + ':' + arr.delete_at(1) if Origen.os.windows?
789
+ arr
790
+ end
791
+
779
792
  private
780
793
 
781
794
  def current_command=(val)