origen_app_generators 1.1.4 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/bin/boot.rb +4 -2
  3. data/config/commands.rb +3 -3
  4. data/config/shared_commands.rb +17 -10
  5. data/config/version.rb +3 -4
  6. data/lib/origen_app_generators.rb +6 -4
  7. data/lib/origen_app_generators/application.rb +12 -12
  8. data/lib/origen_app_generators/base.rb +53 -9
  9. data/lib/origen_app_generators/new.rb +17 -9
  10. data/lib/{tasks/new_app_tests.rake → origen_app_generators/new_app_tests.rb} +1 -5
  11. data/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +6 -8
  12. data/lib/origen_app_generators/plugin.rb +4 -7
  13. data/lib/origen_app_generators/test_engineering/common.rb +29 -0
  14. data/lib/origen_app_generators/test_engineering/stand_alone_application.rb +9 -181
  15. data/lib/origen_app_generators/test_engineering/test_block.rb +4 -105
  16. data/templates/app_generators/application/Gemfile +17 -5
  17. data/templates/app_generators/application/{lib → app/blocks}/top_level.rb +1 -1
  18. data/templates/app_generators/application/app/lib/module.rb +6 -0
  19. data/templates/app_generators/application/{templates → app/templates}/web/index.md.erb +0 -0
  20. data/templates/app_generators/application/{templates → app/templates}/web/layouts/_basic.html.erb +0 -0
  21. data/templates/app_generators/application/{templates → app/templates}/web/partials/_navbar.html.erb +0 -0
  22. data/templates/app_generators/application/{templates → app/templates}/web/release_notes.md.erb +0 -0
  23. data/templates/app_generators/application/config/application.rb +51 -55
  24. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/application.rb +0 -0
  25. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/base.rb +0 -0
  26. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/module.rb +0 -0
  27. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/plugin.rb +0 -0
  28. data/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +1 -1
  29. data/templates/app_generators/plugin/Gemfile +13 -4
  30. data/templates/app_generators/plugin/{templates → app/templates}/web/index.md.erb +0 -0
  31. data/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_external.html.erb +0 -0
  32. data/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_internal.html.erb +0 -0
  33. data/templates/app_generators/plugin/gemspec.rb +4 -3
  34. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/j750.rb +0 -0
  35. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/uflex.rb +0 -0
  36. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/v93k.rb +0 -0
  37. data/templates/app_generators/test_engineering/stand_alone_application/.keep +0 -0
  38. data/templates/app_generators/test_engineering/test_block/.keep +0 -0
  39. metadata +25 -48
  40. data/bin/fix_my_workspace +0 -100
  41. data/lib/origen_app_generators/sub_block_parser.rb +0 -81
  42. data/lib/tasks/app_generators.rake +0 -6
  43. data/templates/app_generators/application/lib/app.rake +0 -6
  44. data/templates/app_generators/application/lib/module.rb +0 -22
  45. data/templates/app_generators/plugin/lib/README +0 -4
  46. data/templates/app_generators/plugin/lib_dev/README +0 -5
  47. data/templates/app_generators/test_engineering/stand_alone_application/Gemfile +0 -20
  48. data/templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb +0 -1
  49. data/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb +0 -23
  50. data/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb +0 -5
  51. data/templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb +0 -33
  52. data/templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb +0 -21
  53. data/templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb +0 -4
  54. data/templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb +0 -4
  55. data/templates/app_generators/test_engineering/test_block/environment/j750.rb +0 -2
  56. data/templates/app_generators/test_engineering/test_block/environment/ultraflex.rb +0 -2
  57. data/templates/app_generators/test_engineering/test_block/environment/v93k.rb +0 -2
  58. data/templates/app_generators/test_engineering/test_block/lib/controller.rb +0 -12
  59. data/templates/app_generators/test_engineering/test_block/lib/interface.rb +0 -21
  60. data/templates/app_generators/test_engineering/test_block/lib/model.rb +0 -18
  61. data/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb +0 -27
  62. data/templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb +0 -26
  63. data/templates/app_generators/test_engineering/test_block/pattern/example.rb +0 -5
  64. data/templates/app_generators/test_engineering/test_block/program/prb1.rb +0 -11
  65. data/templates/app_generators/test_engineering/test_block/target/default.rb +0 -2
