origen 0.41.1 → 0.41.2

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
  SHA256:
3
- metadata.gz: a40d2b6086ccca2701117312a47241298c9349e5edf4836264d6e76ff69a3860
4
- data.tar.gz: 485bf7d58c55cb450aa1bd645b94a75319175c42a24063e987cba93f5996dedf
3
+ metadata.gz: e1571654b1fb8ce9f36cd1566c0a5b2a7869fb0e21993071eafbf229a1638067
4
+ data.tar.gz: e7902193820b6e205ead59092809c1c8652561486dff0a6e65a23fe32b23960a
5
5
  SHA512:
6
- metadata.gz: f81f104099fbea282402b3574157a5b70d29c85b0087c29df76ae8a2c4d617e5da76b31c0b890d09b0aa9b857b2ec0aea8fe40293a051884c59f892cdd671d2c
7
- data.tar.gz: c7e34c972a74f97b3e5a127524c54e394e526399958118bb964a78d5d79acc47892e6d4602dbb3cdb90a04c18cd0c45be33fd6b362340a4f4131e4990d9723df
6
+ metadata.gz: 6538ba086f9417aeef6bbb4e509dde390c8197834853a6accec86e56e9c511e01b9daa332590c8a10f55f2555331c229b8a5b75d1ccf228107d28002e5c84a90
7
+ data.tar.gz: 7e697e7e4b29f0fe7200c45f7f1771eaedc184ffc753c1ec9e279534be00dc20dd09f166308e9bdee0dd1c326fe36e19b6a5f04e3f2453cc48554e13f9e0091c
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 41
4
- BUGFIX = 1
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -114,7 +114,7 @@ module Origen
114
114
  attr_end_str = (attr == pin_pkg_meta.keys.last) ? ' }' : ', '
115
115
  case attr_val
116
116
  when String
117
- str << "'#{attr_val}'#{attr_end_str}"
117
+ str << "\"#{attr_val.gsub('"', '\"')}\"#{attr_end_str}"
118
118
  else
119
119
  str << "#{attr_val}#{attr_end_str}"
120
120
  end
@@ -232,7 +232,7 @@ module Origen
232
232
  if value.is_a?(Symbol)
233
233
  line << ", #{key}: :#{value}"
234
234
  elsif value.is_a?(String)
235
- line << ", #{key}: '#{value}'"
235
+ line << ", #{key}: \"#{value.gsub('"', '\"')}\""
236
236
  else
237
237
  line << ", #{key}: #{value}" unless value.nil?
238
238
  end
@@ -284,7 +284,7 @@ module Origen
284
284
  if value.is_a?(Symbol)
285
285
  ret_str += ", #{key}: :#{value}"
286
286
  elsif value.is_a?(String)
287
- ret_str += ", #{key}: '#{value}'"
287
+ ret_str += ", #{key}: \"#{value.gsub('"', '\"')}\""
288
288
  else
289
289
  ret_str += ", #{key}: #{value}" unless value.nil?
290
290
  end
@@ -11,6 +11,25 @@ module Origen
11
11
  nil
12
12
  end
13
13
 
14
+ # Returns the Git version number from the current runtime environment (as a string)
15
+ def self.version
16
+ @version ||= begin
17
+ version = nil
18
+ git('--version', verbose: false).each do |line|
19
+ if line =~ /git version (\d+(\.\d+)+)/
20
+ version = Regexp.last_match(1)
21
+ break
22
+ end
23
+ end
24
+ if version
25
+ version
26
+ else
27
+ Origen.log.warning 'Failed to determine the current Git version, proceeding by assuming version 2.0.0'
28
+ '2.0.0'
29
+ end
30
+ end
31
+ end
32
+
14
33
  def build(options = {})
15
34
  if Dir["#{local}/*"].empty? || options[:force]
16
35
  FileUtils.rm_rf(local.to_s)
@@ -262,7 +281,7 @@ module Origen
262
281
  end
263
282
  File.exist?("#{local}/.git") &&
