origen 0.38.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/origen +1 -236
- data/config/application.rb +10 -1
- data/config/version.rb +1 -1
- data/lib/origen/{boot_api.rb → boot/api.rb} +2 -2
- data/lib/origen/boot/app.rb +324 -0
- data/lib/origen/boot.rb +287 -0
- data/lib/origen/commands/archive.rb +175 -0
- data/lib/origen/commands/extract.rb +43 -0
- data/lib/origen/commands/new.rb +33 -23
- data/lib/origen/commands.rb +4 -1
- data/lib/origen/commands_global.rb +3 -2
- data/lib/origen/operating_systems.rb +4 -0
- data/lib/origen/revision_control.rb +1 -1
- data/lib/origen/site_config.rb +4 -1
- data/lib/origen.rb +3 -2
- data/origen_app_generators/Gemfile +16 -0
- data/origen_app_generators/Gemfile.lock +147 -0
- data/origen_app_generators/LICENSE +21 -0
- data/origen_app_generators/README.md +368 -0
- data/origen_app_generators/Rakefile +10 -0
- data/origen_app_generators/bin/boot.rb +37 -0
- data/{bin → origen_app_generators/bin}/fix_my_workspace +0 -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 +172 -0
- data/origen_app_generators/config/version.rb +8 -0
- data/origen_app_generators/doc/history +213 -0
- data/origen_app_generators/lib/origen_app_generators/application.rb +62 -0
- data/origen_app_generators/lib/origen_app_generators/base.rb +231 -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 +162 -0
- data/origen_app_generators/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +109 -0
- data/origen_app_generators/lib/origen_app_generators/plugin.rb +58 -0
- data/origen_app_generators/lib/origen_app_generators/sub_block_parser.rb +81 -0
- data/origen_app_generators/lib/origen_app_generators/test_engineering/stand_alone_application.rb +236 -0
- data/origen_app_generators/lib/origen_app_generators/test_engineering/test_block.rb +162 -0
- data/origen_app_generators/lib/origen_app_generators.rb +123 -0
- data/origen_app_generators/lib/tasks/app_generators.rake +6 -0
- data/origen_app_generators/lib/tasks/new_app_tests.rake +8 -0
- data/origen_app_generators/origen_app_generators.gemspec +33 -0
- data/origen_app_generators/spec/spec_helper.rb +49 -0
- data/origen_app_generators/spec/sub_block_spec.rb +36 -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/Gemfile +19 -0
- data/origen_app_generators/templates/app_generators/application/Rakefile +7 -0
- data/origen_app_generators/templates/app_generators/application/config/application.rb +125 -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/lib/app.rake +6 -0
- data/origen_app_generators/templates/app_generators/application/lib/module.rb +22 -0
- data/origen_app_generators/templates/app_generators/application/lib/top_level.rb +12 -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/application/templates/web/index.md.erb +19 -0
- data/origen_app_generators/templates/app_generators/application/templates/web/layouts/_basic.html.erb +13 -0
- data/origen_app_generators/templates/app_generators/application/templates/web/partials/_navbar.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/application/templates/web/release_notes.md.erb +5 -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/config/load_generators.rb +6 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/lib/application.rb +54 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/lib/base.rb +55 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/lib/module.rb +28 -0
- data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/lib/plugin.rb +64 -0
- data/origen_app_generators/templates/app_generators/plugin/Gemfile +26 -0
- data/origen_app_generators/templates/app_generators/plugin/Rakefile +10 -0
- data/origen_app_generators/templates/app_generators/plugin/config/boot.rb +24 -0
- data/origen_app_generators/templates/app_generators/plugin/gemspec.rb +42 -0
- data/origen_app_generators/templates/app_generators/plugin/lib/README +4 -0
- data/origen_app_generators/templates/app_generators/plugin/lib_dev/README +5 -0
- data/origen_app_generators/templates/app_generators/plugin/templates/web/index.md.erb +37 -0
- data/origen_app_generators/templates/app_generators/plugin/templates/web/partials/_navbar_external.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/plugin/templates/web/partials/_navbar_internal.html.erb +20 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/Gemfile +23 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/j750.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/uflex.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/v93k.rb +1 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb +23 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb +5 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb +33 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb +21 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb +4 -0
- data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb +4 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/j750.rb +2 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/ultraflex.rb +2 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/v93k.rb +2 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/controller.rb +12 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/interface.rb +21 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/model.rb +18 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb +27 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb +26 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/pattern/example.rb +5 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/program/prb1.rb +11 -0
- data/origen_app_generators/templates/app_generators/test_engineering/test_block/target/default.rb +2 -0
- data/origen_site_config.yml +13 -2
- data/templates/git/gitignore.erb +0 -1
- metadata +99 -4
@@ -0,0 +1,54 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
# This will be the parent class of all of your application generators, it provides a place
|
3
|
+
# to add anything that you want to be added to all of your applications
|
4
|
+
class Application < OrigenAppGenerators::Application
|
5
|
+
include Base
|
6
|
+
|
7
|
+
# Any methods added above the protected line will get automatically invoked
|
8
|
+
# at the start of *all* of your application generators.
|
9
|
+
|
10
|
+
protected
|
11
|
+
|
12
|
+
# You can add helper methods that you want to make available to all of your application
|
13
|
+
# generators here, these will not get called unless a child generator calls them.
|
14
|
+
|
15
|
+
# Here you can modify the default list of files that are included in all of your applications.
|
16
|
+
#
|
17
|
+
# See here for the default list of files:
|
18
|
+
# https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/application.rb
|
19
|
+
#
|
20
|
+
# The filelist can contain references to generate files, directories or symlinks in the
|
21
|
+
# new application.
|
22
|
+
#
|
23
|
+
# To make your generators more maintainable, try and re-use as much as possible
|
24
|
+
# from the parent generator, this means that your generator will automatically stay up
|
25
|
+
# to date with the latest conventions.
|
26
|
+
#
|
27
|
+
# Additional files can be added or removed from the filelist as shown below.
|
28
|
+
def filelist
|
29
|
+
@filelist ||= begin
|
30
|
+
list = super # Always pick up the parent list
|
31
|
+
# Example of how to remove a file from the parent list
|
32
|
+
# list.delete(:web_doc_layout)
|
33
|
+
# Example of how to add a file, in this case the file will be compiled and copied to
|
34
|
+
# the same location in the new app
|
35
|
+
# list[:config_shared_commands] = { source: 'config/shared_commands.rb' }
|
36
|
+
# Alternatively specifying a different destination, typically you would do this when
|
37
|
+
# the final location is dynamic
|
38
|
+
# list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
|
39
|
+
# Example of how to recursively copy a directory
|
40
|
+
# list[:copy_dir] = { source: 'src_dir', dest: 'dest_dir', type: :directory, copy: true }
|
41
|
+
# Example of how to create a directory
|
42
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory }
|
43
|
+
# By default, directories created in this way will contain a .keep file, to inhibit this:
|
44
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory, nokeep: true }
|
45
|
+
# Example of how to create a symlink
|
46
|
+
# list[:target_default] = { source: 'debug.rb', # Relative to the file being linked to
|
47
|
+
# dest: 'target/default.rb', # Relative to destination_root
|
48
|
+
# type: :symlink }
|
49
|
+
# Remember to return the final list
|
50
|
+
list
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
# This is a mixin that is included in both the application and plugin
|
3
|
+
# generators, it provides a place to add things that should apply to
|
4
|
+
# all of your applications and plugins
|
5
|
+
module Base
|
6
|
+
# Any helper methods added to this base module will not be automatically invoked,
|
7
|
+
# you must call them from either the top-level application or plugin generators,
|
8
|
+
# or from a child generator.
|
9
|
+
|
10
|
+
protected
|
11
|
+
|
12
|
+
# Here you can modify the default list of files that are included in all of your
|
13
|
+
# applications AND plugins.
|
14
|
+
#
|
15
|
+
# See here for the default list of files:
|
16
|
+
# https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/application.rb
|
17
|
+
# If the child generator is a plugin, then this list is then modified by the base plugin generator which
|
18
|
+
# you can see here:
|
19
|
+
# https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/plugin.rb
|
20
|
+
#
|
21
|
+
# The filelist can contain references to generate files, directories or symlinks in the
|
22
|
+
# new application.
|
23
|
+
#
|
24
|
+
# To make your generators more maintainable, try and re-use as much as possible
|
25
|
+
# from the parent generators, this means that your generator will automatically stay up
|
26
|
+
# to date with the latest conventions.
|
27
|
+
#
|
28
|
+
# Additional files can be added or removed from the filelist as shown below.
|
29
|
+
def filelist
|
30
|
+
@filelist ||= begin
|
31
|
+
list = super # Always pick up the parent list
|
32
|
+
# Example of how to remove a file from the parent list
|
33
|
+
# list.delete(:web_doc_layout)
|
34
|
+
# Example of how to add a file, in this case the file will be compiled and copied to
|
35
|
+
# the same location in the new app
|
36
|
+
# list[:config_shared_commands] = { source: 'config/shared_commands.rb' }
|
37
|
+
# Alternatively specifying a different destination, typically you would do this when
|
38
|
+
# the final location is dynamic
|
39
|
+
# list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
|
40
|
+
# Example of how to recursively copy a directory
|
41
|
+
# list[:copy_dir] = { source: 'src_dir', dest: 'dest_dir', type: :directory, copy: true }
|
42
|
+
# Example of how to create a directory
|
43
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory }
|
44
|
+
# By default, directories created in this way will contain a .keep file, to inhibit this:
|
45
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory, nokeep: true }
|
46
|
+
# Example of how to create a symlink
|
47
|
+
# list[:target_default] = { source: 'debug.rb', # Relative to the file being linked to
|
48
|
+
# dest: 'target/default.rb', # Relative to destination_root
|
49
|
+
# type: :symlink }
|
50
|
+
# Remember to return the final list
|
51
|
+
list
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'origen_app_generators'
|
2
|
+
require '<%= @name %>/base'
|
3
|
+
require '<%= @name %>/application'
|
4
|
+
require '<%= @name %>/plugin'
|
5
|
+
|
6
|
+
module <%= @namespace %>
|
7
|
+
# Define test sets of inputs to test your generators. The last item in each array is
|
8
|
+
# required and always indicates what action should be taken once the application has
|
9
|
+
# been built. nil means take no action, :default means to run a default set of test
|
10
|
+
# operations, and an array of Origen command strings gives you control of exactly
|
11
|
+
# what to run.
|
12
|
+
#
|
13
|
+
# These inputs can be executed individually by running 'origen app_gen:test -i INDEX',
|
14
|
+
# where INDEX is the index number of the set you want to execute from the TEST_INPUTS
|
15
|
+
# array.
|
16
|
+
#
|
17
|
+
# You can also execute all sets of test inputs by running: 'origen app_gen:test -r'
|
18
|
+
TEST_INPUTS = [
|
19
|
+
] # END_OF_TEST_INPUTS Don't remove this comment, it is used by the app_gen:new command!
|
20
|
+
|
21
|
+
# As you add new generators to this app they will be entered here, this enables the
|
22
|
+
# mechanism to register them with the 'origen new' command.
|
23
|
+
# You should generally not modify this by hand, instead use the 'origen app_gen:new'
|
24
|
+
# command every time you want to create a new generator, and this will be filled in
|
25
|
+
# for you.
|
26
|
+
AVAILABLE = {
|
27
|
+
}
|
28
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
# This will be the parent class of all of your plugin generators, it provides a place
|
3
|
+
# to add anything that you want to be added to all of your plugins
|
4
|
+
class Plugin < OrigenAppGenerators::Plugin
|
5
|
+
include Base
|
6
|
+
|
7
|
+
def initialize(*args)
|
8
|
+
# This makes all of your plugins be configured for internal distribution, i.e. rather
|
9
|
+
# than via rubygems.org
|
10
|
+
@audience = :internal
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
# Any methods added above the protected line will get automatically invoked
|
15
|
+
# at the start of *all* of your plugin generators.
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
# You can add helper methods that you want to make available to all of your plugin
|
20
|
+
# generators here, these will not get called unless a child generator calls them.
|
21
|
+
|
22
|
+
# Here you can modify the default list of files that are included in all of your plugins.
|
23
|
+
#
|
24
|
+
# Since this is a plugin generator, the default list of files comprises the application list,
|
25
|
+
# which you can see here:
|
26
|
+
# https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/application.rb
|
27
|
+
# And this is then modified by the base plugin generator which you can see here:
|
28
|
+
# https://github.com/Origen-SDK/origen_app_generators/blob/master/lib/origen_app_generators/plugin.rb
|
29
|
+
#
|
30
|
+
# The filelist can contain references to generate files, directories or symlinks in the
|
31
|
+
# new plugin.
|
32
|
+
#
|
33
|
+
# To make your generators more maintainable, try and re-use as much as possible
|
34
|
+
# from the parent generator, this means that your generators will automatically stay up
|
35
|
+
# to date with the latest conventions.
|
36
|
+
#
|
37
|
+
# Additional files can be added or removed from the filelist as shown below.
|
38
|
+
def filelist
|
39
|
+
@filelist ||= begin
|
40
|
+
list = super # Always pick up the parent list
|
41
|
+
# Example of how to remove a file from the parent list
|
42
|
+
# list.delete(:web_doc_layout)
|
43
|
+
# Example of how to add a file, in this case the file will be compiled and copied to
|
44
|
+
# the same location in the new app
|
45
|
+
# list[:config_shared_commands] = { source: 'config/shared_commands.rb' }
|
46
|
+
# Alternatively specifying a different destination, typically you would do this when
|
47
|
+
# the final location is dynamic
|
48
|
+
# list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
|
49
|
+
# Example of how to recursively copy a directory
|
50
|
+
# list[:copy_dir] = { source: 'src_dir', dest: 'dest_dir', type: :directory, copy: true }
|
51
|
+
# Example of how to create a directory
|
52
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory }
|
53
|
+
# By default, directories created in this way will contain a .keep file, to inhibit this:
|
54
|
+
# list[:pattern_dir] = { dest: "pattern", type: :directory, nokeep: true }
|
55
|
+
# Example of how to create a symlink
|
56
|
+
# list[:target_default] = { source: 'debug.rb', # Relative to the file being linked to
|
57
|
+
# dest: 'target/default.rb', # Relative to destination_root
|
58
|
+
# type: :symlink }
|
59
|
+
# Remember to return the final list
|
60
|
+
list
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% if (@audience != :external) && Origen.site_config.gem_server -%>
|
2
|
+
<% Array(Origen.site_config.gem_server).each do |server| -%>
|
3
|
+
source '<%= server %>'
|
4
|
+
<% end -%>
|
5
|
+
<% else %>
|
6
|
+
source 'https://rubygems.org'
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
# Only development dependencies (things your plugin needs only when it is running in its own workspace)
|
10
|
+
# should be listed here in the Gemfile
|
11
|
+
<% if @audience == :external -%>
|
12
|
+
# This gem provides integration with https://coveralls.io/ to monitor
|
13
|
+
# your application's test coverage
|
14
|
+
gem 'coveralls', require: false
|
15
|
+
<% end -%>
|
16
|
+
gem 'byebug', '<9.1.0' # This version restriction required if you need Ruby < 2.2, otherwise you can remove it
|
17
|
+
gem 'ripper-tags'
|
18
|
+
gem 'origen_doc_helpers'
|
19
|
+
gem 'origen_updater'
|
20
|
+
# Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
|
21
|
+
#gem 'ruby-debug-ide'
|
22
|
+
#gem 'debase'
|
23
|
+
|
24
|
+
# Specify your gem's runtime dependencies in <%= @name %>.gemspec
|
25
|
+
# THIS LINE SHOULD BE LEFT AT THE END
|
26
|
+
gemspec
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/<%= @name %>.rake, and they will automatically
|
3
|
+
# be available to Rake.
|
4
|
+
#
|
5
|
+
# Any task files found in lib/tasks/shared/*.rake will be made available to 3rd party
|
6
|
+
# apps that use this plugin
|
7
|
+
require "bundler/setup"
|
8
|
+
require "origen"
|
9
|
+
|
10
|
+
Origen.app.load_tasks
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This file is used to boot your plugin when it is running in standalone mode
|
2
|
+
# from its own workspace - i.e. when the plugin is being developed.
|
3
|
+
#
|
4
|
+
# It will not be loaded when the plugin is imported by a 3rd party app - in that
|
5
|
+
# case only lib/<%= @name %>.rb is loaded.
|
6
|
+
#
|
7
|
+
# Therefore this file can be used to load anything extra that you need to boot
|
8
|
+
# the development environment for this app. For example, this is typically used
|
9
|
+
# to load some additional test classes to use your plugin APIs so that they can
|
10
|
+
# be tested and/or interacted with in the console.
|
11
|
+
require "<%= @name %>"
|
12
|
+
|
13
|
+
module <%= @namespace %>Dev
|
14
|
+
# Example of how to explicitly require a file
|
15
|
+
# require "<%= @name %>_dev/my_file"
|
16
|
+
|
17
|
+
# Load all files in the lib/<%= @name %>_dev directory.
|
18
|
+
# Note that there is no problem from requiring a file twice (Ruby will ignore
|
19
|
+
# the second require), so if you have a file that must be required first, then
|
20
|
+
# explicitly require it up above and then let this take care of the rest.
|
21
|
+
Dir.glob("#{File.dirname(__FILE__)}/../lib/<%= @name %>_dev/**/*.rb").sort.each do |file|
|
22
|
+
require file
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,42 @@
|
|
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 = "<%= @name %>"
|
7
|
+
spec.version = <%= @namespace %>::VERSION
|
8
|
+
spec.authors = ["<%= User.current.name %>"]
|
9
|
+
spec.email = ["<%= User.current.email %>"]
|
10
|
+
spec.summary = "<%= @summary %>"
|
11
|
+
<% if @audience == :external -%>
|
12
|
+
#spec.homepage = "http://origen-sdk.org/<%= @name %>"
|
13
|
+
<% else -%>
|
14
|
+
#spec.homepage = "http://origen.mycompany.net/<%= @name %>"
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
spec.required_ruby_version = '>= 2'
|
18
|
+
spec.required_rubygems_version = '>= 1.8.11'
|
19
|
+
|
20
|
+
# Only the files that are hit by these wildcards will be included in the
|
21
|
+
# packaged gem, the default should hit everything in most cases but this will
|
22
|
+
# need to be added to if you have any custom directories
|
23
|
+
spec.files = Dir["lib/<%= @name %>.rb", "lib/<%= @name %>/**/*.rb", "templates/**/*", "config/**/*.rb",
|
24
|
+
"bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb",
|
25
|
+
"program/**/*.rb"
|
26
|
+
]
|
27
|
+
spec.executables = []
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
# Add any gems that your plugin needs to run within a host application
|
31
|
+
spec.add_runtime_dependency "origen", ">= <%= @latest_origen_version %>"
|
32
|
+
<% if @runtime_dependencies -%>
|
33
|
+
<% @runtime_dependencies.each do |dep| -%>
|
34
|
+
spec.add_runtime_dependency <%= dep.map{ |d| "\"#{d}\"" }.join(', ') %>
|
35
|
+
<% end -%>
|
36
|
+
<% end -%>
|
37
|
+
<% if @post_runtime_dependency_comments -%>
|
38
|
+
<% @post_runtime_dependency_comments.each do |line| -%>
|
39
|
+
# <%= line %>
|
40
|
+
<% end -%>
|
41
|
+
<% end -%>
|
42
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
This directory should include any code related to testing, documentation, etc., but which
|
2
|
+
will not be required whenever this plugin is actually used within a 3rd party application.
|
3
|
+
|
4
|
+
Any code that will be required when used within a 3rd party application, should be placed
|
5
|
+
in lib/<%= @name %> instead.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
% render "layouts/basic.html" do
|
2
|
+
|
3
|
+
%# HTML tags can be embedded in mark down files if you want to do specific custom
|
4
|
+
%# formatting like this, but in most cases that is not required.
|
5
|
+
<h1><%= Origen.app.namespace %> <span style="font-size: 14px">(<%= Origen.app.version %>)</span></h1>
|
6
|
+
|
7
|
+
### Purpose
|
8
|
+
|
9
|
+
This plugin...
|
10
|
+
|
11
|
+
### How To Install
|
12
|
+
|
13
|
+
In your Gemfile add:
|
14
|
+
|
15
|
+
~~~ruby
|
16
|
+
gem "<%= Origen.app.name %>"
|
17
|
+
~~~
|
18
|
+
|
19
|
+
or if your application is a plugin, then add this to your <code>.gemspec</code>
|
20
|
+
|
21
|
+
~~~ruby
|
22
|
+
spec.add_runtime_dependency "<%= Origen.app.name %>", ">= <%= Origen.app.version %>"
|
23
|
+
~~~
|
24
|
+
|
25
|
+
__NOTE:__ In the case of a plugin, you will also need to <code>require '<%= Origen.app.name %>'</code> somewhere in your environment.
|
26
|
+
|
27
|
+
|
28
|
+
### How To Use
|
29
|
+
|
30
|
+
Add quickstart documentation here...
|
31
|
+
|
32
|
+
|
33
|
+
### How To Setup a Development Environment
|
34
|
+
|
35
|
+
Describe how a developer would setup a new workspace for this plugin...
|
36
|
+
|
37
|
+
% end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<nav class="navbar navbar-inverse navbar-fixed-top">
|
2
|
+
<div class="container">
|
3
|
+
<div class="navbar-header">
|
4
|
+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
5
|
+
<span class="sr-only">Toggle navigation</span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
</button>
|
10
|
+
<a class="navbar-brand" href="<%= path "/" %>">Home</a>
|
11
|
+
</div>
|
12
|
+
<div id="navbar" class="collapse navbar-collapse">
|
13
|
+
<ul class="nav navbar-nav">
|
14
|
+
<li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
|
15
|
+
<li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
|
16
|
+
</ul>
|
17
|
+
<%= import "origen/web/logo.html" %>
|
18
|
+
</div><!--/.nav-collapse -->
|
19
|
+
</div>
|
20
|
+
</nav>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<nav class="navbar navbar-inverse navbar-fixed-top">
|
2
|
+
<div class="container">
|
3
|
+
<div class="navbar-header">
|
4
|
+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
5
|
+
<span class="sr-only">Toggle navigation</span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
</button>
|
10
|
+
<a class="navbar-brand" href="<%= path "/" %>">Home</a>
|
11
|
+
</div>
|
12
|
+
<div id="navbar" class="collapse navbar-collapse">
|
13
|
+
<ul class="nav navbar-nav">
|
14
|
+
<li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
|
15
|
+
<li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
|
16
|
+
</ul>
|
17
|
+
<%= import "origen/web/logo.html" %>
|
18
|
+
</div><!--/.nav-collapse -->
|
19
|
+
</div>
|
20
|
+
</nav>
|
data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/Gemfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
<% if (@audience != :external) && Origen.site_config.gem_server -%>
|
2
|
+
<% Array(Origen.site_config.gem_server).each do |server| -%>
|
3
|
+
source '<%= server %>'
|
4
|
+
<% end -%>
|
5
|
+
<% else %>
|
6
|
+
source 'https://rubygems.org'
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
gem 'origen', '>= <%= @latest_origen_version %>'
|
10
|
+
|
11
|
+
gem 'origen_testers'
|
12
|
+
|
13
|
+
gem 'origen_debuggers'
|
14
|
+
|
15
|
+
gem 'origen_doc_helpers'
|
16
|
+
|
17
|
+
gem 'byebug'
|
18
|
+
|
19
|
+
gem 'origen_updater'
|
20
|
+
|
21
|
+
# Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
|
22
|
+
#gem 'ruby-debug-ide'
|
23
|
+
#gem 'debase'
|
@@ -0,0 +1 @@
|
|
1
|
+
OrigenTesters::J750.new
|
@@ -0,0 +1 @@
|
|
1
|
+
OrigenDebuggers::JLink.new
|
@@ -0,0 +1 @@
|
|
1
|
+
OrigenTesters::UltraFLEX.new
|
@@ -0,0 +1 @@
|
|
1
|
+
OrigenTesters::V93K.new
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class <%= @options[:name] %>
|
3
|
+
include Origen::Model
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
instantiate_registers(options)
|
7
|
+
instantiate_sub_blocks(options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def instantiate_registers(options = {})
|
11
|
+
end
|
12
|
+
|
13
|
+
def instantiate_sub_blocks(options = {})
|
14
|
+
<% @options[:sub_blocks].each do |name, attrs| -%>
|
15
|
+
<% if attrs[:instances] -%>
|
16
|
+
sub_block :<%= name.underscore %>, instances: <%= attrs[:instances] %>, class_name: '<%= name.camelize %>'
|
17
|
+
<% else -%>
|
18
|
+
sub_block :<%= name.underscore %>, class_name: '<%= name.camelize %>'
|
19
|
+
<% end -%>
|
20
|
+
<% end -%>
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class <%= @options[:name] || 'TopLevel' %>
|
3
|
+
include Origen::TopLevel
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
instantiate_pins(options)
|
7
|
+
instantiate_registers(options)
|
8
|
+
instantiate_sub_blocks(options)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instantiate_pins(options = {})
|
12
|
+
add_pin :tclk
|
13
|
+
add_pin :tdi
|
14
|
+
add_pin :tdo
|
15
|
+
add_pin :tms
|
16
|
+
add_pin :resetb
|
17
|
+
add_pins :port_a, size: 8
|
18
|
+
end
|
19
|
+
|
20
|
+
def instantiate_registers(options = {})
|
21
|
+
end
|
22
|
+
|
23
|
+
def instantiate_sub_blocks(options = {})
|
24
|
+
<% @options[:sub_blocks].each do |name, attrs| -%>
|
25
|
+
<% if attrs[:instances] -%>
|
26
|
+
sub_block :<%= name.underscore %>, instances: <%= attrs[:instances] %>, class_name: '<%= name.camelize %>'
|
27
|
+
<% else -%>
|
28
|
+
sub_block :<%= name.underscore %>, class_name: '<%= name.camelize %>'
|
29
|
+
<% end -%>
|
30
|
+
<% end -%>
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class <%= @options[:name] || 'TopLevel' %>Controller
|
3
|
+
include Origen::Controller
|
4
|
+
|
5
|
+
def startup(options)
|
6
|
+
pp 'Enter test mode' do
|
7
|
+
tester.set_timeset('func_25mhz', 40) # Where 40 is the period in ns
|
8
|
+
pin(:tclk).drive!(1)
|
9
|
+
pin(:resetb).drive!(1)
|
10
|
+
tester.wait time_in_us: 100
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def shutdown(options)
|
15
|
+
pp 'Reset the device' do
|
16
|
+
pin(:resetb).drive!(0)
|
17
|
+
pin(:tclk).drive!(0)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/controller.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class <%= @options[:name] %>Controller
|
3
|
+
include Origen::Controller
|
4
|
+
|
5
|
+
def do_something
|
6
|
+
# The config register is defined in the corresponding model
|
7
|
+
config.mode.write!(0x14)
|
8
|
+
tester.wait(time_in_us: 100)
|
9
|
+
config.secure.read!(0)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/interface.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class Interface
|
3
|
+
include OrigenTesters::ProgramGenerators
|
4
|
+
|
5
|
+
# This will be called at the start of every flow or sub-flow (whenever Flow.create
|
6
|
+
# is called).
|
7
|
+
# Any options passed to Flow.create will be passed in here.
|
8
|
+
# The options will contain top_level: true, whenever this is called at the start of
|
9
|
+
# a new top-level flow.
|
10
|
+
def startup(options = {})
|
11
|
+
end
|
12
|
+
|
13
|
+
# This will be called at the end of every flow or sub-flow (at the end of every
|
14
|
+
# Flow.create block).
|
15
|
+
# Any options passed to Flow.create will be passed in here.
|
16
|
+
# The options will contain top_level: true, whenever this is called at the end of a
|
17
|
+
# top-level flow file.
|
18
|
+
def shutdown(options = {})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module <%= @namespace %>
|
2
|
+
class <%= @options[:name] %>
|
3
|
+
include Origen::Model
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
instantiate_registers(options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def instantiate_registers(options)
|
10
|
+
# Define your IP's registers here
|
11
|
+
reg :config, 0x0, size: 32 do |reg|
|
12
|
+
reg.bits 15..8, :mode
|
13
|
+
reg.bit 1, :ext_clk, reset: 1
|
14
|
+
reg.bit 0, :secure, access: :ro
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module <%= @namespace %>Dev
|
2
|
+
# This is a dummy DUT class that should be used to test that your test module can
|
3
|
+
# integrate into a top-level app
|
4
|
+
class DUT
|
5
|
+
include Origen::TopLevel
|
6
|
+
include OrigenJTAG
|
7
|
+
include OrigenARMDebug
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
instantiate_pins(options)
|
11
|
+
instantiate_sub_blocks(options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def instantiate_pins(options)
|
15
|
+
add_pin :tclk
|
16
|
+
add_pin :tdi
|
17
|
+
add_pin :tdo
|
18
|
+
add_pin :tms
|
19
|
+
add_pin :resetb
|
20
|
+
end
|
21
|
+
|
22
|
+
def instantiate_sub_blocks(options)
|
23
|
+
sub_block :arm_debug, class_name: 'OrigenARMDebug::DAP', mem_aps: { mem_ap: 0x0, mdmap: 0x0100_0000 }
|
24
|
+
sub_block :<%= options[:sub_block_name] %>, class_name: '<%= @namespace %>::<%= options[:class_name] %>', base_address: 0x1000_0000
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|