@@ -1,8 +1,9 @@
1
1
  module OrigenAppGenerators
2
2
  module TestEngineering
3
- require 'origen_app_generators/sub_block_parser'
4
3
  # Generates a generic application shell
5
4
  class StandAloneApplication < Application
5
+ include Common
6
+
6
7
  desc 'A stand alone test engineering application'
7
8
 
8
9
  # Any methods that are not protected will get invoked in the order that they are
@@ -13,13 +14,12 @@ module OrigenAppGenerators
13
14
  # The methods to get the common user input that applies to all applications will
14
15
  # get called at the start automatically, you have a chance here to ask any additional
15
16
  # questions that are specific to the type of application being generated
16
- get_top_level_names
17
- get_sub_block_names
18
17
  end
19
18
 
20
19
  def generate_files
21
- # Calling this will build all files, directories and symlinks contained in the
22
- # hash returned by the filelist method
20
+ @development_dependencies = [
21
+ ['origen_testers']
22
+ ]
23
23
  build_filelist
24
24
  end
25
25
 
@@ -37,122 +37,8 @@ module OrigenAppGenerators
37
37
 
38
38
  protected
39
39
 
40
- def sub_block_parser
41
- @sub_block_parser ||= SubBlockParser.new
42
- end
43
-
44
- def get_top_level_names
45
- puts
46
- puts 'NAME YOUR TOP-LEVEL DEVICE(S)'
47
- puts
48
- puts 'What do you want to call the top-level class that represents your device?'
49
- puts 'By default it will be called TopLevel, but if you want this application to support multiple devices you should'
50
- puts 'give them unique names.'
51
- puts 'Separate multiple names with a comma: Falcon, Eagle, Vulture'
52
- puts
53
-
54
- valid = false
55
- until valid
56
- @top_level_names = get_text(single: true, default: 'TopLevel').strip.split(',').map do |name|
57
- name.strip.gsub(/\s+/, '_').camelize
58
- end
59
- unless @top_level_names.empty?
60
- # Should we check anything here?
61
- valid = true
62
- end
63
- end
64
- @top_level_names
65
- end
66
-
67
- def get_sub_block_names
68
- puts
69
- puts 'DEFINE YOUR SUB-BLOCKS'
70
- puts
71
- puts 'What sub-blocks does this device contain?'
72
- puts 'You can leave this blank, but entering some details of the sub-blocks you will want to involve in your tests'
73
- puts 'will save you some manual setup of the associated models and controllers.'
74
- puts 'You can specify layers of hierarchy and multiple instantiations, here are some examples:'
75
- puts
76
- puts ' A RAM, OSC, PLL and 2 ATDs at the top-level: ram, osc, pll, atd(2)'
77
- puts ' With 3 COMMS blocks with embedded components: ram, osc, pll, atd(2), comms[ram(2), osc](3)'
78
- if @top_level_names.size > 1
79
- puts
80
- puts 'If you want different modules for each of your top-level devices you can do:'
81
- puts
82
- puts " #{@top_level_names[0]}[ram, atd(2)], #{@top_level_names[1]}[ram(2), atd(4)]"
83
- end
84
- puts
85
-
86
- valid = false
87
- until valid
88
- input = get_text(single: true).strip
89
- if input.empty?
90
- @sub_blocks_lookup = {}
91
- valid = true
92
- else
93
- begin
94
- @sub_blocks_lookup = sub_block_parser.parse(input)
95
- valid = true
96
- rescue
97
- valid = false
98
- end
99
- end
100
- end
101
- @sub_blocks_lookup
102
- end
103
-
104
- # Returns a hash that looks like:
105
- #
106
- # {"Falcon"=>{"RAM"=>{}, "ATD"=>{:instances=>2}}, "Eagle"=>{"RAM"=>{:instances=>2}, "ATD"=>{:instances=>4}}}
107
- def top_level_sub_blocks
108
- blocks = {}
109
- # Make sure that each top-level object has a sub blocks assignment
110
- if @top_level_names.any? { |n| @sub_blocks_lookup[n] }
111
- @top_level_names.each do |name|
112
- if @sub_blocks_lookup[name]
113
- blocks[name] = @sub_blocks_lookup[name][:children] || {}
114
- else
115
- blocks[name] = {}
116
- end
117
- end
118
- # Duplicate the given sub blocks to all top-level objects if none have been specified
119
- else
120
- @top_level_names.each do |name|
121
- blocks[name] = @sub_blocks_lookup
122
- end
123
- end
124
- blocks
125
- end
126
-
127
- # Returns a hash with all sub-blocks at the top-level, e.g.:
128
- #
129
- # {"RAM"=>{}, "ATD"=>{}, "Comms"=>{"RAM"=>{:instances=>2}, "Osc"=>{}}, "Osc"=>{}}
130
- def sub_blocks
131
- blocks = {}
132
- top_level_sub_blocks.each do |top, attrs|
133
- extract_sub_blocks(attrs) do |name, attrs|
134
- if blocks[name]
135
- if blocks[name] != (attrs[:children] || {})
136
- Origen.log.warning "The app builder does not currently support different sub-block definitions for block #{name}"
137
- Origen.log.warning 'Only the first defintion has been built'
138
- end
139
- else
140
- blocks[name] = attrs[:children] || {}
141
- end
142
- end
143
- end
144
- blocks
145
- end
146
-
147
- def extract_sub_blocks(blocks, &block)
148
- blocks.each do |name, attrs|
149
- yield name, attrs
150
- extract_sub_blocks(attrs[:children], &block) if attrs[:children]
151
- end
152
- end
153
-
154
40
  # Defines the filelist for the generator, the default list is inherited from the
