origen_spi 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5b2aa171d3d509833161d1af44a6ea81008adf43
4
- data.tar.gz: 0dc35eea797735445f905b7fe30f8619562c529b
2
+ SHA256:
3
+ metadata.gz: ca79fb20c6efdf7cee5a6ffee65f002288e7823e324053ea8afad4e9d5812bf4
4
+ data.tar.gz: 64731df38c3569ff06515e2879e6ee4a6fc5e7a471e60613e6347613d19e590b
5
5
  SHA512:
6
- metadata.gz: bd96f3bb400a1379e86878f47ae18baeb72bcfb1c3de91a4ddca74d52164b29adfb153a36d7bc74fc8e96f1055236dc635868bffe892dd45969fd6f2f3f8404c
7
- data.tar.gz: 818d433c0eaff60bf7a96045d48b3e496a6058f4c01a446e21abea3d9dc868ab747f49c65566ac1c36408ae6b7cf35e0f1e89fd3b1f9c9bfd5e81e3eb8a130b0
6
+ metadata.gz: bbc6b1197f869758b8e7bc5f454bb8024e35e54c8926e8e3776c9806dd98b65376da40f6074d511241a97bee35a890ecce5c080a99d144082ffc6d673540b182
7
+ data.tar.gz: '09745be43f46ea0ccce681c1212cc0bd2dfb72840ae64eebe1559ac7586a40128bdb0880902591262f8e04bc0373570bdf4998fd947a028c4220f6f874a6218d'
data/bin/fix_my_workspace CHANGED
@@ -1,100 +1,100 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- if $_fix_my_workspace_version_check
5
- $_fix_my_workspace_version = '0.7.0'
6
- else
7
- if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
8
- # If this script is being run from within an origen-core workspace, use that Origen-core,
9
- # not the system-installed origen-core version.
10
- $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11
- require 'origen'
12
- else
13
- # Use system-installed Origen (the gem in system Ruby)
14
- require 'origen'
15
- end
16
-
17
- if !Origen.site_config.gem_manage_bundler
18
- puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
19
- puts 'that I cannot make certain assumptions about how your workspace is configured.'
20
- puts 'You will need to either resolve this problem yourself, or else change the value of'
21
- puts 'gem_mange_bundler to true.'
22
- puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
23
-
24
- else
25
- ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
26
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
27
- ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
28
-
29
- # Force copy system gems to local gems
30
- if Origen.site_config.gem_use_from_system
31
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
32
- gem_dir = Pathname.new(Gem.dir)
33
-
34
- Origen.site_config.gem_use_from_system.each do |gem, version|
35
- begin
36
- # This will raise an error if the system doesn't have this gem installed, that
37
- # will be rescued below
38
- spec = Gem::Specification.find_by_name(gem, version)
39
-
40
- local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
41
- FileUtils.mkdir_p local_dir
42
- FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
43
-
44
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
45
- FileUtils.mkdir_p local_file.dirname
46
- FileUtils.cp(spec.cache_file, local_file)
47
-
48
- if spec.extension_dir && File.exist?(spec.extension_dir)
49
- local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
50
- FileUtils.mkdir_p local_dir
51
- FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
52
- end
53
-
54
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
55
- FileUtils.mkdir_p local_file.dirname
56
- FileUtils.cp(spec.spec_file, local_file)
57
-
58
- rescue Gem::LoadError
59
- # This just means that one of the gems that should be copied from the system
60
- # was not actually installed in the system, so nothing we can do about that here
61
- end
62
- end
63
- end
64
-
65
- # Delete lbin
66
- FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
67
-
68
- # Run bundler with correct switches
69
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
70
- `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
71
- `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
72
- `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
73
-
74
- # Try again, this time updating the bundle
75
- if system(cmd)
76
- fixed = true
77
- elsif system 'bundle update'
78
- fixed = true
79
- end
80
-
81
- if File.exist?(ENV['BUNDLE_BIN'])
82
- `chmod o-w #{ENV['BUNDLE_BIN']}`
83
-
84
- # Make .bat versions of all executables, Bundler should really be doing this when running
85
- # on windows
86
- if Origen.os.windows?
87
- Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
88
- unless bin =~ /.bat$/
89
- bat = "#{bin}.bat"
90
- unless File.exist?(bat)
91
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- system 'origen -v' if fixed
99
- end
100
- end
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
+
4
+ if $_fix_my_workspace_version_check
5
+ $_fix_my_workspace_version = '0.7.0'
6
+ else
7
+ if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
8
+ # If this script is being run from within an origen-core workspace, use that Origen-core,
9
+ # not the system-installed origen-core version.
10
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11
+ require 'origen'
12
+ else
13
+ # Use system-installed Origen (the gem in system Ruby)
14
+ require 'origen'
15
+ end
16
+
17
+ if !Origen.site_config.gem_manage_bundler
18
+ puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
19
+ puts 'that I cannot make certain assumptions about how your workspace is configured.'
20
+ puts 'You will need to either resolve this problem yourself, or else change the value of'
21
+ puts 'gem_mange_bundler to true.'
22
+ puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
23
+
24
+ else
25
+ ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
26
+ ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
27
+ ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
28
+
29
+ # Force copy system gems to local gems
30
+ if Origen.site_config.gem_use_from_system
31
+ local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
32
+ gem_dir = Pathname.new(Gem.dir)
33
+
34
+ Origen.site_config.gem_use_from_system.each do |gem, version|
35
+ begin
36
+ # This will raise an error if the system doesn't have this gem installed, that
37
+ # will be rescued below
38
+ spec = Gem::Specification.find_by_name(gem, version)
39
+
40
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
41
+ FileUtils.mkdir_p local_dir
42
+ FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
43
+
44
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
45
+ FileUtils.mkdir_p local_file.dirname
46
+ FileUtils.cp(spec.cache_file, local_file)
47
+
48
+ if spec.extension_dir && File.exist?(spec.extension_dir)
49
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
50
+ FileUtils.mkdir_p local_dir
51
+ FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
52
+ end
53
+
54
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
55
+ FileUtils.mkdir_p local_file.dirname
56
+ FileUtils.cp(spec.spec_file, local_file)
57
+
58
+ rescue Gem::LoadError
59
+ # This just means that one of the gems that should be copied from the system
60
+ # was not actually installed in the system, so nothing we can do about that here
61
+ end
62
+ end
63
+ end
64
+
65
+ # Delete lbin
66
+ FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
67
+
68
+ # Run bundler with correct switches
69
+ cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
70
+ `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
71
+ `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
72
+ `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
73
+
74
+ # Try again, this time updating the bundle
75
+ if system(cmd)
76
+ fixed = true
77
+ elsif system 'bundle update'
78
+ fixed = true
79
+ end
80
+
81
+ if File.exist?(ENV['BUNDLE_BIN'])
82
+ `chmod o-w #{ENV['BUNDLE_BIN']}`
83
+
84
+ # Make .bat versions of all executables, Bundler should really be doing this when running
85
+ # on windows
86
+ if Origen.os.windows?
87
+ Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
88
+ unless bin =~ /.bat$/
89
+ bat = "#{bin}.bat"
90
+ unless File.exist?(bat)
91
+ File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+
98
+ system 'origen -v' if fixed
99
+ end
100
+ end
@@ -1,103 +1,103 @@
1
- require 'origen'
2
- class OrigenSpiApplication < Origen::Application
3
-
4
- # See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
5
- # for a full list of the configuration options available
6
-
7
- # These attributes should never be changed, the duplication here will be resolved in future
8
- # by condensing these attributes that do similar things
9
- self.name = "origen_spi"
10
- self.namespace = "OrigenSpi"
11
- config.name = "origen_spi"
12
- config.initials = "OrigenSpi"
13
- # Change this to point to the revision control repository for this plugin
14
- config.rc_url = "https://github.com/Origen-SDK/origen_spi.git"
15
- config.release_externally = true
16
-
17
- # To enable deployment of your documentation to a web server (via the 'origen web'
18
- # command) fill in these attributes.
19
- config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/origen_spi"
20
- config.web_domain = "http://origen-sdk.org/origen_spi"
21
-
22
- # When false Origen will be less strict about checking for some common coding errors,
23
- # it is recommended that you leave this to true for better feedback and easier debug.
24
- # This will be the default setting in Origen v3.
25
- config.strict_errors = true
26
-
27
- # See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
28
- config.lint_test = {
29
- # Require the lint tests to pass before allowing a release to proceed
30
- run_on_tag: true,
31
- # Auto correct violations where possible whenever 'origen lint' is run
32
- auto_correct: true,
33
- # Limit the testing for large legacy applications
34
- #level: :easy,
35
- # Run on these directories/files by default
36
- #files: ["lib", "config/application.rb"],
37
- }
38
-
39
- config.semantically_version = true
40
-
41
- # An example of how to set application specific LSF parameters
42
- #config.lsf.project = "msg.te"
43
-
44
- # An example of how to specify a prefix to add to all generated patterns
45
- #config.pattern_prefix = "nvm"
46
-
47
- # An example of how to add header comments to all generated patterns
48
- #config.pattern_header do
49
- # cc "This is a pattern created by the example origen application"
50
- #end
51
-
52
- # By default all generated output will end up in ./output.
53
- # Here you can specify an alternative directory entirely, or make it dynamic such that
54
- # the output ends up in a setup specific directory.
55
- #config.output_directory do
56
- # "#{Origen.root}/output/#{$dut.class}"
57
- #end
58
-
59
- # Similarly for the reference files, generally you want to setup the reference directory
60
- # structure to mirror that of your output directory structure.
61
- #config.reference_directory do
62
- # "#{Origen.root}/.ref/#{$dut.class}"
63
- #end
64
-
65
- # This will automatically deploy your documentation after every tag
66
- #def after_release_email(tag, note, type, selector, options)
67
- # command = "origen web compile --remote --api"
68
- # Dir.chdir Origen.root do
69
- # system command
70
- # end
71
- #end
72
-
73
- # Ensure that all tests pass before allowing a release to continue
74
- #def validate_release
75
- # if !system("origen specs") || !system("origen examples")
76
- # puts "Sorry but you can't release with failing tests, please fix them and try again."
77
- # exit 1
78
- # else
79
- # puts "All tests passing, proceeding with release process!"
80
- # end
81
- #end
82
-
83
- # To enabled source-less pattern generation create a class (for example PatternDispatcher)
84
- # to generate the pattern. This should return false if the requested pattern has been
85
- # dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
86
- #def before_pattern_lookup(requested_pattern)
87
- # PatternDispatcher.new.dispatch_or_return(requested_pattern)
88
- #end
89
-
90
- # If you use pattern iterators you may come across the case where you request a pattern
91
- # like this:
92
- # origen g example_pat_b0.atp
93
- #
94
- # However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
95
- # In the case where the pattern cannot be found Origen will pass the name to this translator
96
- # if it exists, and here you can make any substitutions to help Origen find the file you
97
- # want. In this example any instances of _b\d, where \d means a number, are replaced by
98
- # _bx.
99
- #config.pattern_name_translator do |name|
100
- # name.gsub(/_b\d/, "_bx")
101
- #end
102
-
103
- end
1
+ require 'origen'
2
+ class OrigenSpiApplication < Origen::Application
3
+
4
+ # See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
5
+ # for a full list of the configuration options available
6
+
7
+ # These attributes should never be changed, the duplication here will be resolved in future
8
+ # by condensing these attributes that do similar things
9
+ self.name = "origen_spi"
10
+ self.namespace = "OrigenSpi"
11
+ config.name = "origen_spi"
12
+ config.initials = "OrigenSpi"
13
+ # Change this to point to the revision control repository for this plugin
14
+ config.rc_url = "https://github.com/Origen-SDK/origen_spi.git"
15
+ config.release_externally = true
16
+
17
+ # To enable deployment of your documentation to a web server (via the 'origen web'
18
+ # command) fill in these attributes.
19
+ config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/origen_spi"
20
+ config.web_domain = "http://origen-sdk.org/origen_spi"
21
+
22
+ # When false Origen will be less strict about checking for some common coding errors,
23
+ # it is recommended that you leave this to true for better feedback and easier debug.
24
+ # This will be the default setting in Origen v3.
25
+ config.strict_errors = true
26
+
27
+ # See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
28
+ config.lint_test = {
29
+ # Require the lint tests to pass before allowing a release to proceed
30
+ run_on_tag: true,
31
+ # Auto correct violations where possible whenever 'origen lint' is run
32
+ auto_correct: true,
33
+ # Limit the testing for large legacy applications
34
+ #level: :easy,
35
+ # Run on these directories/files by default
36
+ #files: ["lib", "config/application.rb"],
37
+ }
38
+
39
+ config.semantically_version = true
40
+
41
+ # An example of how to set application specific LSF parameters
42
+ #config.lsf.project = "msg.te"
43
+
44
+ # An example of how to specify a prefix to add to all generated patterns
45
+ #config.pattern_prefix = "nvm"
46
+
47
+ # An example of how to add header comments to all generated patterns
48
+ #config.pattern_header do
49
+ # cc "This is a pattern created by the example origen application"
50
+ #end
51
+
52
+ # By default all generated output will end up in ./output.
53
+ # Here you can specify an alternative directory entirely, or make it dynamic such that
54
+ # the output ends up in a setup specific directory.
55
+ #config.output_directory do
56
+ # "#{Origen.root}/output/#{$dut.class}"
57
+ #end
58
+
59
+ # Similarly for the reference files, generally you want to setup the reference directory
60
+ # structure to mirror that of your output directory structure.
61
+ #config.reference_directory do
62
+ # "#{Origen.root}/.ref/#{$dut.class}"
63
+ #end
64
+
65
+ # This will automatically deploy your documentation after every tag
66
+ #def after_release_email(tag, note, type, selector, options)
67
+ # command = "origen web compile --remote --api"
68
+ # Dir.chdir Origen.root do
69
+ # system command
70
+ # end
71
+ #end
72
+
73
+ # Ensure that all tests pass before allowing a release to continue
74
+ #def validate_release
75
+ # if !system("origen specs") || !system("origen examples")
76
+ # puts "Sorry but you can't release with failing tests, please fix them and try again."
77
+ # exit 1
78
+ # else
79
+ # puts "All tests passing, proceeding with release process!"
80
+ # end
81
+ #end
82
+
83
+ # To enabled source-less pattern generation create a class (for example PatternDispatcher)
84
+ # to generate the pattern. This should return false if the requested pattern has been
85
+ # dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
86
+ #def before_pattern_lookup(requested_pattern)
87
+ # PatternDispatcher.new.dispatch_or_return(requested_pattern)
88
+ #end
89
+
90
+ # If you use pattern iterators you may come across the case where you request a pattern
91
+ # like this:
92
+ # origen g example_pat_b0.atp
93
+ #
94
+ # However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
95
+ # In the case where the pattern cannot be found Origen will pass the name to this translator
96
+ # if it exists, and here you can make any substitutions to help Origen find the file you
97
+ # want. In this example any instances of _b\d, where \d means a number, are replaced by
98
+ # _bx.
99
+ #config.pattern_name_translator do |name|
100
+ # name.gsub(/_b\d/, "_bx")
101
+ #end
102
+
103
+ end
data/config/boot.rb CHANGED
@@ -1,24 +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/origen_spi.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 "origen_spi"
12
-
13
- module OrigenSpiDev
14
- # Example of how to explicitly require a file
15
- # require "origen_spi_dev/my_file"
16
-
17
- # Load all files in the lib/origen_spi_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/origen_spi_dev/**/*.rb").sort.each do |file|
22
- require file
23
- end
24
- end
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/origen_spi.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 "origen_spi"
12
+
13
+ module OrigenSpiDev
14
+ # Example of how to explicitly require a file
15
+ # require "origen_spi_dev/my_file"
16
+
17
+ # Load all files in the lib/origen_spi_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/origen_spi_dev/**/*.rb").sort.each do |file|
22
+ require file
23
+ end
24
+ end