origen 0.34.3 → 0.52.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/origen +1 -231
- data/config/application.rb +12 -3
- data/config/boot.rb +2 -7
- data/config/commands.rb +3 -74
- data/config/rubocop/easy_disabled.yml +4 -0
- data/config/rubocop/easy_enabled.yml +0 -4
- data/config/rubocop/strict_disabled.yml +4 -0
- data/config/rubocop/strict_enabled.yml +0 -4
- data/config/version.rb +2 -3
- data/lib/origen.rb +27 -14
- data/lib/origen/application.rb +88 -2
- data/lib/origen/application/deployer.rb +3 -1
- data/lib/origen/application/release.rb +2 -2
- data/lib/origen/application/runner.rb +35 -20
- data/lib/origen/boot.rb +302 -0
- data/lib/origen/boot/api.rb +13 -0
- data/lib/origen/boot/app.rb +284 -0
- data/lib/origen/code_generators.rb +30 -10
- data/lib/origen/code_generators/actions.rb +244 -34
- data/lib/origen/code_generators/base.rb +9 -2
- data/lib/origen/code_generators/block.rb +203 -0
- data/lib/origen/code_generators/block_common.rb +100 -0
- data/lib/origen/code_generators/dut.rb +62 -0
- data/lib/origen/code_generators/feature.rb +50 -0
- data/lib/origen/code_generators/klass.rb +41 -0
- data/lib/origen/code_generators/model.rb +60 -0
- data/lib/origen/code_generators/module.rb +92 -0
- data/lib/origen/commands.rb +30 -13
- data/lib/origen/commands/archive.rb +175 -0
- data/lib/origen/commands/extract.rb +43 -0
- data/lib/origen/commands/generate.rb +1 -0
- data/lib/origen/commands/lint.rb +6 -1
- data/lib/origen/commands/new.rb +48 -24
- data/lib/origen/commands/new_resource.rb +41 -0
- data/lib/origen/commands/site.rb +52 -0
- data/lib/origen/commands/web.rb +11 -6
- data/lib/origen/commands_global.rb +9 -7
- data/lib/origen/core_ext/numeric.rb +20 -0
- data/lib/{option_parser → origen/core_ext/option_parser}/optparse.rb +0 -0
- data/lib/origen/dependencies.rb +0 -0
- data/lib/origen/file_handler.rb +18 -6
- data/lib/origen/generator.rb +19 -10
- data/lib/origen/generator/comparator.rb +2 -1
- data/lib/origen/generator/flow.rb +3 -1
- data/lib/origen/generator/job.rb +60 -16
- data/lib/origen/generator/pattern.rb +132 -72
- data/lib/origen/generator/pattern_finder.rb +3 -3
- data/lib/origen/generator/pattern_sequence.rb +201 -0
- data/lib/origen/generator/pattern_sequencer.rb +99 -0
- data/lib/origen/generator/pattern_thread.rb +175 -0
- data/lib/origen/loader.rb +381 -0
- data/lib/origen/log.rb +250 -108
- data/lib/origen/model.rb +22 -1
- data/lib/origen/model/exporter.rb +50 -10
- data/lib/origen/model_initializer.rb +5 -1
- data/lib/origen/operating_systems.rb +4 -0
- data/lib/origen/parameters.rb +96 -4
- data/lib/origen/parameters/set.rb +4 -3
- data/lib/origen/pins.rb +10 -8
- data/lib/origen/pins/pin.rb +61 -46
- data/lib/origen/ports/port.rb +5 -0
- data/lib/origen/registers.rb +5 -0
- data/lib/origen/registers/bit.rb +57 -53
- data/lib/origen/registers/bit_collection.rb +100 -43
- data/lib/origen/registers/msb0_delegator.rb +47 -0
- data/lib/origen/registers/reg.rb +114 -99
- data/lib/origen/revision_control.rb +1 -1
- data/lib/origen/revision_control/git.rb +23 -3
- data/lib/origen/site_config.rb +251 -60
- data/lib/origen/site_config/config.rb +217 -0
- data/lib/origen/sub_blocks.rb +106 -31
- data/lib/origen/top_level.rb +11 -0
- data/lib/origen/users/user.rb +3 -2
- data/lib/origen/utility/mailer.rb +42 -9
- data/lib/origen/value/bin_str_val.rb +1 -1
- data/lib/origen/value/hex_str_val.rb +1 -1
- data/lib/origen/version_string.rb +6 -1
- data/lib/tasks/gem.rake +6 -1
- data/origen_app_generators/Gemfile +19 -0
- data/origen_app_generators/Gemfile.lock +152 -0
- data/origen_app_generators/LICENSE +21 -0
- data/origen_app_generators/README.md +368 -0
- data/{templates/code_generators/rakefile.rb → origen_app_generators/Rakefile} +0 -0
- data/origen_app_generators/bin/boot.rb +39 -0
- data/origen_app_generators/config/application.rb +153 -0
- data/origen_app_generators/config/boot.rb +1 -0
- data/origen_app_generators/config/commands.rb +63 -0
- data/origen_app_generators/config/shared_commands.rb +177 -0
- data/origen_app_generators/config/version.rb +8 -0
- data/origen_app_generators/doc/history +223 -0
- data/origen_app_generators/lbin/bundle +105 -0
- data/origen_app_generators/lbin/byebug +29 -0
- data/origen_app_generators/lbin/coderay +29 -0
- data/origen_app_generators/lbin/htmldiff +29 -0
- data/origen_app_generators/lbin/httparty +29 -0
- data/origen_app_generators/lbin/httpclient +29 -0
- data/origen_app_generators/lbin/kramdown +29 -0
- data/origen_app_generators/lbin/ldiff +29 -0
- data/origen_app_generators/lbin/nanoc +29 -0
- data/origen_app_generators/lbin/nokogiri +29 -0
- data/origen_app_generators/lbin/origen +62 -0
- data/origen_app_generators/lbin/pry +29 -0
- data/origen_app_generators/lbin/rackup +29 -0
- data/origen_app_generators/lbin/rake +29 -0
- data/origen_app_generators/lbin/rspec +29 -0
- data/origen_app_generators/lbin/rubocop +29 -0
- data/origen_app_generators/lbin/ruby-parse +29 -0
- data/origen_app_generators/lbin/ruby-rewrite +29 -0
- data/origen_app_generators/lbin/thor +29 -0
- data/origen_app_generators/lbin/tilt +29 -0
- data/origen_app_generators/lbin/yard +29 -0
- data/origen_app_generators/lbin/yardoc +29 -0
- data/origen_app_generators/lbin/yri +29 -0
- data/origen_app_generators/lib/origen_app_generators.rb +125 -0
- data/origen_app_generators/lib/origen_app_generators/application.rb +62 -0
- data/origen_app_generators/lib/origen_app_generators/base.rb +257 -0
- data/origen_app_generators/lib/origen_app_generators/empty_application.rb +15 -0
- data/origen_app_generators/lib/origen_app_generators/empty_plugin.rb +15 -0
- data/origen_app_generators/lib/origen_app_generators/new.rb +170 -0
- data/origen_app_generators/lib/origen_app_generators/new_app_tests.rb +4 -0
- data/origen_app_generators/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +107 -0
- data/origen_app_generators/lib/origen_app_generators/plugin.rb +55 -0
- data/origen_app_generators/lib/origen_app_generators/test_engineering/common.rb +29 -0
- data/origen_app_generators/lib/origen_app_generators/test_engineering/stand_alone_application.rb +64 -0
- data/origen_app_generators/lib/origen_app_generators/test_engineering/test_block.rb +61 -0
- data/origen_app_generators/origen_app_generators.gemspec +33 -0
- data/{templates/code_generators → origen_app_generators/spec}/spec_helper.rb +0 -0
- data/origen_app_generators/target/debug.rb +8 -0
- data/origen_app_generators/target/default.rb +8 -0
- data/origen_app_generators/target/production.rb +0 -0
- data/origen_app_generators/templates/app_generators/application/.gitignore +37 -0
- data/origen_app_generators/templates/app_generators/application/.irbrc +9 -0
- data/origen_app_generators/templates/app_generators/application/.rspec +1 -0
- data/origen_app_generators/templates/app_generators/application/.travis.yml +11 -0
- data/origen_app_generators/templates/app_generators/application/Gemfile +34 -0
- data/origen_app_generators/templates/app_generators/application/Rakefile +7 -0
- data/origen_app_generators/templates/app_generators/application/app/blocks/top_level.rb +12 -0
- data/origen_app_generators/templates/app_generators/application/app/lib/module.rb +6 -0
- data/origen_app_generators/templates/app_generators/application/app/templates/web/index.md.erb +19 -0
- data/origen_app_generators/templates/app_generators/application/app/templates/web/layouts/_basic.html.erb +13 -0
- data/origen_app_generators/templates/app_generators/application/app/templates/web/partials/_navbar.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/application/app/templates/web/release_notes.md.erb +5 -0
- data/origen_app_generators/templates/app_generators/application/config/application.rb +121 -0
- data/origen_app_generators/templates/app_generators/application/config/boot.rb +4 -0
- data/origen_app_generators/templates/app_generators/application/config/commands.rb +79 -0
- data/origen_app_generators/templates/app_generators/application/config/maillist_dev.txt +4 -0
- data/origen_app_generators/templates/app_generators/application/config/maillist_prod.txt +3 -0
- data/origen_app_generators/templates/app_generators/application/config/version.rb +8 -0
- data/origen_app_generators/templates/app_generators/application/doc/history +0 -0
- data/origen_app_generators/templates/app_generators/application/dot_keep +0 -0
- data/origen_app_generators/templates/app_generators/application/origen_core_session +2 -0
- data/origen_app_generators/templates/app_generators/application/spec/spec_helper.rb +44 -0
- data/origen_app_generators/templates/app_generators/application/target/debug.rb +8 -0
- data/origen_app_generators/templates/app_generators/application/target/default.rb +1 -0
- data/origen_app_generators/templates/app_generators/application/target/production.rb +4 -0
- data/origen_app_generators/templates/app_generators/new/generator.rb +102 -0
- data/origen_app_generators/templates/app_generators/new/info.md.erb +9 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/application.rb +54 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/base.rb +55 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/module.rb +28 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/plugin.rb +64 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +6 -0
- data/origen_app_generators/templates/app_generators/plugin/Gemfile +32 -0
- data/origen_app_generators/templates/app_generators/plugin/Rakefile +10 -0
- data/origen_app_generators/templates/app_generators/plugin/app/templates/web/index.md.erb +37 -0
- data/origen_app_generators/templates/app_generators/plugin/app/templates/web/partials/_navbar_external.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/plugin/app/templates/web/partials/_navbar_internal.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/plugin/config/boot.rb +24 -0
- data/origen_app_generators/templates/app_generators/plugin/gemspec.rb +43 -0
- data/origen_app_generators/templates/app_generators/test_engineering/environment/j750.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/environment/uflex.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/environment/v93k.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/.keep +0 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/.keep +0 -0
- data/origen_site_config.yml +55 -5
- data/templates/code_generators/attributes.rb +20 -0
- data/templates/code_generators/class.rb +9 -0
- data/templates/code_generators/controller.rb +87 -0
- data/templates/code_generators/model.rb +21 -0
- data/templates/code_generators/module.rb +4 -0
- data/templates/code_generators/parameters.rb +19 -0
- data/templates/code_generators/pins.rb +28 -0
- data/templates/code_generators/registers.rb +20 -0
- data/templates/code_generators/sub_blocks.rb +24 -0
- data/templates/code_generators/timesets.rb +24 -0
- data/templates/code_generators/version.rb +0 -1
- data/templates/git/gitignore.erb +0 -1
- data/vendor/lib/models/origen/export1.rb +77 -0
- data/vendor/lib/models/origen/export1/block1.rb +13 -0
- data/vendor/lib/models/origen/export1/block1/x.rb +36 -0
- data/vendor/lib/models/origen/non_origen_meta_data.md +1 -0
- metadata +149 -68
- data/bin/fix_my_workspace +0 -100
- data/lib/c99/ate_interface.rb +0 -77
- data/lib/c99/nvm.rb +0 -110
- data/lib/c99/target/mock2.rb +0 -1
- data/lib/c99/target/subdir/mock3.rb +0 -1
- data/lib/origen/code_generators/bundler.rb +0 -17
- data/lib/origen/code_generators/gem_setup.rb +0 -49
- data/lib/origen/code_generators/rake.rb +0 -13
- data/lib/origen/code_generators/rspec.rb +0 -12
- data/lib/origen/commands/add.rb +0 -12
- data/lib/tasks/private/build.rake +0 -8
- data/templates/code_generators/gemfile_app.rb +0 -4
- data/templates/code_generators/gemfile_plugin.rb +0 -6
- data/templates/code_generators/gemspec.rb +0 -33
@@ -21,6 +21,7 @@ opt_parser = OptionParser.new do |opts|
|
|
21
21
|
opts.on('--doc', 'Generate into doc format') { options[:doc] = true }
|
22
22
|
opts.on('--html', 'Generate into html format') { options[:html] = true }
|
23
23
|
opts.on('--nocom', 'No comments in the generated pattern') { options[:no_comments] = true }
|
24
|
+
opts.on('-seq', '--sequence NAME', String, 'Generate multiple patterns into a single concurrent pattern sequence') { |o| options[:sequence] = o }
|
24
25
|
opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
|
25
26
|
opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
|
26
27
|
# Apply any application option extensions to the OptionParser
|
data/lib/origen/commands/lint.rb
CHANGED
@@ -32,7 +32,12 @@ if ARGV.empty?
|
|
32
32
|
if Origen.config.lint_test[:files]
|
33
33
|
files = Origen.config.lint_test[:files].map { |f| "#{Origen.root}/#{f}" }.join(' ')
|
34
34
|
else
|
35
|
-
files =
|
35
|
+
files = []
|
36
|
+
['lib', 'app/lib', 'app/blocks'].each do |sub_dir|
|
37
|
+
dir = "#{Origen.root}/#{sub_dir}"
|
38
|
+
files << dir if File.exist?(dir)
|
39
|
+
end
|
40
|
+
files = files.join(' ')
|
36
41
|
end
|
37
42
|
else
|
38
43
|
files = ARGV.join(' ')
|
data/lib/origen/commands/new.rb
CHANGED
@@ -62,10 +62,15 @@ else
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
generators = [['
|
65
|
+
generators = [['https://rubygems.org', 'origen_app_generators']] + Array(Origen.site_config.app_generators)
|
66
|
+
|
67
|
+
def use_packaged_generators
|
68
|
+
puts "Using origen_app_generators that was packaged with Origen #{Origen.version}"
|
69
|
+
FileUtils.cp_r Origen.top.join('origen_app_generators').to_s, '.'
|
70
|
+
FileUtils.mv 'origen_app_generators', '0'
|
71
|
+
end
|
66
72
|
|
67
73
|
if update_required
|
68
|
-
puts 'Fetching the latest app generators...'
|
69
74
|
FileUtils.rm_rf(generators_dir) if File.exist?(generators_dir)
|
70
75
|
FileUtils.mkdir_p(generators_dir)
|
71
76
|
|
@@ -73,47 +78,66 @@ if update_required
|
|
73
78
|
generators.each_with_index do |gen, i|
|
74
79
|
# If a reference to a gem from a gem server
|
75
80
|
if gen.is_a?(Array)
|
76
|
-
|
81
|
+
begin
|
82
|
+
print "Determining the latest version of #{gen[1]}..."
|
83
|
+
response = HTTParty.get("#{gen[0]}/api/v1/dependencies.json?gems=#{gen[1]}", timeout: 2)
|
77
84
|
|
78
|
-
if response.success?
|
79
|
-
latest_version = JSON.parse(response.body).map { |v| v['number'] }.max
|
80
|
-
|
81
|
-
response = HTTParty.get("#{gen[0]}/gems/#{gen[1]}-#{latest_version}.gem")
|
82
85
|
if response.success?
|
83
|
-
|
84
|
-
|
86
|
+
latest_version = JSON.parse(response.body).map { |v| v['number'] }.max
|
87
|
+
puts latest_version.to_s
|
88
|
+
|
89
|
+
url = "#{gen[0]}/gems/#{gen[1]}-#{latest_version}.gem"
|
90
|
+
print "Fetching #{url}..."
|
91
|
+
response = HTTParty.get(url, timeout: 5)
|
92
|
+
if response.success?
|
93
|
+
puts 'SUCCESS'
|
94
|
+
File.open("#{gen[1]}-#{latest_version}.gem", 'wb') do |f|
|
95
|
+
f.write response.parsed_response
|
96
|
+
end
|
97
|
+
|
98
|
+
`gem unpack #{gen[1]}-#{latest_version}.gem`
|
99
|
+
FileUtils.rm_rf("#{gen[1]}-#{latest_version}.gem")
|
100
|
+
FileUtils.mv("#{gen[1]}-#{latest_version}", i.to_s)
|
101
|
+
else
|
102
|
+
puts 'FAILED'
|
103
|
+
use_packaged_generators if i == 0
|
85
104
|
end
|
86
105
|
else
|
87
|
-
puts
|
106
|
+
puts 'FAILED'
|
107
|
+
use_packaged_generators if i == 0
|
88
108
|
end
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
FileUtils.mv("#{gen[1]}-#{latest_version}", i.to_s)
|
93
|
-
|
94
|
-
else
|
95
|
-
puts "Failed to get generator #{gen[1]}, the response from the server was:"
|
96
|
-
puts response.body
|
109
|
+
rescue
|
110
|
+
puts 'FAILED'
|
111
|
+
use_packaged_generators if i == 0
|
97
112
|
end
|
98
113
|
|
99
114
|
# If a reference to a git repo
|
100
115
|
elsif gen.to_s =~ /\.git$/
|
101
|
-
|
116
|
+
begin
|
117
|
+
print "Fetching #{gen}..."
|
118
|
+
Origen::RevisionControl.new(remote: gen, local: i.to_s).checkout(version: 'master', force: true)
|
119
|
+
puts 'SUCCESS'
|
120
|
+
rescue
|
121
|
+
puts 'FAILED'
|
122
|
+
end
|
102
123
|
|
103
124
|
# Assume a reference to a folder
|
104
125
|
else
|
105
|
-
|
106
|
-
FileUtils.cp_r(gen, i.to_s)
|
107
|
-
|
108
|
-
|
126
|
+
begin
|
127
|
+
FileUtils.cp_r(gen, i.to_s) if File.exist?(gen)
|
128
|
+
puts 'SUCCESS'
|
129
|
+
rescue
|
130
|
+
puts 'FAILED'
|
109
131
|
end
|
110
|
-
|
111
132
|
end
|
112
133
|
end
|
113
134
|
|
114
135
|
Origen.session.app_generators[generators_dir] = Time.now
|
115
136
|
end
|
137
|
+
else
|
138
|
+
puts 'Using cached app generators, run again with -f if you want to force a refresh'
|
116
139
|
end
|
140
|
+
puts
|
117
141
|
|
118
142
|
generators.each_with_index do |gen, i|
|
119
143
|
lib = "#{generators_dir}/#{i}/lib"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# require 'optparse'
|
2
|
+
# require 'origen/commands/helpers'
|
3
|
+
#
|
4
|
+
# options = {}
|
5
|
+
#
|
6
|
+
## App options are options that the application can supply to extend this command
|
7
|
+
# app_options = @application_options || []
|
8
|
+
# opt_parser = OptionParser.new do |opts|
|
9
|
+
# opts.banner = 'Usage: origen new RESOURCE_TYPE RESOURCE_NAME [options]'
|
10
|
+
# opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
|
11
|
+
# # Apply any application option extensions to the OptionParser
|
12
|
+
# Origen::CommandHelpers.extend_options(opts, app_options, options)
|
13
|
+
# opts.separator ''
|
14
|
+
# opts.on('-h', '--help', 'Show this message') { puts opts; exit }
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# opt_parser.parse! ARGV
|
18
|
+
#
|
19
|
+
# command = ARGV.shift
|
20
|
+
#
|
21
|
+
# case command
|
22
|
+
# when "model"
|
23
|
+
#
|
24
|
+
#
|
25
|
+
# else
|
26
|
+
# puts "Unknown resource type, must be one of: model"
|
27
|
+
# exit 1
|
28
|
+
# end
|
29
|
+
|
30
|
+
require 'origen/code_generators'
|
31
|
+
|
32
|
+
# if no argument/-h/--help is passed to origen add command, then
|
33
|
+
# it generates the help associated.
|
34
|
+
if [nil, '-h', '--help'].include?(ARGV.first)
|
35
|
+
Origen::CodeGenerators.help 'new'
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
|
39
|
+
name = ARGV.shift
|
40
|
+
|
41
|
+
Origen::CodeGenerators.invoke name, ARGV # , behavior: :invoke, destination_root: Origen.root
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'pathname'
|
3
|
+
require 'origen/commands/helpers'
|
4
|
+
|
5
|
+
module Origen
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
# App options are options that the application can supply to extend this command
|
9
|
+
app_options = @application_options || []
|
10
|
+
opt_parser = OptionParser.new do |opts|
|
11
|
+
opts.banner = <<-END
|
12
|
+
env [filters...] Shows the current site environment configuration. Analogous to 'env' for shell environment.
|
13
|
+
In other words, lists all the site config variables and their values.
|
14
|
+
Aliased to 'environment'.
|
15
|
+
|
16
|
+
configs Shows the current config files used and their indexes.
|
17
|
+
|
18
|
+
inspect_config [config_indexes...] Inspects the configuration(s) at each index given.
|
19
|
+
Indexes can be found from 'origen site configs'
|
20
|
+
If no indexes are given, all configs are printed.
|
21
|
+
|
22
|
+
inspect_variable [variable_names...] Inspects and traces the variable(s) through the various sites configs.
|
23
|
+
|
24
|
+
refresh Forces a refresh of the centralized site config. This will reset the timer for the next automatc refresh.
|
25
|
+
END
|
26
|
+
|
27
|
+
# Apply any application option extensions to the OptionParser
|
28
|
+
Origen::CommandHelpers.extend_options(opts, app_options, options)
|
29
|
+
opts.separator ''
|
30
|
+
opts.on('-h', '--help', 'Show this message') { puts opts; exit }
|
31
|
+
end
|
32
|
+
opt_parser.parse! ARGV
|
33
|
+
|
34
|
+
if ARGV[0]
|
35
|
+
case ARGV.shift
|
36
|
+
when 'env', 'environment'
|
37
|
+
Origen.site_config.pretty_print_env(*ARGV)
|
38
|
+
when 'configs'
|
39
|
+
Origen.site_config.pretty_print_configs
|
40
|
+
when 'inspect_config', 'inspect_configs'
|
41
|
+
Origen.site_config.inspect_config(*ARGV)
|
42
|
+
when 'inspect_variable', 'inspect_variables'
|
43
|
+
Origen.site_config.inspect_variable(*ARGV)
|
44
|
+
when 'refresh'
|
45
|
+
Origen.site_config.refresh
|
46
|
+
else
|
47
|
+
puts "Unknown command, see 'origen site -h' for a list of commands"
|
48
|
+
end
|
49
|
+
else
|
50
|
+
puts "You must supply a command, see 'origen site -h' for a list of commands"
|
51
|
+
end
|
52
|
+
end
|
data/lib/origen/commands/web.rb
CHANGED
@@ -19,7 +19,7 @@ The following commands are available:
|
|
19
19
|
serve Start a webserver from the current directory
|
20
20
|
|
21
21
|
compile [FILE] Compile all web templates and start a server to view them, optionally supply a
|
22
|
-
file argument to only update a single page e.g. 'origen web compile templates/web/index.md.erb'
|
22
|
+
file argument to only update a single page e.g. 'origen web compile app/templates/web/index.md.erb'
|
23
23
|
Use the --remote option to copy the compiled files to a remote web server directory (the
|
24
24
|
location of which should be specified via Origen.config.web_directory). In this case when no
|
25
25
|
FILE argument is specified the entire site will be copied over to a fresh web server
|
@@ -104,7 +104,7 @@ The following options are available:
|
|
104
104
|
puts "Web server directory created at: #{dir}"
|
105
105
|
puts ''
|
106
106
|
puts "Compile any files you want to test into the #{dir}/content directory, e.g.:"
|
107
|
-
puts " origen c templates/file.md.erb -o #{dir}/content"
|
107
|
+
puts " origen c app/templates/file.md.erb -o #{dir}/content"
|
108
108
|
puts ''
|
109
109
|
puts 'To turn them into web pages:'
|
110
110
|
puts " cd #{dir}"
|
@@ -149,9 +149,12 @@ The following options are available:
|
|
149
149
|
Origen.app.listeners_for(:before_web_compile).each do |listener|
|
150
150
|
listener.before_web_compile(options)
|
151
151
|
end
|
152
|
-
|
153
|
-
|
154
|
-
|
152
|
+
templates_web_dir = 'app/templates/web'
|
153
|
+
templates_web_dir = 'templates/web' unless File.exist?("#{Origen.root}/#{templates_web_dir}")
|
154
|
+
templates_web_dir =
|
155
|
+
Origen.app.runner.launch action: :compile,
|
156
|
+
files: templates_web_dir,
|
157
|
+
output: 'web/content'
|
155
158
|
Origen.app.listeners_for(:after_web_compile).each do |listener|
|
156
159
|
listener.after_web_compile(options)
|
157
160
|
end
|
@@ -168,7 +171,9 @@ The following options are available:
|
|
168
171
|
ARGV.each do |file|
|
169
172
|
path = Origen.file_handler.clean_path_to(file)
|
170
173
|
if path.to_s =~ /origen_guides/
|
171
|
-
|
174
|
+
origen_guides_dir = 'app/templates/origen_guides'
|
175
|
+
origen_guides_dir = 'templates/origen_guides' unless File.exist?("#{Origen.root}/#{origen_guides_dir}")
|
176
|
+
output = Origen.file_handler.sub_dir_of(path, "#{Origen.root}/#{origen_guides_dir}")
|
172
177
|
else
|
173
178
|
output = Origen.file_handler.sub_dir_of(path, "#{Origen.root}/templates/web")
|
174
179
|
end
|
@@ -70,11 +70,7 @@ if ARGV.delete('-d') || ARGV.delete('--debug')
|
|
70
70
|
caller[0] =~ /.*\/(\w+\.rb):(\d+).*/
|
71
71
|
puts 'The debugger gem is not installed, add the following to your Gemfile:'
|
72
72
|
puts
|
73
|
-
puts "
|
74
|
-
puts " gem 'byebug', '~>3.5'"
|
75
|
-
puts 'else'
|
76
|
-
puts " gem 'debugger', '~>1.6'"
|
77
|
-
puts 'end'
|
73
|
+
puts " gem 'byebug', '~>8'"
|
78
74
|
puts
|
79
75
|
end
|
80
76
|
end
|
@@ -88,14 +84,18 @@ end
|
|
88
84
|
|
89
85
|
case @command
|
90
86
|
|
91
|
-
when 'new'
|
92
|
-
require
|
87
|
+
when 'new', 'extract'
|
88
|
+
require "origen/commands/#{@command}"
|
93
89
|
exit 0
|
94
90
|
|
95
91
|
when '--version', '-v'
|
96
92
|
require 'origen/commands/version'
|
97
93
|
exit 0
|
98
94
|
|
95
|
+
when 'site'
|
96
|
+
require 'origen/commands/site'
|
97
|
+
exit 0
|
98
|
+
|
99
99
|
# when 'fetch', 'f'
|
100
100
|
# require 'origen/commands/fetch'
|
101
101
|
# exit 0
|
@@ -115,6 +115,8 @@ The following commands are available:
|
|
115
115
|
new origen application workspace in "./my_app"
|
116
116
|
interactive Start an interactive Origen console (short-cut alias: "i"), this is just
|
117
117
|
IRB with the 'origen' lib loaded automatically
|
118
|
+
extract Extract an Origen application archive (.origen file created with the archive command)
|
119
|
+
site Monitor and manage the Origen site configuration
|
118
120
|
EOT
|
119
121
|
cmds.split(/\n/).each do |line|
|
120
122
|
puts Origen.clean_help_line(line)
|
@@ -187,4 +187,24 @@ class Numeric
|
|
187
187
|
self / 1_000_000_000_000.0
|
188
188
|
end
|
189
189
|
end
|
190
|
+
|
191
|
+
# Shorthand for tester.wait(time_in_ns: 100), e.g. 100.ns!
|
192
|
+
def ns!
|
193
|
+
Origen.app.tester.wait time_in_ns: self
|
194
|
+
end
|
195
|
+
|
196
|
+
# Shorthand for tester.wait(time_in_us: 100), e.g. 100.us!
|
197
|
+
def us!
|
198
|
+
Origen.app.tester.wait time_in_us: self
|
199
|
+
end
|
200
|
+
|
201
|
+
# Shorthand for tester.wait(time_in_ms: 100), e.g. 100.ms!
|
202
|
+
def ms!
|
203
|
+
Origen.app.tester.wait time_in_ms: self
|
204
|
+
end
|
205
|
+
|
206
|
+
# Shorthand for tester.wait(time_in_s: 100), e.g. 100.s!
|
207
|
+
def s!
|
208
|
+
Origen.app.tester.wait time_in_s: self
|
209
|
+
end
|
190
210
|
end
|
File without changes
|
File without changes
|
data/lib/origen/file_handler.rb
CHANGED
@@ -15,7 +15,10 @@ module Origen
|
|
15
15
|
# This will also take care of recursively expanding any embedded
|
16
16
|
# list references.
|
17
17
|
def expand_list(files, options = {})
|
18
|
-
|
18
|
+
options = {
|
19
|
+
preserve_duplicates: tester && tester.try(:sim?)
|
20
|
+
}.merge(options)
|
21
|
+
list_of_files = [files].flatten.map do |file|
|
19
22
|
f = file.strip
|
20
23
|
# Takes care of blank or comment lines in a list file
|
21
24
|
if f.empty? || f =~ /^\s*#/
|
@@ -28,7 +31,12 @@ module Origen
|
|
28
31
|
else
|
29
32
|
f
|
30
33
|
end
|
31
|
-
end.flatten.compact
|
34
|
+
end.flatten.compact
|
35
|
+
if options[:preserve_duplicates]
|
36
|
+
list_of_files
|
37
|
+
else
|
38
|
+
list_of_files.uniq
|
39
|
+
end
|
32
40
|
end
|
33
41
|
|
34
42
|
# Returns the contents of the given list file in an array, if it
|
@@ -92,7 +100,7 @@ module Origen
|
|
92
100
|
def clean_path_to(file, options = {})
|
93
101
|
# Allow individual calls to this method to specify additional custom load paths to consider
|
94
102
|
if options[:load_paths]
|
95
|
-
|
103
|
+
Array(options[:load_paths]).each do |root|
|
96
104
|
if File.exist?("#{root}/#{file}")
|
97
105
|
return Pathname.new("#{root}/#{file}")
|
98
106
|
end
|
@@ -214,7 +222,7 @@ module Origen
|
|
214
222
|
begin
|
215
223
|
# Allow relative references to templates/web when compiling a web template
|
216
224
|
if Origen.lsf.current_command == 'web' || web_file
|
217
|
-
clean_path_to(file, load_paths: "#{Origen.root}/templates/web")
|
225
|
+
clean_path_to(file, load_paths: ["#{Origen.root}/app/templates/web", "#{Origen.root}/templates/web"])
|
218
226
|
else
|
219
227
|
clean_path_to(file)
|
220
228
|
end
|
@@ -222,7 +230,7 @@ module Origen
|
|
222
230
|
# Try again without .erb
|
223
231
|
file = file.gsub('.erb', '')
|
224
232
|
if Origen.lsf.current_command == 'web' || web_file
|
225
|
-
clean_path_to(file, load_paths: "#{Origen.root}/templates/web")
|
233
|
+
clean_path_to(file, load_paths: ["#{Origen.root}/app/templates/web", "#{Origen.root}/templates/web"])
|
226
234
|
else
|
227
235
|
clean_path_to(file)
|
228
236
|
end
|
@@ -256,7 +264,11 @@ module Origen
|
|
256
264
|
if import_name == :origen || import_name == :origen_core
|
257
265
|
path.sub! 'origen', "#{Origen.top}/templates/shared"
|
258
266
|
else
|
259
|
-
|
267
|
+
if File.exist?("#{root}/app/templates/shared")
|
268
|
+
path.sub! Regexp.last_match[1], "#{root}/app/templates/shared"
|
269
|
+
else
|
270
|
+
path.sub! Regexp.last_match[1], "#{root}/templates/shared"
|
271
|
+
end
|
260
272
|
end
|
261
273
|
else
|
262
274
|
fail 'Unknown import path type!'
|
data/lib/origen/generator.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
module Origen
|
2
2
|
class Generator
|
3
|
-
autoload :Pattern,
|
4
|
-
autoload :Flow,
|
5
|
-
autoload :Resources,
|
6
|
-
autoload :Job,
|
7
|
-
autoload :PatternFinder,
|
8
|
-
autoload :PatternIterator,
|
9
|
-
autoload :
|
10
|
-
autoload :
|
11
|
-
autoload :
|
12
|
-
autoload :
|
3
|
+
autoload :Pattern, 'origen/generator/pattern'
|
4
|
+
autoload :Flow, 'origen/generator/flow'
|
5
|
+
autoload :Resources, 'origen/generator/resources'
|
6
|
+
autoload :Job, 'origen/generator/job'
|
7
|
+
autoload :PatternFinder, 'origen/generator/pattern_finder'
|
8
|
+
autoload :PatternIterator, 'origen/generator/pattern_iterator'
|
9
|
+
autoload :PatternSequencer, 'origen/generator/pattern_sequencer'
|
10
|
+
autoload :PatternSequence, 'origen/generator/pattern_sequence'
|
11
|
+
autoload :PatternThread, 'origen/generator/pattern_thread'
|
12
|
+
autoload :Stage, 'origen/generator/stage'
|
13
|
+
autoload :Compiler, 'origen/generator/compiler'
|
14
|
+
autoload :Comparator, 'origen/generator/comparator'
|
15
|
+
autoload :Renderer, 'origen/generator/renderer'
|
16
|
+
|
17
|
+
class AbortError < StandardError; end
|
13
18
|
|
14
19
|
def pattern
|
15
20
|
@pattern ||= Pattern.new
|
@@ -28,6 +33,10 @@ module Origen
|
|
28
33
|
end
|
29
34
|
|
30
35
|
def generate_pattern(file, options)
|
36
|
+
if options[:sequence]
|
37
|
+
options[:patterns] = file
|
38
|
+
file = options[:sequence]
|
39
|
+
end
|
31
40
|
Job.new(file, options).run
|
32
41
|
end
|
33
42
|
|