155
- # parent class (Application).
41
+ # parent class (Plugin).
156
42
  # The filelist can contain references to generate files, directories or symlinks in the
157
43
  # new application.
158
44
  #
@@ -160,74 +46,16 @@ module OrigenAppGenerators
160
46
  # from the parent generator, this means that your generator will automatically stay up
161
47
  # to date with the latest conventions
162
48
  #
163
- # The master templates live in templates/app_generators/application, but
49
+ # The master templates live in templates/app_generators/plugin, but
164
50
  # DO NOT MODIFY THESE FILES DIRECTLY.
165
51
  # Either add or remove things post-generation in the modify_files method or copy the
166
- # master file to the equivalent sub-directory of templates/app_generators/test_engineering/generic_stand_alone_application
52
+ # master file to the equivalent sub-directory of templates/app_generators/test_engineering/mpg_test_block
167
53
  # which will override the version in the master directory.
168
54
  #
169
55
  # Additional files can be added or removed from the filelist as shown below.
170
56
  def filelist
171
57
  @filelist ||= begin
172
- list = super # Always pick up the parent list
173
- # Example of how to remove a file from the parent list
174
- list.delete(:lib_top_level)
175
- list.delete(:target_debug)
176
- list.delete(:target_production)
177
- list.delete(:target_default)
178
- # Example of how to add a file, in this case the file will be compiled and copied to
179
- # the same location in the new app
180
- @top_level_names.each_with_index do |name, i|
181
- list["top_level_model_#{i}"] = { source: 'lib/top_level.rb',
182
- dest: "lib/#{@name}/#{name.underscore}.rb",
183
- options: { name: name, sub_blocks: top_level_sub_blocks[name] }
184
- }
185
-
186
- list["top_level_controller_#{i}"] = { source: 'lib/top_level_controller.rb',
187
- dest: "lib/#{@name}/#{name.underscore}_controller.rb",
188
- options: { name: name }
189
- }
190
-
191
- list["target_#{name}"] = { source: 'target/top_level.rb',
192
- dest: "target/#{name.underscore}.rb",
193
- options: { name: name }
194
- }
195
- if i == 0
196
- list[:target_default] = { source: "#{name.underscore}.rb", # Relative to the file being linked to
197
- dest: 'target/default.rb', # Relative to destination_root
198
- type: :symlink }
199
- end
200
- end
201
-
202
- sub_blocks.each do |name, blocks|
203
- list["ip_block_#{name}"] = { source: 'lib/ip_block.rb',
204
- dest: "lib/#{@name}/#{name.underscore}.rb",
205
- options: { name: name, sub_blocks: blocks }
206
- }
207
-
208
- list["ip_block_controller_#{name}"] = { source: 'lib/ip_block_controller.rb',
209
- dest: "lib/#{@name}/#{name.underscore}_controller.rb" }
210
- end
211
-
212
- list[:environment_j750] = { source: 'environment/j750.rb' }
213
- list[:environment_uflex] = { source: 'environment/uflex.rb' }
214
- list[:environment_v93k] = { source: 'environment/v93k.rb' }
215
- list[:environment_jlink] = { source: 'environment/jlink.rb' }
216
- # Alternatively specifying a different destination, typically you would do this when
217
- # the final location is dynamic
218
- # list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
219
- # Example of how to create a directory
220
- # list[:pattern_dir] = { dest: "pattern", type: :directory }
221
- # Example of how to create a symlink
222
- list[:environment_default] = { source: 'j750.rb', # Relative to the file being linked to
223
- dest: 'environment/default.rb', # Relative to destination_root
224
- type: :symlink }
225
- # Test engineering source directories
226
- list[:program_dir] = { dest: 'program', type: :directory }
227
- list[:pattern_dir] = { dest: 'pattern', type: :directory }
228
- # Example source files
229
- list[:pattern_example] = { source: 'pattern/example.rb' }
230
- # Remember to return the final list
58
+ list = common_filelist(super) # Always pick up the parent list
231
59
  list
