origen 0.44.0 → 0.50.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/application.rb +2 -2
- data/config/boot.rb +0 -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 +1 -2
- data/lib/origen/application/deployer.rb +3 -1
- data/lib/origen/application/release.rb +2 -2
- data/lib/origen/application/runner.rb +9 -2
- data/lib/origen/application.rb +91 -2
- data/lib/origen/boot/app.rb +0 -4
- data/lib/origen/boot.rb +2 -1
- 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/code_generators.rb +30 -10
- data/lib/origen/commands/lint.rb +6 -1
- data/lib/origen/commands/new.rb +1 -1
- data/lib/origen/commands/new_resource.rb +41 -0
- data/lib/origen/commands/web.rb +11 -6
- data/lib/origen/commands.rb +18 -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 +8 -4
- data/lib/origen/generator/pattern_finder.rb +3 -3
- data/lib/origen/loader.rb +377 -0
- data/lib/origen/model.rb +22 -1
- data/lib/origen/model_initializer.rb +5 -1
- data/lib/origen/parameters/set.rb +2 -1
- data/lib/origen/parameters.rb +95 -3
- data/lib/origen/sub_blocks.rb +21 -7
- data/lib/origen/top_level.rb +11 -0
- data/lib/origen.rb +3 -1
- data/origen_app_generators/Gemfile +6 -2
- data/origen_app_generators/Gemfile.lock +83 -72
- data/origen_app_generators/bin/boot.rb +4 -2
- data/origen_app_generators/config/commands.rb +3 -3
- data/origen_app_generators/config/shared_commands.rb +11 -6
- 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/application.rb +12 -12
- data/origen_app_generators/lib/origen_app_generators/base.rb +34 -8
- data/origen_app_generators/lib/origen_app_generators/new.rb +17 -9
- data/origen_app_generators/lib/{tasks/new_app_tests.rake → origen_app_generators/new_app_tests.rb} +1 -5
- data/origen_app_generators/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +6 -8
- data/origen_app_generators/lib/origen_app_generators/plugin.rb +4 -7
- 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 +9 -181
- data/origen_app_generators/lib/origen_app_generators/test_engineering/test_block.rb +4 -105
- data/origen_app_generators/lib/origen_app_generators.rb +6 -4
- data/origen_app_generators/origen_app_generators.gemspec +7 -7
- data/origen_app_generators/templates/app_generators/application/Gemfile +14 -3
- data/origen_app_generators/templates/app_generators/application/{lib → app/blocks}/top_level.rb +1 -1
- data/origen_app_generators/templates/app_generators/application/app/lib/module.rb +6 -0
- data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/index.md.erb +0 -0
- data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/layouts/_basic.html.erb +0 -0
- data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/partials/_navbar.html.erb +0 -0
- data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/release_notes.md.erb +0 -0
- data/origen_app_generators/templates/app_generators/application/config/application.rb +51 -55
- data/origen_app_generators/templates/app_generators/application/{spec → test/spec}/spec_helper.rb +0 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/application.rb +0 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/base.rb +0 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/module.rb +0 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/plugin.rb +0 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +1 -1
- data/origen_app_generators/templates/app_generators/plugin/Gemfile +5 -2
- data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/index.md.erb +0 -0
- data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_external.html.erb +0 -0
- data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_internal.html.erb +0 -0
- data/origen_app_generators/templates/app_generators/plugin/gemspec.rb +4 -3
- data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/j750.rb +0 -0
- data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/uflex.rb +0 -0
- data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/v93k.rb +0 -0
- data/origen_site_config.yml +0 -7
- 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
- metadata +66 -77
- 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/origen_app_generators/bin/fix_my_workspace +0 -100
- data/origen_app_generators/lib/origen_app_generators/sub_block_parser.rb +0 -81
- data/origen_app_generators/lib/tasks/app_generators.rake +0 -6
- data/origen_app_generators/spec/sub_block_spec.rb +0 -36
- data/origen_app_generators/templates/app_generators/application/lib/app.rake +0 -6
- data/origen_app_generators/templates/app_generators/application/lib/module.rb +0 -22
- data/origen_app_generators/templates/app_generators/plugin/lib/README +0 -4
- data/origen_app_generators/templates/app_generators/plugin/lib_dev/README +0 -5
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/Gemfile +0 -23
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb +0 -1
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb +0 -23
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb +0 -5
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb +0 -33
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb +0 -21
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb +0 -4
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb +0 -4
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/j750.rb +0 -2
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/ultraflex.rb +0 -2
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/v93k.rb +0 -2
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/controller.rb +0 -12
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/interface.rb +0 -21
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/model.rb +0 -18
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb +0 -27
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb +0 -26
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/pattern/example.rb +0 -5
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/program/prb1.rb +0 -11
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/target/default.rb +0 -2
- 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/templates/code_generators/rakefile.rb +0 -10
- data/templates/code_generators/spec_helper.rb +0 -49
@@ -1,20 +1,19 @@
|
|
1
1
|
require 'origen'
|
2
2
|
class <%= @namespace %>Application < Origen::Application
|
3
|
-
|
4
3
|
# See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
|
5
4
|
# for a full list of the configuration options available
|
6
5
|
|
7
6
|
# These attributes should never be changed, the duplication here will be resolved in future
|
8
7
|
# by condensing these attributes that do similar things
|
9
|
-
self.name =
|
10
|
-
self.namespace =
|
11
|
-
config.name =
|
12
|
-
config.initials =
|
8
|
+
self.name = '<%= @name %>'
|
9
|
+
self.namespace = '<%= @namespace %>'
|
10
|
+
config.name = '<%= @name %>'
|
11
|
+
config.initials = '<%= @namespace %>'
|
13
12
|
# Change this to point to the revision control repository for this <%= @type %>
|
14
13
|
<% if @audience == :external -%>
|
15
|
-
#config.rc_url = "ssh://git@github.com:myaccount/<%= @name %>.git"
|
14
|
+
# config.rc_url = "ssh://git@github.com:myaccount/<%= @name %>.git"
|
16
15
|
<% else -%>
|
17
|
-
#config.rc_url = "ssh://git@sw-stash.mycompany.net/myproject/<%= @name %>.git"
|
16
|
+
# config.rc_url = "ssh://git@sw-stash.mycompany.net/myproject/<%= @name %>.git"
|
18
17
|
<% end -%>
|
19
18
|
<% if @audience == :external -%>
|
20
19
|
config.release_externally = true
|
@@ -23,11 +22,11 @@ class <%= @namespace %>Application < Origen::Application
|
|
23
22
|
# To enable deployment of your documentation to a web server (via the 'origen web'
|
24
23
|
# command) fill in these attributes.
|
25
24
|
<% if @audience == :external -%>
|
26
|
-
#config.web_directory =
|
27
|
-
#config.web_domain =
|
25
|
+
# config.web_directory = 'git@github.com:Origen-SDK/Origen-SDK.github.io.git/<%= @name %>'
|
26
|
+
# config.web_domain = 'http://origen-sdk.org/<%= @name %>'
|
28
27
|
<% else -%>
|
29
|
-
#config.web_directory =
|
30
|
-
#config.web_domain =
|
28
|
+
# config.web_directory = '/path/to/server/<%= @name %>'
|
29
|
+
# config.web_domain = 'http://origen.mycompany.net/<%= @name %>'
|
31
30
|
<% end -%>
|
32
31
|
|
33
32
|
# When false Origen will be less strict about checking for some common coding errors,
|
@@ -38,76 +37,74 @@ class <%= @namespace %>Application < Origen::Application
|
|
38
37
|
# See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
|
39
38
|
config.lint_test = {
|
40
39
|
# Require the lint tests to pass before allowing a release to proceed
|
41
|
-
run_on_tag:
|
40
|
+
run_on_tag: true,
|
42
41
|
# Auto correct violations where possible whenever 'origen lint' is run
|
43
|
-
auto_correct: true,
|
44
|
-
# Limit the testing for large legacy applications
|
45
|
-
#level: :easy,
|
42
|
+
auto_correct: true,
|
46
43
|
# Run on these directories/files by default
|
47
|
-
|
44
|
+
files: ['app', 'config/application.rb']
|
48
45
|
}
|
49
46
|
|
50
47
|
config.semantically_version = true
|
51
48
|
|
52
49
|
# An example of how to set application specific LSF parameters
|
53
|
-
#config.lsf.project = "msg.te"
|
54
|
-
|
50
|
+
# config.lsf.project = "msg.te"
|
51
|
+
|
55
52
|
# An example of how to specify a prefix to add to all generated patterns
|
56
|
-
#config.pattern_prefix = "nvm"
|
53
|
+
# config.pattern_prefix = "nvm"
|
57
54
|
|
58
55
|
# An example of how to add header comments to all generated patterns
|
59
|
-
#config.pattern_header do
|
60
|
-
#
|
61
|
-
#end
|
56
|
+
# config.pattern_header do
|
57
|
+
# cc "This is a pattern created by the example origen application"
|
58
|
+
# end
|
62
59
|
|
63
60
|
# By default all generated output will end up in ./output.
|
64
61
|
# Here you can specify an alternative directory entirely, or make it dynamic such that
|
65
|
-
# the output ends up in a setup specific directory.
|
66
|
-
#config.output_directory do
|
67
|
-
#
|
68
|
-
#end
|
62
|
+
# the output ends up in a setup specific directory.
|
63
|
+
# config.output_directory do
|
64
|
+
# "#{Origen.root}/output/#{$dut.class}"
|
65
|
+
# end
|
69
66
|
|
70
67
|
# Similarly for the reference files, generally you want to setup the reference directory
|
71
68
|
# structure to mirror that of your output directory structure.
|
72
|
-
#config.reference_directory do
|
73
|
-
#
|
74
|
-
#end
|
75
|
-
|
69
|
+
# config.reference_directory do
|
70
|
+
# "#{Origen.root}/.ref/#{$dut.class}"
|
71
|
+
# end
|
72
|
+
|
76
73
|
# This will automatically deploy your documentation after every tag
|
77
|
-
#def after_release_email(tag, note, type, selector, options)
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#end
|
83
|
-
<% if @validate_release_tests
|
74
|
+
# def after_release_email(tag, note, type, selector, options)
|
75
|
+
# command = "origen web compile --remote --api"
|
76
|
+
# Dir.chdir Origen.root do
|
77
|
+
# system command
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
<% if @validate_release_tests -%>
|
84
81
|
# Ensure that all tests pass before allowing a release to continue
|
85
82
|
def validate_release
|
86
83
|
if <%= Array(@validate_release_tests).map { |t| "!system('#{t}')" }.join(' || ') %>
|
87
84
|
puts "Sorry but you can't release with failing tests, please fix them and try again."
|
88
85
|
exit 1
|
89
86
|
else
|
90
|
-
puts
|
87
|
+
puts 'All tests passing, proceeding with release process!'
|
91
88
|
end
|
92
89
|
end
|
93
|
-
<% else
|
90
|
+
<% else -%>
|
94
91
|
# Ensure that all tests pass before allowing a release to continue
|
95
|
-
#def validate_release
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#end
|
92
|
+
# def validate_release
|
93
|
+
# if !system('origen specs') || !system('origen examples')
|
94
|
+
# puts "Sorry but you can't release with failing tests, please fix them and try again."
|
95
|
+
# exit 1
|
96
|
+
# else
|
97
|
+
# puts 'All tests passing, proceeding with release process!'
|
98
|
+
# end
|
99
|
+
# end
|
103
100
|
<% end -%>
|
104
101
|
|
105
102
|
# To enabled source-less pattern generation create a class (for example PatternDispatcher)
|
106
103
|
# to generate the pattern. This should return false if the requested pattern has been
|
107
104
|
# dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
|
108
|
-
#def before_pattern_lookup(requested_pattern)
|
109
|
-
#
|
110
|
-
#end
|
105
|
+
# def before_pattern_lookup(requested_pattern)
|
106
|
+
# PatternDispatcher.new.dispatch_or_return(requested_pattern)
|
107
|
+
# end
|
111
108
|
|
112
109
|
# If you use pattern iterators you may come across the case where you request a pattern
|
113
110
|
# like this:
|
@@ -115,11 +112,10 @@ class <%= @namespace %>Application < Origen::Application
|
|
115
112
|
#
|
116
113
|
# However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
|
117
114
|
# In the case where the pattern cannot be found Origen will pass the name to this translator
|
118
|
-
# if it exists, and here you can make any substitutions to help Origen find the file you
|
115
|
+
# if it exists, and here you can make any substitutions to help Origen find the file you
|
119
116
|
# want. In this example any instances of _b\d, where \d means a number, are replaced by
|
120
117
|
# _bx.
|
121
|
-
#config.pattern_name_translator do |name|
|
122
|
-
#
|
123
|
-
#end
|
124
|
-
|
118
|
+
# config.pattern_name_translator do |name|
|
119
|
+
# name.gsub(/_b\d/, "_bx")
|
120
|
+
# end
|
125
121
|
end
|
data/origen_app_generators/templates/app_generators/application/{spec → test/spec}/spec_helper.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,5 +2,5 @@
|
|
2
2
|
# 'origen new' command, it must not be removed or modified
|
3
3
|
require 'origen_app_generators'
|
4
4
|
require "<%= @name %>"
|
5
|
-
template_dir = File.expand_path('../../templates/app_generators', __FILE__)
|
5
|
+
template_dir = File.expand_path('../../app/templates/app_generators', __FILE__)
|
6
6
|
OrigenAppGenerators.add_generators(<%= @namespace %>::AVAILABLE, template_dir: template_dir)
|
@@ -13,14 +13,17 @@ source 'https://rubygems.org'
|
|
13
13
|
# your application's test coverage
|
14
14
|
gem 'coveralls', require: false
|
15
15
|
<% end -%>
|
16
|
-
gem 'byebug', '
|
16
|
+
gem 'byebug', '~>8' # You can remove this version constraint if you don't care about your app
|
17
|
+
# supporting earlier versions of Ruby 2
|
17
18
|
gem 'ripper-tags'
|
18
19
|
gem 'origen_doc_helpers'
|
19
|
-
|
20
|
+
|
20
21
|
# Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
|
21
22
|
#gem 'ruby-debug-ide'
|
22
23
|
#gem 'debase'
|
23
24
|
|
25
|
+
gem 'origen', git: 'https://github.com/Origen-SDK/origen.git', branch: 'app_dir'
|
26
|
+
|
24
27
|
# Specify your gem's runtime dependencies in <%= @name %>.gemspec
|
25
28
|
# THIS LINE SHOULD BE LEFT AT THE END
|
26
29
|
gemspec
|
File without changes
|
File without changes
|
File without changes
|
@@ -21,11 +21,12 @@ Gem::Specification.new do |spec|
|
|
21
21
|
# packaged gem, the default should hit everything in most cases but this will
|
22
22
|
# need to be added to if you have any custom directories
|
23
23
|
spec.files = Dir["lib/<%= @name %>.rb", "lib/<%= @name %>/**/*.rb", "templates/**/*", "config/**/*.rb",
|
24
|
-
"bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb",
|
25
|
-
"
|
24
|
+
"bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb", "program/**/*.rb",
|
25
|
+
"app/lib/**/*.rb", "app/templates/**/*",
|
26
|
+
"app/patterns/**/*.rb", "app/flows/**/*.rb", "app/blocks/**/*.rb"
|
26
27
|
]
|
27
28
|
spec.executables = []
|
28
|
-
spec.require_paths = ["lib"]
|
29
|
+
spec.require_paths = ["lib", "app/lib"]
|
29
30
|
|
30
31
|
# Add any gems that your plugin needs to run within a host application
|
31
32
|
spec.add_runtime_dependency "origen", ">= <%= @latest_origen_version %>"
|
File without changes
|
File without changes
|
File without changes
|
data/origen_site_config.yml
CHANGED
@@ -50,13 +50,6 @@ centralized_site_config_verify_ssl: true
|
|
50
50
|
# user (recommended)
|
51
51
|
gem_manage_bundler: true
|
52
52
|
|
53
|
-
# Use the bootsnap gem (https://github.com/Shopify/bootsnap) to speed up the boot time of
|
54
|
-
# your Origen applications.
|
55
|
-
# This creates an offline cache in your app's tmp/cache directory and it can also increase
|
56
|
-
# the memory consumption of your app. As a reward, your app will load Ruby files significantly
|
57
|
-
# faster, often taking many seconds off the time it takes your app to start up.
|
58
|
-
use_bootsnap: false
|
59
|
-
|
60
53
|
# WORKSPACE DIRECTORY SETUP
|
61
54
|
|
62
55
|
# Defines where the home directory is
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any attributes defined in this file be added to <%= @fullname %>
|
3
|
+
<% unless @nested -%>
|
4
|
+
# and all of its derivatives (if any).
|
5
|
+
<% end -%>
|
6
|
+
# ********************************************************************************
|
7
|
+
|
8
|
+
# To define an attribute simply declare instance variables and assign their
|
9
|
+
# values as shown below.
|
10
|
+
# Derivative classes will automatically inherit the values defined here unless
|
11
|
+
# they are overridden by a derivative attribute file.
|
12
|
+
#
|
13
|
+
# @address_width = 32
|
14
|
+
# @has_feature_x = true
|
15
|
+
#
|
16
|
+
# Accessors will automatically be created for any attributes defined in this file:
|
17
|
+
#
|
18
|
+
# dut.address_width # => 32
|
19
|
+
# dut.has_feature_x # => true
|
20
|
+
# dut.has_feature_x? # => true <attribute>? methods are also added for booleans
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# If this class gets too big you may want to split it up into modules, run the following
|
2
|
+
# command to add a module to it:
|
3
|
+
#
|
4
|
+
# origen new module my_module_name <%= Pathname.new(resource_path_to_lib_file(@resource_path)).relative_path_from(Origen.root) %>
|
5
|
+
#
|
6
|
+
class <%= @namespaces.map { |n| camelcase(n[1]) }.join('::') %>::<%= camelcase(@name) %><%= @parent_class ? " < #{@parent_class}" : '' %>
|
7
|
+
def initialize(options = {})
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# If this class gets too big you may want to split it up into modules, run the following
|
2
|
+
# command to add a module to it:
|
3
|
+
#
|
4
|
+
<% if @block -%>
|
5
|
+
# origen new module <%= Pathname.new(resource_path_to_blocks_dir(@resource_path)).relative_path_from(Origen.root) %>/controller.rb my_module_name
|
6
|
+
<% else -%>
|
7
|
+
# origen new module <%= Pathname.new(resource_path_to_lib_file(@resource_path)).relative_path_from(Origen.root) %> my_module_name
|
8
|
+
<% end -%>
|
9
|
+
#
|
10
|
+
class <%= @namespaces.map { |n| camelcase(n[1]) }.join('::') %>::<%= camelcase(@name) %>Controller<%= @parent_class ? " < #{@parent_class}Controller" : '' %>
|
11
|
+
<% if @root_class -%>
|
12
|
+
include Origen::Controller
|
13
|
+
|
14
|
+
<% end -%>
|
15
|
+
|
16
|
+
# If implemented, this method will be called automatically at the start of every pattern.
|
17
|
+
<% if @top_level -%>
|
18
|
+
# Since this is the top-level/DUT controller, it will be called first and it is normally used
|
19
|
+
# to define a mode entry sequence.
|
20
|
+
<% else-%>
|
21
|
+
# Since this is a sub-block controller, it will be called after the top-level/DUT controller's
|
22
|
+
# startup method, though the calling order with relation to other sub-blocks is undefined.
|
23
|
+
<% end -%>
|
24
|
+
# Any option arguments passed into Pattern.create will be passed into here.
|
25
|
+
# def startup(options = {})
|
26
|
+
# tester.set_timeset('func', 100)
|
27
|
+
# end
|
28
|
+
<% if @top_level -%>
|
29
|
+
|
30
|
+
# If implemented, this method will be called automatically at the start of every simulation.
|
31
|
+
# If the simulation run contains multiple patterns run back to back, then this method will
|
32
|
+
# be called only once at the very start, and then the startup method will be called multiple
|
33
|
+
# as it is invoked before each individual pattern.
|
34
|
+
# def simulation_startup(options = {})
|
35
|
+
# tester.set_timeset('func', 100)
|
36
|
+
# end
|
37
|
+
|
38
|
+
# If implemented, this method will be called automatically at the start of every interactive
|
39
|
+
# console session (origen i). It is commonly used to startup the simulator if the tester is
|
40
|
+
# an OrigenSim driver as shown in the example below.
|
41
|
+
# def interactive_startup(options = {})
|
42
|
+
# tester.start if tester.sim?
|
43
|
+
# end
|
44
|
+
<% end -%>
|
45
|
+
|
46
|
+
# All requests to read a register will be passed in here, this is where you define
|
47
|
+
# how registers should be read (e.g. via JTAG) for this particular DUT
|
48
|
+
def read_register(reg, options = {})
|
49
|
+
<% if @root_class -%>
|
50
|
+
<% if @top_level -%>
|
51
|
+
Origen.log.error "A request was made to read register #{reg.name}, but the controller method has not been implemented yet!"
|
52
|
+
<% else-%>
|
53
|
+
# Pass this to the DUT by default, if you need a special implementation or if you wish
|
54
|
+
# to pass some meta-data to the DUT about how to handle registers from this sub-block
|
55
|
+
# then you can do so here
|
56
|
+
dut.read_register(reg, options)
|
57
|
+
<% end -%>
|
58
|
+
<% else-%>
|
59
|
+
# super means that the read register request will get passed onto the parent class's
|
60
|
+
# read_register method - i.e. the one defined in <%= @parent_class %>Controller.
|
61
|
+
# If you want to override that and add a specific implementation for this DUT type,
|
62
|
+
# then simply delete the super below and add the code you wish to handle the request.
|
63
|
+
super
|
64
|
+
<% end -%>
|
65
|
+
end
|
66
|
+
|
67
|
+
# All requests to write a register will be passed in here, this is where you define
|
68
|
+
# how registers should be written (e.g. via JTAG) for this particular DUT
|
69
|
+
def write_register(reg, options = {})
|
70
|
+
<% if @root_class -%>
|
71
|
+
<% if @top_level -%>
|
72
|
+
Origen.log.error "A request was made to write register #{reg.name}, but the controller method has not been implemented yet!"
|
73
|
+
<% else -%>
|
74
|
+
# Pass this to the DUT by default, if you need a special implementation or if you wish
|
75
|
+
# to pass some meta-data to the DUT about how to handle registers from this sub-block
|
76
|
+
# then you can do so here
|
77
|
+
dut.write_register(reg, options)
|
78
|
+
<% end -%>
|
79
|
+
<% else-%>
|
80
|
+
# super means that the write register request will get passed onto the parent class's
|
81
|
+
# write_register method - i.e. the one defined in <%= @parent_class %>Controller.
|
82
|
+
# If you want to override that and add a specific implementation for this DUT type,
|
83
|
+
# then simply delete the super below and add the code you wish to handle the request.
|
84
|
+
super
|
85
|
+
<% end -%>
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# If this class gets too big you may want to split it up into modules, run the following
|
2
|
+
# command to add a module to it:
|
3
|
+
#
|
4
|
+
<% if @block -%>
|
5
|
+
# origen new module <%= Pathname.new(resource_path_to_blocks_dir(@resource_path)).relative_path_from(Origen.root) %>/model.rb my_module_name
|
6
|
+
<% else -%>
|
7
|
+
# origen new module <%= Pathname.new(resource_path_to_lib_file(@resource_path)).relative_path_from(Origen.root) %> my_module_name
|
8
|
+
<% end -%>
|
9
|
+
#
|
10
|
+
class <%= @namespaces.map { |n| camelcase(n[1]) }.join('::') %>::<%= camelcase(@name) %><%= @parent_class ? " < #{@parent_class}" : '' %>
|
11
|
+
<% if @root_class -%>
|
12
|
+
<% if @top_level -%>
|
13
|
+
include Origen::TopLevel
|
14
|
+
<% else -%>
|
15
|
+
include Origen::Model
|
16
|
+
<% end -%>
|
17
|
+
|
18
|
+
<% end -%>
|
19
|
+
def initialize(options = {})
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any parameters defined in this file be added to <%= @fullname %>
|
3
|
+
# and all of its derivatives (if any).
|
4
|
+
# ********************************************************************************
|
5
|
+
|
6
|
+
# For more examples see: https://origen-sdk.org/origen/guides/models/parameters/
|
7
|
+
|
8
|
+
# Example of how to define a default parameters set
|
9
|
+
# define_params :default do |params|
|
10
|
+
# params.tread = 40.nS
|
11
|
+
# params.tprog = 20.uS
|
12
|
+
# params.terase = 100.mS
|
13
|
+
# end
|
14
|
+
|
15
|
+
# Example of how to inherit and modify the defaults to create an alternative parameters set
|
16
|
+
# define_params :probe, inherit: :default do |params, parent|
|
17
|
+
# params.tprog = parent.tprog / 2
|
18
|
+
# params.terase = 20.mS
|
19
|
+
# end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any pins defined in this file will be added to <%= @fullname %>
|
3
|
+
# and all of its derivatives (if any).
|
4
|
+
# ********************************************************************************
|
5
|
+
|
6
|
+
# For more examples see: https://origen-sdk.org/origen/guides/models/pins/
|
7
|
+
|
8
|
+
# Example of how to import a pins file extracted by 'origen sim:build' and copied to your app's
|
9
|
+
# vendor/ directory (my_file_name will be the name of the file without the .rb extension)
|
10
|
+
# import 'my_file_name', dir: "#{Origen.root!}/vendor/wherever/i/like", namespace: nil
|
11
|
+
|
12
|
+
# Examples of how to add pins
|
13
|
+
# add_pin :tck, reset: :drive_hi, meta: { max_freq: 15.Mhz }
|
14
|
+
# add_pin :tdi, direction: :input
|
15
|
+
# add_pin :tdo, direction: :output
|
16
|
+
# add_pin :tms
|
17
|
+
|
18
|
+
# Examples of how to add sized pin groups
|
19
|
+
# add_pins :porta, size: 32
|
20
|
+
# add_pins :portb, size: 16, endian: :little
|
21
|
+
|
22
|
+
# Example of how to declare ad-hoc pin groups (the pins themselves must already have been added)
|
23
|
+
# add_pin_group :jtag, :tdi, :tdo, :tck, :tms
|
24
|
+
#
|
25
|
+
# Examples of how to create pin aliases
|
26
|
+
# add_pin_alias :old_name, :new_name
|
27
|
+
# add_pin_group_alias :old_name, :new_name
|
28
|
+
# add_pin_group_alias :data_byte0, :porta, pins: [7..0]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any registers defined in this file will be added to <%= @fullname %>
|
3
|
+
<% unless @nested -%>
|
4
|
+
# and all of its derivatives (if any).
|
5
|
+
<% end -%>
|
6
|
+
# ********************************************************************************
|
7
|
+
|
8
|
+
# For more examples see: https://origen-sdk.org/origen/guides/models/registers/
|
9
|
+
|
10
|
+
# Example of basic definition of a register at address 0x1000 with all bits R/W
|
11
|
+
# add_reg :data, 0x1000 # 32-bit by default
|
12
|
+
# add_reg :data, 0x1000, size: 16
|
13
|
+
|
14
|
+
# Example of a regular definition which defines individual bits
|
15
|
+
# reg :ctrl, 0x0024, size: 16 do |reg|
|
16
|
+
# reg.bit 7, :coco, access: :ro
|
17
|
+
# reg.bit 6, :aien
|
18
|
+
# reg.bit 5, :diff
|
19
|
+
# reg.bit 4..0, :adch, reset: 0x1F
|
20
|
+
# end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any sub-blocks defined in this file will be added to <%= @fullname %>
|
3
|
+
<% unless @nested -%>
|
4
|
+
# and all of its derivatives (if any).
|
5
|
+
<% end -%>
|
6
|
+
# ********************************************************************************
|
7
|
+
|
8
|
+
# If you want to add a nested sub-block to this block then run the following command,
|
9
|
+
# replacing my_sub_block_name with the name of your sub-block:
|
10
|
+
# origen new block <%= Pathname.new(resource_path_to_blocks_dir(@resource_path)).relative_path_from(Origen.root) %> my_sub_block_name
|
11
|
+
#
|
12
|
+
# If instead you want to add a primary sub-block (one which supports derivatives and
|
13
|
+
# inheritance then create one using the following command and then instantiate it
|
14
|
+
# manually below:
|
15
|
+
# origen new block my_sub_block_type/my_sub_block_name
|
16
|
+
|
17
|
+
# For more examples see: https://origen-sdk.org/origen/guides/models/defining/#Adding_Sub_Blocks
|
18
|
+
|
19
|
+
# Examples
|
20
|
+
# sub_block :nvm # An empty sub-block
|
21
|
+
# sub_block :nvm, base_address: 0x1000_0000 # How to define the sub-block's address
|
22
|
+
# sub_block :nvm, load_block: 'features/memory' # Add the definitions from the given block(s)
|
23
|
+
# sub_block :nvm, load_block: ['features/memory', 'features/testable']
|
24
|
+
# sub_block :nvm, class_name: 'MyApp::NVM::Flash2K' # Instantiate it as an instance of the given class
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# ********************************************************************************
|
2
|
+
# Any timesets defined in this file will be added to <%= @fullname %>
|
3
|
+
# and all of its derivatives (if any).
|
4
|
+
# ********************************************************************************
|
5
|
+
|
6
|
+
# For more examples see: https://origen-sdk.org/origen/guides/pattern/timing/#Complex_Timing
|
7
|
+
|
8
|
+
# By default, all pins will drive for the whole period on drive cycles and strobe at 50%
|
9
|
+
# of the period on compare cycles, this can be overridden for all or specific pins as shown
|
10
|
+
# in the examples below.
|
11
|
+
|
12
|
+
# Example definition, defines an alternative default compare wave for all pins and specific
|
13
|
+
# drive timing for :tck
|
14
|
+
# timeset :func do |t|
|
15
|
+
# t.compare_wave do |w|
|
16
|
+
# w.compare :data, at: "period / 4"
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# t.drive_wave :tck do |w|
|
20
|
+
# w.drive :data, at: 0
|
21
|
+
# w.drive 0, at: 25
|
22
|
+
# w.dont_care at: "period - 10" # Just to show that dont_care can be used
|
23
|
+
# end
|
24
|
+
# end
|