origen_app_generators 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0db247768f806c9048a8a170957e6d7911495b29
4
- data.tar.gz: 20fc9fd317c56b32ed52fcb88d3c7737c70bf395
3
+ metadata.gz: c72ec7c295367269fb14603d3d5e0685e27c1302
4
+ data.tar.gz: 2b017360b1a782945a2bd950c07667eb4f12951f
5
5
  SHA512:
6
- metadata.gz: b3e5028c9bcdd7b4d705c9aadc7f1f78ca072c1d71ca93d7a9a4a0e304709ca487be09b2df824b3210dd84c6ff294bc96058f64e125f24e6d6144f98e6a52826
7
- data.tar.gz: 265df3f84efee3c51223351a9c6b70b1086d28b830187b0c966f935aa75bdefbdef027ef9dbb1a2c490b68c62a0cae8d8ea78c5f37ecc1bbb03eb98e579552a3
6
+ metadata.gz: 4b8a4fafa1c1f106b10dcc34311277e7fe986dcc5d65c485e4e0a9135b69bd0d41a5ee2e54a20619687b23fbb68be0047c8e599d97402ad096c7024dc6fa5463
7
+ data.tar.gz: 7575ca6ad90c50c62fc4561cf608f2c7c36423dd3d8d29a73a8206ab064346a4ab55d01c2ef205002a7b6da5f8c0b8952e2dd717535b5a9a64600292f23eac58
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
+
4
+ if $_fix_my_workspace_version_check
5
+ $_fix_my_workspace_version = '0.6.0'
6
+ else
7
+ require 'origen'
8
+
9
+ if !Origen.site_config.gem_manage_bundler
10
+ puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
11
+ puts 'that I cannot make certain assumptions about how your workspace is configured.'
12
+ puts 'You will need to either resolve this problem yourself, or else change the value of'
13
+ puts 'gem_mange_bundler to true.'
14
+ puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
15
+
16
+ else
17
+ ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
18
+ ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
19
+ ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
20
+
21
+ # Force copy system gems to local gems
22
+ if Origen.site_config.gem_use_from_system
23
+ local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
24
+ gem_dir = Pathname.new(Gem.dir)
25
+
26
+ Origen.site_config.gem_use_from_system.each do |gem, version|
27
+ begin
28
+ # This will raise an error if the system doesn't have this gem installed, that
29
+ # will be rescued below
30
+ spec = Gem::Specification.find_by_name(gem, version)
31
+
32
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
33
+ FileUtils.mkdir_p local_dir
34
+ FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
35
+
36
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
37
+ FileUtils.mkdir_p local_file.dirname
38
+ FileUtils.cp(spec.cache_file, local_file)
39
+
40
+ if spec.extension_dir && File.exist?(spec.extension_dir)
41
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
42
+ FileUtils.mkdir_p local_dir
43
+ FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
44
+ end
45
+
46
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
47
+ FileUtils.mkdir_p local_file.dirname
48
+ FileUtils.cp(spec.spec_file, local_file)
49
+
50
+ rescue Gem::LoadError
51
+ # This just means that one of the gems that should be copied from the system
52
+ # was not actually installed in the system, so nothing we can do about that here
53
+ end
54
+ end
55
+ end
56
+
57
+ # Delete lbin
58
+ FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
59
+
60
+ # Run bundler with correct switches
61
+ cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
62
+ `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
63
+ `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
64
+ `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
65
+
66
+ # Try again, this time updating the bundle
67
+ if system(cmd)
68
+ fixed = true
69
+ elsif system 'bundle update'
70
+ fixed = true
71
+ end
72
+
73
+ if File.exist?(ENV['BUNDLE_BIN'])
74
+ `chmod o-w #{ENV['BUNDLE_BIN']}`
75
+
76
+ # Make .bat versions of all executables, Bundler should really be doing this when running
77
+ # on windows
78
+ if Origen.os.windows?
79
+ Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
80
+ unless bin =~ /.bat$/
81
+ bat = "#{bin}.bat"
82
+ unless File.exist?(bat)
83
+ File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+
90
+ system 'origen -v' if fixed
91
+ end
92
+ end
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenAppGenerators
2
2
  MAJOR = 0
3
- MINOR = 3
4
- BUGFIX = 2
3
+ MINOR = 4
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -9,6 +9,8 @@ gem 'origen_doc_helpers'
9
9
 
10
10
  gem 'byebug'
11
11
 
12
+ gem 'origen_updater'
13
+
12
14
  # Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
13
15
  #gem 'ruby-debug-ide'
14
16
  #gem 'debase'