232
60
  end
233
61
  end
@@ -2,6 +2,8 @@ module OrigenAppGenerators
2
2
  module TestEngineering
3
3
  # Generates a generic plugin shell
4
4
  class TestBlock < Plugin
5
+ include Common
6
+
5
7
  desc 'An IP test module intended to plugin into a top-level (SoC) application'
6
8
 
7
9
  def initialize(*args)
@@ -13,8 +15,6 @@ module OrigenAppGenerators
13
15
  # The methods to get the common user input that applies to all applications will
14
16
  # get called at the start automatically, you have a chance here to ask any additional
15
17
  # questions that are specific to the type of application being generated
16
- get_ip_names
17
- get_sub_block_name
18
18
  end
19
19
 
20
20
  def generate_files
@@ -25,72 +25,15 @@ module OrigenAppGenerators
25
25
  end
26
26
 
27
27
  def final_modifications
28
- prepend_to_file "lib/#{@name}.rb", "require 'origen_testers'\n"
29
- # Add require line
30
- doc_helpers = /gem 'origen_doc_helpers'/
31
- inject_into_file 'Gemfile', "\ngem 'origen_jtag'\ngem 'origen_arm_debug'\n",
32
- after: doc_helpers
28
+ prepend_to_file "app/lib/#{@name}.rb", "require 'origen_testers'\n"
33
29
  end
34
30
 
35
31
  def conclude
36
32
  puts "New test module created at: #{destination_root}"
37
- puts
38
- puts 'Generate an example pattern by running "origen g example"'
39
33
  end
40
34
 
41
35
  protected
42
36
 
43
- def get_ip_names
44
- puts
45
- puts 'NAME THE IP BLOCKS THAT THIS MODULE WILL SUPPORT'
46
- puts
47
- puts "You don't need to name them all up front, but you must declare at least one."
48
- puts 'We recommend that you use the official name(s) for the IP(s) as used by your design team.'
49
- puts 'Separate multiple names with a comma: FLASH_C40_512K, FLASH_C40_2M'
50
- puts
51
-
52
- valid = false
53
- until valid
54
- @ip_names = get_text(single: true).strip.split(',').map do |name|
55
- n = name.strip.symbolize.to_s.upcase
56
- unless n.empty?
57
- n
58
- end
59
- end.compact
60
- unless @ip_names.empty?
61
- # Should we check anything here?
62
- valid = true
63
- end
64
- end
65
- @ip_names
66
- end
67
-
68
- def get_sub_block_name
69
- puts
70
- puts "WHAT SHOULD BE THE PATH TO #{@ip_names.first} WHEN IT IS INSTANTIATED IN AN SOC?"
71
- puts
72
- puts 'Your IP(s) will be instantiated by a top-level (SoC) model, at which point it should be given a generic nickname'
73
- puts 'that will provide an easy way to access it.'
74
- puts 'For example, if you had an IP model for an NVM block, the IP name might be "FLASH_C40_512K_128K", but when it is'
75
- puts 'instantiated it would be given the name "flash", allowing it be easily accessed as "dut.flash".'
76
- puts
77
-
78
- valid = false
79
- until valid
80
- @sub_block_name = get_text(single: true).strip.split(',').map do |name|
81
- n = name.strip.symbolize.to_s.downcase
82
- unless n.empty?
83
- n
84
- end
85
- end.compact
86
- unless @sub_block_name.empty?
87
- # Should we check anything here?
88
- valid = true
89
- end
90
- end
91
- @sub_block_name = @sub_block_name.first
92
- end
93
-
94
37
  # Defines the filelist for the generator, the default list is inherited from the
95
38
  # parent class (Plugin).
96
39
  # The filelist can contain references to generate files, directories or symlinks in the
@@ -109,51 +52,7 @@ module OrigenAppGenerators
109
52
  # Additional files can be added or removed from the filelist as shown below.
110
53
  def filelist
111
54
  @filelist ||= begin
112
- list = super # Always pick up the parent list
113
- # Example of how to remove a file from the parent list
114
- list.delete(:target_debug)
115
- list.delete(:target_production)
116
- # Example of how to add a file, in this case the file will be compiled and copied to
117
- # the same location in the new app
118
- list[:target_default] = { source: 'target/default.rb' }
119
- list[:environment_v93k] = { source: 'environment/v93k.rb' }
120
- list[:environment_j750] = { source: 'environment/j750.rb' }
121
- list[:environment_ultraflex] = { source: 'environment/ultraflex.rb' }
122
- list[:program_prb1] = { source: 'program/prb1.rb' }
123
- list[:lib_interface] = { source: 'lib/interface.rb', dest: "lib/#{@name}/interface.rb" }
124
- # Alternatively specifying a different destination, typically you would do this when
125
- # the final location is dynamic
126
- # list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
127
- # Example of how to create a directory
128
- list[:pattern_dir] = { dest: 'pattern', type: :directory }
129
- # Example of how to create a symlink
130
- list[:environment_default] = { source: 'ultraflex.rb', # Relative to the file being linked to
131
- dest: 'environment/default.rb', # Relative to destination_root
132
- type: :symlink }
133
- list[:dev_dut] = { source: 'lib_dev/dut.rb',
134
- dest: "lib/#{@name}_dev/dut.rb",
135
- options: { class_name: @ip_names.first, sub_block_name: @sub_block_name }
136
- }
137
- list[:dev_dutc] = { source: 'lib_dev/dut_controller.rb',
138
- dest: "lib/#{@name}_dev/dut_controller.rb"
139
- }
140
-
141
- @ip_names.each_with_index do |name, i|
142
- list["ip_#{i}"] = { source: 'lib/model.rb',
143
- dest: "lib/#{@name}/#{name.underscore}.rb",
144
- options: { name: name }
145
- }
146
-
147
- list["ip_controller_#{i}"] = { source: 'lib/controller.rb',
148
- dest: "lib/#{@name}/#{name.underscore}_controller.rb",
149
- options: { name: name }
150
- }
151
- end
152
-
153
- list[:pattern_example] = { source: 'pattern/example.rb',
154
- options: { sub_block_name: @sub_block_name }
155
- }
156
- # Remember to return the final list
55
+ list = common_filelist(super) # Always pick up the parent list
157
56
  list
