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
data/bin/fix_my_workspace
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$VERBOSE = nil # Don't care about world writable dir warnings and the like
|
3
|
-
|
4
|
-
if $_fix_my_workspace_version_check
|
5
|
-
$_fix_my_workspace_version = '0.7.0'
|
6
|
-
else
|
7
|
-
if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
|
8
|
-
# If this script is being run from within an origen-core workspace, use that Origen-core,
|
9
|
-
# not the system-installed origen-core version.
|
10
|
-
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
11
|
-
require 'origen'
|
12
|
-
else
|
13
|
-
# Use system-installed Origen (the gem in system Ruby)
|
14
|
-
require 'origen'
|
15
|
-
end
|
16
|
-
|
17
|
-
if !Origen.site_config.gem_manage_bundler
|
18
|
-
puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
|
19
|
-
puts 'that I cannot make certain assumptions about how your workspace is configured.'
|
20
|
-
puts 'You will need to either resolve this problem yourself, or else change the value of'
|
21
|
-
puts 'gem_mange_bundler to true.'
|
22
|
-
puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
|
23
|
-
|
24
|
-
else
|
25
|
-
ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
|
26
|
-
ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
|
27
|
-
ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
|
28
|
-
|
29
|
-
# Force copy system gems to local gems
|
30
|
-
if Origen.site_config.gem_use_from_system
|
31
|
-
local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
|
32
|
-
gem_dir = Pathname.new(Gem.dir)
|
33
|
-
|
34
|
-
Origen.site_config.gem_use_from_system.each do |gem, version|
|
35
|
-
begin
|
36
|
-
# This will raise an error if the system doesn't have this gem installed, that
|
37
|
-
# will be rescued below
|
38
|
-
spec = Gem::Specification.find_by_name(gem, version)
|
39
|
-
|
40
|
-
local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
|
41
|
-
FileUtils.mkdir_p local_dir
|
42
|
-
FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
|
43
|
-
|
44
|
-
local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
|
45
|
-
FileUtils.mkdir_p local_file.dirname
|
46
|
-
FileUtils.cp(spec.cache_file, local_file)
|
47
|
-
|
48
|
-
if spec.extension_dir && File.exist?(spec.extension_dir)
|
49
|
-
local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
|
50
|
-
FileUtils.mkdir_p local_dir
|
51
|
-
FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
|
52
|
-
end
|
53
|
-
|
54
|
-
local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
|
55
|
-
FileUtils.mkdir_p local_file.dirname
|
56
|
-
FileUtils.cp(spec.spec_file, local_file)
|
57
|
-
|
58
|
-
rescue Gem::LoadError
|
59
|
-
# This just means that one of the gems that should be copied from the system
|
60
|
-
# was not actually installed in the system, so nothing we can do about that here
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Delete lbin
|
66
|
-
FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
|
67
|
-
|
68
|
-
# Run bundler with correct switches
|
69
|
-
cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
|
70
|
-
`chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
|
71
|
-
`chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
|
72
|
-
`chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
|
73
|
-
|
74
|
-
# Try again, this time updating the bundle
|
75
|
-
if system(cmd)
|
76
|
-
fixed = true
|
77
|
-
elsif system 'bundle update'
|
78
|
-
fixed = true
|
79
|
-
end
|
80
|
-
|
81
|
-
if File.exist?(ENV['BUNDLE_BIN'])
|
82
|
-
`chmod o-w #{ENV['BUNDLE_BIN']}`
|
83
|
-
|
84
|
-
# Make .bat versions of all executables, Bundler should really be doing this when running
|
85
|
-
# on windows
|
86
|
-
if Origen.os.windows?
|
87
|
-
Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
|
88
|
-
unless bin =~ /.bat$/
|
89
|
-
bat = "#{bin}.bat"
|
90
|
-
unless File.exist?(bat)
|
91
|
-
File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
system 'origen -v' if fixed
|
99
|
-
end
|
100
|
-
end
|
data/lib/c99/ate_interface.rb
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
module C99
|
2
|
-
class ATEInterface
|
3
|
-
include OrigenTesters::ProgramGenerators
|
4
|
-
|
5
|
-
# Options passed to Flow.create and Library.create will be passed in here, use as
|
6
|
-
# desired to configure your interface
|
7
|
-
def initialize(_options = {})
|
8
|
-
end
|
9
|
-
|
10
|
-
def log(msg)
|
11
|
-
flow.logprint(msg)
|
12
|
-
end
|
13
|
-
|
14
|
-
def func(name, options = {})
|
15
|
-
options = {
|
16
|
-
duration: :static
|
17
|
-
}.merge(options)
|
18
|
-
|
19
|
-
block_loop(name, options) do |_block, i, group|
|
20
|
-
ins = test_instances.functional(name)
|
21
|
-
ins.set_wait_flags(:a) if options[:duration] == :dynamic
|
22
|
-
ins.pin_levels = options.delete(:pin_levels) if options[:pin_levels]
|
23
|
-
if group
|
24
|
-
pname = "#{name}_b#{i}_pset"
|
25
|
-
patsets.add(pname, [{ pattern: "#{name}_b#{i}.PAT" },
|
26
|
-
{ pattern: 'nvm_global_subs.PAT', start_label: 'subr' }])
|
27
|
-
ins.pattern = pname
|
28
|
-
flow.test(group, options) if i == 0
|
29
|
-
else
|
30
|
-
pname = "#{name}_pset"
|
31
|
-
patsets.add(pname, [{ pattern: "#{name}.PAT" },
|
32
|
-
{ pattern: 'nvm_global_subs.PAT', start_label: 'subr' }])
|
33
|
-
ins.pattern = pname
|
34
|
-
if options[:cz_setup]
|
35
|
-
flow.cz(ins, options[:cz_setup], options)
|
36
|
-
else
|
37
|
-
flow.test(ins, options)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def block_loop(name, options)
|
44
|
-
if options[:by_block]
|
45
|
-
test_instances.group do |group|
|
46
|
-
group.name = name
|
47
|
-
$nvm.blocks.each_with_index do |block, i|
|
48
|
-
yield block, i, group
|
49
|
-
end
|
50
|
-
end
|
51
|
-
else
|
52
|
-
yield
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def por(options = {})
|
57
|
-
options = {
|
58
|
-
instance_not_available: true
|
59
|
-
}.merge(options)
|
60
|
-
flow.test('por_ins', options)
|
61
|
-
end
|
62
|
-
|
63
|
-
def para(name, options = {})
|
64
|
-
options = {
|
65
|
-
high_voltage: false
|
66
|
-
}.merge(options)
|
67
|
-
if options.delete(:high_voltage)
|
68
|
-
ins = test_instances.bpmu(name)
|
69
|
-
else
|
70
|
-
ins = test_instances.ppmu(name)
|
71
|
-
end
|
72
|
-
ins.dc_category = 'NVM_PARA'
|
73
|
-
flow.test(ins, options)
|
74
|
-
patsets.add("#{name}_pset", pattern: "#{name}.PAT")
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
data/lib/c99/nvm.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
module C99
|
2
|
-
# Most of the definition for this lives in core_support
|
3
|
-
class NVM
|
4
|
-
attr_accessor :attribute_x
|
5
|
-
|
6
|
-
def override_method
|
7
|
-
:overridden
|
8
|
-
end
|
9
|
-
|
10
|
-
def added_method
|
11
|
-
:added
|
12
|
-
end
|
13
|
-
|
14
|
-
def add_multi_split_reg
|
15
|
-
reg :multi_group, 0x0070, size: 16 do |reg|
|
16
|
-
reg.bits 15, :mike, reset: 1
|
17
|
-
reg.bits 14, :bill, reset: 0
|
18
|
-
reg.bits 13, :robert, reset: 1
|
19
|
-
reg.bits 12, :james, reset: 0
|
20
|
-
reg.bits 11, :james, reset: 1
|
21
|
-
reg.bits 10, :james, reset: 0
|
22
|
-
reg.bits 9, :paul, reset: 1
|
23
|
-
reg.bits 8, :peter, reset: 0
|
24
|
-
reg.bits 7, :mike, reset: 1
|
25
|
-
reg.bits 6, :mike, reset: 0
|
26
|
-
reg.bits 5, :paul, reset: 1
|
27
|
-
reg.bits 4, :paul, reset: 0
|
28
|
-
reg.bits 3, :mike, reset: 1
|
29
|
-
reg.bits 2, :robert, reset: 0
|
30
|
-
reg.bits 1, :bill, reset: 0
|
31
|
-
reg.bits 0, :ian, reset: 1
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def add_proth_reg
|
36
|
-
reg :proth, 0x0024, size: 32 do |reg|
|
37
|
-
reg.bits 31..24, :fprot7, reset: 0xFF
|
38
|
-
reg.bits 23..16, :fprot6, reset: 0xEE
|
39
|
-
reg.bits 15..8, :fprot5, reset: 0xDD
|
40
|
-
reg.bits 7..0, :fprot4, reset: 0x11
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def add_non_byte_aligned_regs
|
45
|
-
add_reg :non_aligned_small, 0x1000, size: 4
|
46
|
-
add_reg :non_aligned_big, 0x1010, size: 10
|
47
|
-
add_reg :non_aligned_small_msb0, 0x2000, size: 4, bit_order: :msb0
|
48
|
-
add_reg :non_aligned_big_msb0, 0x2010, size: 10, bit_order: :msb0
|
49
|
-
end
|
50
|
-
|
51
|
-
def add_msb0_regs
|
52
|
-
reg :SIUL2_MIDR1, 0x4, bit_order: :msb0 do |reg|
|
53
|
-
bit 0..15, :PARTNUM, res: 0b0101011101110111
|
54
|
-
bit 16, :ED
|
55
|
-
bit 17..21, :PKG
|
56
|
-
bit 24..27, :MAJOR_MASK
|
57
|
-
bit 28..31, :MINOR_MASK
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
class NVMSub < NVM
|
63
|
-
def redefine_data_reg
|
64
|
-
add_reg :data, 0x40, 16, d: { pos: 0, bits: 16 }
|
65
|
-
end
|
66
|
-
|
67
|
-
# Tests that the block format for defining registers works
|
68
|
-
def add_reg_with_block_format
|
69
|
-
# ** Data Register 3 **
|
70
|
-
# This is dreg
|
71
|
-
add_reg :dreg, 0x1000, size: 16 do |reg|
|
72
|
-
# This is dreg bit 15
|
73
|
-
reg.bit 15, :bit15, reset: 1
|
74
|
-
# **Bit 14** - This does something cool
|
75
|
-
#
|
76
|
-
# 0 | Coolness is disabled
|
77
|
-
# 1 | Coolness is enabled
|
78
|
-
reg.bits 14, :bit14
|
79
|
-
# This is dreg bit upper
|
80
|
-
reg.bits 13..8, :upper
|
81
|
-
# This is dreg bit lower
|
82
|
-
# This is dreg bit lower line 2
|
83
|
-
reg.bit 7..0, :lower, writable: false, reset: 0x55
|
84
|
-
end
|
85
|
-
|
86
|
-
# This is dreg2
|
87
|
-
reg :dreg2, 0x1000, size: 16 do
|
88
|
-
# This is dreg2 bit 15
|
89
|
-
bit 15, :bit15, reset: 1
|
90
|
-
# This is dreg2 bit upper
|
91
|
-
bits 14..8, :upper
|
92
|
-
# This is dreg2 bit lower
|
93
|
-
# This is dreg2 bit lower line 2
|
94
|
-
bit 7..0, :lower, writable: false, reset: 0x55
|
95
|
-
end
|
96
|
-
|
97
|
-
# Finally a test that descriptions can be supplied via the API
|
98
|
-
reg :dreg3, 0x1000, size: 16, description: "** Data Register 3 **\nThis is dreg3" do
|
99
|
-
bit 15, :bit15, reset: 1, description: 'This is dreg3 bit 15'
|
100
|
-
bit 14, :bit14, description: "**Bit 14** - This does something cool\n\n0 | Coolness is disabled\n1 | Coolness is enabled"
|
101
|
-
bits 13..8, :upper, description: 'This is dreg3 bit upper'
|
102
|
-
bit 7..0, :lower, writable: false, reset: 0x55, description: "This is dreg3 bit lower\nThis is dreg3 bit lower line 2"
|
103
|
-
end
|
104
|
-
|
105
|
-
reg :dreg4, 0x1000, size: 8, description: "** Data Register 4 **\nThis is dreg4" do
|
106
|
-
bit 7..0, :busy, reset: 0x55, description: "**Busy Bits** - These do something super cool\n\n0 | Job0\n1 | Job1\n10 | Job2\n11 | Job3\n100 | Job4\n101 | Job5\n110 | Job6\n111 | Job7\n1000 | Job8\n1001 | Job9\n1010 | Job10\n1011 | Job11\n1100 | Job12\n1101 | Job13\n1110 | Job14\n1111 | Job15\n10000 | Job16\n10001 | Job17\n10010 | Job18"
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
data/lib/c99/target/mock2.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
$tester = 'found in symlinked subdir'
|
@@ -1 +0,0 @@
|
|
1
|
-
$tester = 'found in subdir of a symlinked subdir!'
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Origen
|
2
|
-
module CodeGenerators
|
3
|
-
class Bundler < Origen::CodeGenerators::Base
|
4
|
-
desc <<-END
|
5
|
-
This generator will add the necessary files to convert the app to use bundler for gem
|
6
|
-
mangement (including Origen plugins).
|
7
|
-
END
|
8
|
-
def create_gemspec_file
|
9
|
-
if config[:type] == :application
|
10
|
-
template 'templates/code_generators/gemfile_app.rb', File.join(Origen.root, 'Gemfile')
|
11
|
-
else
|
12
|
-
template 'templates/code_generators/gemfile_plugin.rb', File.join(Origen.root, 'Gemfile')
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
module Origen
|
2
|
-
module CodeGenerators
|
3
|
-
class GemSetup < Origen::CodeGenerators::Base
|
4
|
-
desc <<-END
|
5
|
-
This generator creates a gemspec file in the top-level directory to allow it
|
6
|
-
to be packed up and distributed as a gem.
|
7
|
-
END
|
8
|
-
def create_gemspec_file
|
9
|
-
@summary = ask 'Describe your plugin in a few words:'
|
10
|
-
template 'templates/code_generators/gemspec.rb', File.join(Origen.root, "#{Origen.app.name}.gemspec")
|
11
|
-
end
|
12
|
-
|
13
|
-
def create_master_require_file
|
14
|
-
file = "#{Origen.root}/lib/#{Origen.app.name}.rb"
|
15
|
-
if File.exist?(file)
|
16
|
-
prepend_to_file file, <<-END
|
17
|
-
require "origen"
|
18
|
-
require_relative "../config/application.rb"
|
19
|
-
require_relative "../config/environment.rb"
|
20
|
-
|
21
|
-
END
|
22
|
-
else
|
23
|
-
create_file file do
|
24
|
-
<<-END
|
25
|
-
require "origen"
|
26
|
-
require_relative "../config/application.rb"
|
27
|
-
require_relative "../config/environment.rb"
|
28
|
-
END
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def verify_semver
|
34
|
-
unless Origen.app.version.semantic?
|
35
|
-
puts <<-END
|
36
|
-
|
37
|
-
Warning, you application is not currently using semantic (1.2.3) versioning, this must be used if
|
38
|
-
you want to publish your plugin as a gem.
|
39
|
-
|
40
|
-
To upgrade your application to semantic versioning run the following command:
|
41
|
-
|
42
|
-
origen add semver
|
43
|
-
|
44
|
-
END
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module Origen
|
2
|
-
module CodeGenerators
|
3
|
-
class Rake < Origen::CodeGenerators::Base
|
4
|
-
desc <<-END
|
5
|
-
This generator will add the necessary files to convert the app to use rake for general
|
6
|
-
build commands.
|
7
|
-
END
|
8
|
-
def create_rake_file
|
9
|
-
template 'templates/code_generators/rakefile.rb', File.join(Origen.root, 'Rakefile')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Origen
|
2
|
-
module CodeGenerators
|
3
|
-
class RSpec < Origen::CodeGenerators::Base
|
4
|
-
desc <<-END
|
5
|
-
This generator will add the necessary files to use rspec for unit tests.
|
6
|
-
END
|
7
|
-
def create_spec_helper_file
|
8
|
-
template 'templates/code_generators/spec_helper.rb', File.join(Origen.root, 'spec', 'spec_helper.rb')
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/lib/origen/commands/add.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'origen/code_generators'
|
2
|
-
|
3
|
-
# if no argument/-h/--help is passed to origen add command, then
|
4
|
-
# it generates the help associated.
|
5
|
-
if [nil, '-h', '--help'].include?(ARGV.first)
|
6
|
-
Origen::CodeGenerators.help 'add'
|
7
|
-
exit
|
8
|
-
end
|
9
|
-
|
10
|
-
name = ARGV.shift
|
11
|
-
|
12
|
-
Origen::CodeGenerators.invoke name, ARGV # , behavior: :invoke, destination_root: Origen.root
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
config = File.expand_path('../config', __FILE__)
|
3
|
-
require "#{config}/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "<%= Origen.app.name %>"
|
7
|
-
spec.version = <%= Origen.app.namespace %>::VERSION
|
8
|
-
spec.authors = ["<%= User.current.name %>"]
|
9
|
-
spec.email = ["<%= User.current.email %>"]
|
10
|
-
spec.summary = "<%= @summary %>"
|
11
|
-
<% if Origen.app.config.web_domain -%>
|
12
|
-
spec.homepage = "<%= Origen.app.config.web_domain %>"
|
13
|
-
<% end -%>
|
14
|
-
|
15
|
-
spec.required_ruby_version = '>= 1.9.3'
|
16
|
-
spec.required_rubygems_version = '>= 1.8.11'
|
17
|
-
|
18
|
-
# Only the files that are hit by these wildcards will be included in the
|
19
|
-
# packaged gem, the default should hit everything in most cases but this will
|
20
|
-
# need to be added to if you have any custom directories
|
21
|
-
spec.files = Dir["lib/**/*.rb", "templates/**/*", "config/**/*.rb",
|
22
|
-
"bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb",
|
23
|
-
"program/**/*.rb"
|
24
|
-
]
|
25
|
-
spec.executables = []
|
26
|
-
spec.require_paths = ["lib"]
|
27
|
-
|
28
|
-
# Add any gems that your plugin needs to run within a host application
|
29
|
-
spec.add_runtime_dependency "origen_core", ">= <%= Origen.version %>"
|
30
|
-
|
31
|
-
# Add any gems that your plugin needs for its development environment only
|
32
|
-
#spec.add_development_dependency "doc_helpers", ">= 1.7.0"
|
33
|
-
end
|