264
283
  git('remote -v', verbose: false).any? { |r| r =~ /#{remote_without_protocol_and_user}/ || r =~ /#{remote_without_protocol_and_user.to_s.gsub(':', "\/")}/ } &&
265
- !git('status', verbose: false).any? { |l| l =~ /^#? ?Initial commit$/ }
284
+ !git('status', verbose: false).any? { |l| l =~ /^#? ?(Initial commit|No commits yet)$/ }
266
285
  end
267
286
 
268
287
  # Delete everything in the given directory, or the whole repo
@@ -7,7 +7,7 @@ module Origen
7
7
  model.add_package :pcs
8
8
  model.add_pin :pinx
9
9
  model.add_pin :piny, reset: :drive_hi, direction: :output, meta: { a: '1', b: 2 }
10
- model.add_pin :tdo, packages: { bga: { location: 'BF32', dib_assignment: [10104] }, pcs: { location: 'BF30', dib_assignment: [31808] } }
10
+ model.add_pin :tdo, packages: { bga: { location: "BF32", dib_assignment: [10104] }, pcs: { location: "BF30", dib_assignment: [31808] } }
11
11
  model.add_pin :porta31
12
12
  model.add_pin :porta30
13
13
  model.add_pin :porta29
@@ -8,7 +8,7 @@ module Origen
8
8
  # ** Some Control Register **
9
9
  # Blah, blah,
10
10
  # and some more blah
11
- model.add_reg :ctrl, 0x24, size: 16 do |reg|
11
+ model.add_reg :ctrl, 0x24, size: 16 , str_meta: "a's", str_meta2: "\"works?\"" do |reg|
12
12
  reg.bit 7, :coco, access: :ro
13
13
  reg.bit 6, :aien
14
14
  # **Some Diff Bit** - This is a...
@@ -22,7 +22,7 @@ module Origen
22
22
  # ** A MSB0 Test Case **
23
23
  # Blah-ba-bi-blah
24
24
  # just following the comment pattern above
25
- model.add_reg :msb0_test, 0x28, size: 16 , bit_order: :msb0, some_attr: true, another_attr: :testing, fourth_attr: 'string_attr' do |reg|
25
+ model.add_reg :msb0_test, 0x28, size: 16 , bit_order: :msb0, some_attr: true, another_attr: :testing, fourth_attr: "string_attr" do |reg|
26
26
  reg.bit 8, :ale
27
27
  reg.bit 9, :xsfg
28
28
  reg.bit 10, :yml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.1
4
+ version: 0.41.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-17 00:00:00.000000000 Z
11
+ date: 2018-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -383,7 +383,6 @@ extensions: []
383
383
  extra_rdoc_files: []
384
384
  files:
385
385
  - bin/origen
386
- - bin/origen~
387
386
  - config/application.rb
388
387
  - config/boot.rb
389
388
  - config/commands.rb
data/bin/origen~ DELETED
@@ -1,239 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- require 'pathname'
5
- require 'fileutils'
6
- #require 'byebug' # Un-comment to debug this file
7
-
8
- class OrigenBootError < StandardError
9
- end
10
-
11
- # Keep a note of the pwd at the time when Origen was first loaded, this is initially used
12
- # by the site_config lookup.
13
- $_origen_invocation_pwd ||= Pathname.pwd
14
-
15
- load File.expand_path('../../lib/origen/operating_systems.rb', __FILE__)
16
- load File.expand_path('../../lib/origen/site_config.rb', __FILE__)
17
-
18
- # This will be referenced later in ruby_version_check, the origen used to launch
19
- # the process is different than the one that actually runs under bundler
20
- $origen_launch_root = Pathname.new(File.dirname(__FILE__)).parent
21
-
22
- # Override any influence from $LANG in the users environment
23
- Encoding.default_external = Encoding::UTF_8
24
- Encoding.default_internal = Encoding::UTF_8
25
- ENV['LC_ALL'] = nil
26
- ENV['LANG'] = nil
27
- ENV['LANG'] = 'en_US.UTF-8'
28
-
29
- # Work out what Origen.root is if we are running inside an Origen application, this will be
30
- # later used to execute from that app's bundle even if the origen executable lives somewhere
31
- # else (e.g. in the tools repository)
32
- app_config = File.join('config', 'application.rb')
33
- if File.exist?(app_config)
34
- origen_root = Dir.pwd
35
- else
36
- path = Pathname.new(Dir.pwd)
37
- until path.root? || origen_root
38
- if File.exist?(File.join(path, app_config))
39
- origen_root = path.to_s
40
- else
41
- path = path.parent
42
- end
43
- end
44
- end
45
-
46
- # If running inside an application workspace
47
- if origen_root
48
- # Force everyone to have a consistent way of installing gems with bundler
49
- ENV['BUNDLE_GEMFILE'] = File.join(origen_root, 'Gemfile')
50
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
51
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
52
-
53
- # If it looks like a bundled binstub of origen exists, and we have not been invoked through that,
54
- # then run that instead.
55
- if Origen.site_config.gem_manage_bundler && File.exist?("#{origen_root}/lbin/origen") && !ENV['BUNDLE_BIN_PATH'] &&
56
- File.exist?(File.expand_path(Origen.site_config.gem_install_dir))
57
- exec Gem.ruby, "#{origen_root}/lbin/origen", *ARGV
58
- exit 0
59
- end
60
-
61
- boot_app = true
62
-
63
- # If running outside an application and a user or central tool Origen bundle is to be used
64
- elsif Origen.site_config.gem_manage_bundler && (Origen.site_config.user_install_enable || Origen.site_config.tool_repo_install_dir)
65
- # Force everyone to have a consistent way of installing gems with bundler.
66
- # In this case, we aren't running from an Origen application, so build everything at Origen.home instead
67
- # Have two options here: if user_install_enable is true, use user_install_dir. Otherwise, use the tool_repo_install_dir
68
- Origen.site_config.user_install_enable ? origen_root = File.expand_path(Origen.site_config.user_install_dir) : origen_root = File.expand_path(Origen.site_config.tool_repo_install_dir)
69
- unless Dir.exists?(origen_root)
70
- load File.expand_path('../../lib/origen/utility/input_capture.rb', __FILE__)
71
- include Origen::Utility::InputCapture
72
-
73
- puts "Root directory '#{origen_root}' does not exist. Would you like to create it?"
74
- if get_text(confirm: :return_boolean)
75
- FileUtils.mkdir(origen_root)
76
- else
77
- puts "Exiting with creating Origen install"
78
- exit!
79
- end
80
- end
81
-
82
- gemfile = File.join(origen_root, 'Gemfile')
83
- unless File.exists?(gemfile)
84
- # Create a default Gemfile that can be further customized by the user.
85
- # Initial Gemfile only requires Origen. Nothing else. Essentially a blank installation.
86
- Dir.chdir(origen_root) do
87
- `bundle init`
88
- end
89
- # The above will give a general Gemfile from Bundler. We'll just append "gem 'origen' to the end.
90
- File.open(gemfile, 'a') do |f|
91
- f << "gem 'origen'\n"
92
- end
93
- end
94
- ENV['BUNDLE_GEMFILE'] = gemfile
95
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
96
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
97
-
98
- origen_exec = File.join(ENV['BUNDLE_BIN'], 'origen')
99
-
100
- # If the user/tool bundle already exists but we have not been invoked through that, abort this thread
101
- # and re-launch under the required bundler environment
102
- if File.exist?(origen_exec) && !ENV['BUNDLE_BIN_PATH'] && File.exist?(ENV['BUNDLE_PATH'])
103
- exec Gem.ruby, origen_exec, *ARGV
104
- exit 0
105
- else
106
- boot_app = false
107
- end
108
- end
109
-
110
- if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_manage_bundler && (boot_app || Origen.site_config.user_install_enable || Origen.site_config.tool_repo_install_dir)
111
- # Overriding bundler here so that bundle install can be automated as required
112
- require 'bundler/shared_helpers'
113
- if Bundler::SharedHelpers.in_bundle?
114
- require 'bundler'
115
- if STDOUT.tty?
116
- begin
117
- fail OrigenBootError unless File.exist?(ENV['BUNDLE_BIN'])
118
- Bundler.setup
119
- fail OrigenBootError unless File.exist?(ENV['BUNDLE_BIN'])
120
- rescue Gem::LoadError, Bundler::BundlerError, OrigenBootError => e
121
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
122
- # puts cmd
123
- puts 'Installing required gems...'
124
- puts
125
- `chmod o-w #{origen_root}` # Stops some annoying world writable warnings during install
126
- `chmod o-w #{origen_root}/bin` if File.exist?("#{origen_root}/bin")
127
- `chmod o-w #{origen_root}/.bin` if File.exist?("#{origen_root}/.bin")
128
- result = false
129
-
130
- Bundler.with_clean_env do
131
- if Origen.os.unix?
132
- if Origen.site_config.gem_build_switches
133
- Origen.site_config.gem_build_switches.each do |switches|
134
- `bundle config build.#{switches}`
135
- end
136
- end
137
- end
138
- result = system(cmd)
139
- end
140
- `chmod o-w #{ENV['BUNDLE_BIN']}`
141
- # Make .bat versions of all executables, Bundler should really be doing this when running
142
- # on windows
143
- if Origen.os.windows?
144
- bat_present = File.exist? "#{origen_root}/lbin/origen.bat"
145
- Dir.glob("#{origen_root}/lbin/*").each do |bin|
146
- unless bin =~ /.bat$/
147
- bat = "#{bin}.bat"
148
- unless File.exist?(bat)
149
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
150
- end
151
- end
152
- end
153
- if !bat_present && !result
154
- puts 'Some Windows specific updates to your workspace were required, please re-run the last command'
155
- exit 0
156
- end
157
- end
158
- if result
159
- exec "origen #{ARGV.join(' ')}"
160
- exit 0
161
- else
162
- puts
163
- puts "If you have just updated a gem version and are now getting an error that Bundler cannot find compatible versions for it then first try running 'bundle update <gemname>'."
164
- puts "For example if you have just changed the version of origen_core run 'bundle update origen_core'."
165
- exit 1
166
- end
167
- end
168
- else
169
- Bundler.setup
170
- end
171
- end
172
- require 'bundler/setup'
173
- if Origen.site_config.use_bootsnap && !Origen.os.windows?
174
- puts 'Gettin bootsnappy up in here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
175
- ENV["BOOTSNAP_CACHE_DIR"] ||= "#{origen_root}/tmp/cache"
176
- require 'bootsnap/setup'
177
- else
178
- puts 'NOT SO SNAPPY'
179
- end
180
- require 'origen'
181
- else
182
- $LOAD_PATH.unshift "#{File.expand_path(File.dirname(__FILE__))}/../lib"
183
- require 'origen'
184
- end
185
-
186
- begin
187
- # If this script has been invoked from within an Origen application then open
188
- # up all commands, if not then only allow the command to create a new Origen
189
- # application.
190
- if origen_root && boot_app
191
- require 'origen/commands'
192
- else
193
- require 'origen/commands_global'
194
- end
195
- rescue Exception => e
196
- # A formatted stack dump will not be printed if the application ends via 'exit 0' or 'exit 1'. In that
197
- # case the application code is responsible for printing a helpful error message.
198
- # This will intercept all other exits, e.g. via 'fail "Something has done wrong"', and split the stack
199
- # dump to separate all in-application references from Origen core/plugin references.
200
- if e.is_a?(SystemExit)
201
- exit e.status
202
- else
203
- puts
204
- if Origen.app_loaded?
205
- puts 'COMPLETE CALL STACK'
206
- puts '-------------------'
207
- puts e.message unless e.is_a?(SystemExit)
208
- puts e.backtrace
209
-
210
- puts
211
- puts 'APPLICATION CALL STACK'
212
- puts '----------------------'
213
- puts e.message unless e.is_a?(SystemExit)
214
- # Only print out the application stack trace by default, if verbose logging is
215
- # enabled then output the full thing
216
- e.backtrace.each do |line|
217
- path = Pathname.new(line)
218
- if path.absolute?
219
- if line =~ /^#{Origen.root}/ && line !~ /^#{Origen.root}\/lbin/
220
- puts line
221
- end
222
- else
223
- puts line unless line =~ /^.\/lbin/
224
- end
225
- end
226
- else
227
- puts 'COMPLETE CALL STACK'
228
- puts '-------------------'
229
- puts e.message unless e.is_a?(SystemExit)
230
- puts e.backtrace
231
- end
232
- exit 1
233
- end
234
- ensure
235
- if Origen.app_loaded?
236
- Origen.app.listeners_for(:on_origen_shutdown).each(&:on_origen_shutdown)
237
- Origen.app.runner.shutdown
238
- end
239
- end