158
57
  end
159
58
  end
@@ -1,15 +1,27 @@
1
+ <% if (@audience != :external) && (Origen.site_config.gem_server_pull || Origen.site_config.gem_server) -%>
2
+ <% Array(Origen.site_config.gem_server_pull || Origen.site_config.gem_server).each do |server| -%>
3
+ source '<%= server %>'
4
+ <% end -%>
5
+ <% else %>
1
6
  source 'https://rubygems.org'
2
- <% if (@audience != :external) && Origen.site_config.gem_server -%>
3
- source '<%= Origen.site_config.gem_server %>'
4
7
  <% end -%>
5
8
 
6
9
  gem 'origen', '>= <%= @latest_origen_version %>'
7
10
 
8
- gem 'origen_doc_helpers'
9
-
10
11
  gem 'byebug'
11
12
 
12
- gem 'origen_updater'
13
+ gem 'origen_doc_helpers'
14
+ <% if @development_dependencies -%>
15
+ <% @development_dependencies.each do |dep| -%>
16
+ gem <%= dep.map{ |d| "\"#{d}\"" }.join(', ') %>
17
+ <% end -%>
18
+ <% end -%>
19
+
20
+ <% if (@audience != :external) && Origen.site_config.gem_push_plugins -%>
21
+ <% Origen.site_config.gem_push_plugins.each do |plugin| -%>
22
+ gem <%= Array(plugin).map{ |d| "\"#{d}\"" }.join(', ') %>
23
+ <% end -%>
24
+ <% end -%>
13
25
 
14
26
  # Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
15
27
  #gem 'ruby-debug-ide'
@@ -4,7 +4,7 @@ module <%= @namespace %>
4
4
  #
5
5
  # origen i
6
6
  #
7
- # > $dut.hi
7
+ # > dut.hi
8
8
  def hi
9
9
  puts "Hello master!"
10
10
  end
@@ -0,0 +1,6 @@
1
+ require 'origen'
2
+ <% if @type == :plugin -%>
3
+ require_relative '../../config/application.rb'
4
+ <% end -%>
5
+ module <%= @namespace %>
6
+ end
@@ -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 = "<%= @name %>"
10
- self.namespace = "<%= @namespace %>"
11
- config.name = "<%= @name %>"
12
- config.initials = "<%= @namespace %>"
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 = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/<%= @name %>"
27
- #config.web_domain = "http://origen-sdk.org/<%= @name %>"
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 = "/path/to/server/<%= @name %>"
30
- #config.web_domain = "http://origen.mycompany.net/<%= @name %>"
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: true,
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
- #files: ["lib", "config/application.rb"],
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
- # cc "This is a pattern created by the example origen application"
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
- # "#{Origen.root}/output/#{$dut.class}"
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
- # "#{Origen.root}/.ref/#{$dut.class}"
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
- # command = "origen web compile --remote --api"
79
- # Dir.chdir Origen.root do
80
- # system command
81
- # end
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 "All tests passing, proceeding with release process!"
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
- # if !system("origen specs") || !system("origen examples")
97
- # puts "Sorry but you can't release with failing tests, please fix them and try again."
98
- # exit 1
99
- # else
100
- # puts "All tests passing, proceeding with release process!"
101
- # end
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
- # PatternDispatcher.new.dispatch_or_return(requested_pattern)
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
- # name.gsub(/_b\d/, "_bx")
123
- #end
124
-
118
+ # config.pattern_name_translator do |name|
119
+ # name.gsub(/_b\d/, "_bx")
120
+ # end
125
121
  end