@@ -13,12 +13,17 @@ aliases ={
13
13
  # Now branch to the specific task code
14
14
  case @command
15
15
 
16
- # Here is an example of how to implement a command, the logic can go straight
17
- # in here or you can require an external file if preferred.
18
- when "my_command"
19
- puts "Doing something..."
20
- #require "commands/my_command" # Would load file lib/commands/my_command.rb
21
- # You must always exit upon successfully capturing a command to prevent
16
+ # (Working) example of how to create an application specific comment, here to generate
17
+ # a tags file for you application to enable method definition lookup and similar within
18
+ # editors/IDEs
19
+ when "tags"
20
+ # Here the logic is just written in-line, alternatively it could be written in a
21
+ # dedicated file and required here, e.g.
22
+ #require "<%= @name %>/commands/my_command" # Would load file lib/<%= @name %>/commands/my_command.rb
23
+ Dir.chdir Origen.root do
24
+ system("ripper-tags -R")
25
+ end
26
+ # You must always exit upon successfully capturing and executing a command to prevent
22
27
  # control flowing back to Origen
23
28
  exit 0
24
29
 
@@ -63,12 +68,12 @@ when "my_command"
63
68
  # Origen command handler.
64
69
  else
65
70
  # You probably want to also add the your commands to the help shown via
66
- # origen -h, you can do this be assigning the required text to @application_commands
67
- # before handing control back to Origen. Un-comment the example below to get started.
68
- # @application_commands = <<-EOT
71
+ # origen -h, you can do this by assigning the required text to @application_commands
72
+ # before handing control back to Origen.
73
+ @application_commands = <<-EOT
74
+ tags Build a tags file for this app
75
+ EOT
69
76
  # specs Run the specs (tests), -c will enable coverage
70
77
  # examples Run the examples (tests), -c will enable coverage
71
78
  # test Run both specs and examples, -c will enable coverage
72
- # EOT
73
-
74
79
  end
@@ -11,7 +11,9 @@ source '<%= Origen.site_config.gem_server %>'
11
11
  gem 'coveralls', require: false
12
12
  <% end -%>
13
13
  gem 'byebug'
14
+ gem 'ripper-tags'
14
15
  gem 'origen_doc_helpers'
16
+ gem 'origen_updater'
15
17
  # Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
16
18
  #gem 'ruby-debug-ide'
17
19
  #gem 'debase'
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  # Only the files that are hit by these wildcards will be included in the
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
- spec.files = Dir["lib/**/*.rb", "templates/**/*", "config/**/*.rb",
23
+ spec.files = Dir["lib/<%= @name %>.rb", "lib/<%= @name %>/**/*.rb", "templates/**/*", "config/**/*.rb",
24
24
  "bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb",
25
25
  "program/**/*.rb"
26
26
  ]
@@ -1,5 +1,4 @@
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.
1
+ This directory should include all of the code that will be required by this plugin whenever
2
+ it is used within a 3rd party application.
3
3
 
4
- Any code that will be required when used within a 3rd party application, should be placed
5
- in lib/<%= @name %> instead.
4
+ Any code that is only for testing, should be placed in lib/<%= @name %>_dev instead.
@@ -1,4 +1,5 @@
1
- This directory should include all of the code that will be required by this plugin whenever
2
- it is used within a 3rd party application.
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
3
 
4
- Any code that is only for testing, should be placed in lib/<%= @name %>_dev instead.
4
+ Any code that will be required when used within a 3rd party application, should be placed
5
+ in lib/<%= @name %> instead.
@@ -1,5 +1,21 @@
1
1
  module <%= @namespace %>
2
2
  class Interface
3
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
4
20
  end
5
21
  end
@@ -3,6 +3,8 @@ module <%= @namespace %>Dev
3
3
  # integrate into a top-level app
4
4
  class DUT
5
5
  include Origen::TopLevel
6
+ include OrigenJTAG
7
+ include OrigenARMDebug
6
8
 
7
9
  def initialize(options = {})
8
10
  instantiate_pins(options)
@@ -18,7 +20,7 @@ module <%= @namespace %>Dev
18
20
  end
19
21
 
20
22
  def instantiate_sub_blocks(options)
21
- sub_block :arm_debug, class_name: 'OrigenARMDebug::Driver', aps: { mem_ap: 0x0, mdmap: 0x0100_0000 }
23
+ sub_block :arm_debug, class_name: 'OrigenARMDebug::DAP', mem_aps: { mem_ap: 0x0, mdmap: 0x0100_0000 }
22
24
  sub_block :<%= options[:sub_block_name] %>, class_name: '<%= @namespace %>::<%= options[:class_name] %>', base_address: 0x1000_0000
23
25
  end
24
26
  end
@@ -2,10 +2,6 @@ module <%= @namespace %>Dev
2
2
  # This is a dummy DUT controller that should be used to test that your test module can
3
3
  # integrate into a top-level app
4
4
  class DUTController
5
- include Origen::TopLevel
6
- include OrigenJTAG
7
- include OrigenARMDebug
8
-
9
5
  def startup(options = {})
10
6
  tester.set_timeset('func_25', 40)
11
7
  ss 'Startup the SoC'
@@ -20,11 +16,11 @@ module <%= @namespace %>Dev
20
16
  end
21
17
 
22
18
  def write_register(reg, options = {})
23
- arm_debug.write_register(reg, options)
19
+ arm_debug.mem_ap.write_register(reg, options)
24
20
  end
25
21
 
26
22
  def read_register(reg, options = {})
27
- arm_debug.read_register(reg, options)
23
+ arm_debug.mem_ap.read_register(reg, options)
28
24
  end
29
25
  end
30
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_app_generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -31,6 +31,7 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - bin/fix_my_workspace
34
35
  - config/application.rb
35
36
  - config/boot.rb
36
37
  - config/commands.rb
@@ -61,7 +62,6 @@ files:
61
62
  - templates/app_generators/application/config/maillist_prod.txt
62
63
  - templates/app_generators/application/config/version.rb
63
64
  - templates/app_generators/application/doc/history
64
- - templates/app_generators/application/lib/.module.rb.swp
65
65
  - templates/app_generators/application/lib/app.rake
66
66
  - templates/app_generators/application/lib/module.rb
67
67
  - templates/app_generators/application/lib/top_level.rb
@@ -127,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: 1.8.11
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.4.5
130
+ rubygems_version: 2.5.2
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Origen application generators
134
134
  test_files: []
135
- has_rdoc: