origen 0.60.6 → 0.60.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/rubocop/easy.yml +4875 -308
- data/config/rubocop/strict.yml +4875 -308
- data/config/version.rb +1 -1
- data/lib/origen/application/configuration.rb +6 -3
- data/lib/origen/application/deployer.rb +4 -4
- data/lib/origen/application/environment.rb +4 -2
- data/lib/origen/application/lsf.rb +23 -4
- data/lib/origen/application/lsf_manager.rb +48 -52
- data/lib/origen/application/plugins.rb +7 -7
- data/lib/origen/application/release.rb +5 -3
- data/lib/origen/application/runner.rb +5 -6
- data/lib/origen/application/statistics.rb +1 -0
- data/lib/origen/application/target.rb +9 -6
- data/lib/origen/application/version_tracker.rb +4 -5
- data/lib/origen/application/workspace_manager.rb +5 -2
- data/lib/origen/application.rb +9 -9
- data/lib/origen/boot/api.rb +3 -0
- data/lib/origen/boot/app.rb +28 -30
- data/lib/origen/boot.rb +1 -0
- data/lib/origen/bugs.rb +2 -2
- data/lib/origen/chip_mode.rb +7 -4
- data/lib/origen/chip_package.rb +50 -53
- data/lib/origen/chips/chip.rb +8 -4
- data/lib/origen/chips.rb +16 -12
- data/lib/origen/client.rb +1 -0
- data/lib/origen/clocks/clock.rb +8 -7
- data/lib/origen/clocks/clocks_collection.rb +2 -1
- data/lib/origen/code_generators/actions.rb +1 -1
- data/lib/origen/code_generators/base.rb +1 -1
- data/lib/origen/code_generators.rb +3 -0
- data/lib/origen/commands/archive.rb +1 -1
- data/lib/origen/commands/compile.rb +2 -2
- data/lib/origen/commands/fetch.rb +1 -1
- data/lib/origen/commands/generate.rb +3 -3
- data/lib/origen/commands/interactive.rb +6 -7
- data/lib/origen/commands/lint.rb +1 -1
- data/lib/origen/commands/lsf.rb +2 -2
- data/lib/origen/commands/new.rb +1 -1
- data/lib/origen/commands/plugin.rb +2 -2
- data/lib/origen/commands/program.rb +3 -3
- data/lib/origen/commands/rc.rb +4 -4
- data/lib/origen/commands/save.rb +1 -1
- data/lib/origen/commands/time.rb +4 -6
- data/lib/origen/commands/web.rb +5 -2
- data/lib/origen/commands.rb +1 -1
- data/lib/origen/componentable.rb +1 -0
- data/lib/origen/controller.rb +11 -13
- data/lib/origen/core_ext/array.rb +2 -1
- data/lib/origen/core_ext/enumerable.rb +4 -2
- data/lib/origen/core_ext/hash.rb +5 -6
- data/lib/origen/core_ext/integer.rb +2 -4
- data/lib/origen/core_ext/object.rb +2 -2
- data/lib/origen/core_ext/option_parser/optparse.rb +1 -1
- data/lib/origen/core_ext/string.rb +8 -8
- data/lib/origen/database/key_value_store.rb +12 -14
- data/lib/origen/database/key_value_stores.rb +1 -0
- data/lib/origen/errata/hw_erratum.rb +1 -1
- data/lib/origen/errata.rb +7 -8
- data/lib/origen/features/feature.rb +1 -0
- data/lib/origen/features.rb +4 -6
- data/lib/origen/file_handler.rb +8 -7
- data/lib/origen/fuses/fuse_field.rb +2 -2
- data/lib/origen/generator/comparator.rb +1 -1
- data/lib/origen/generator/compiler.rb +6 -7
- data/lib/origen/generator/job.rb +3 -2
- data/lib/origen/generator/pattern.rb +3 -3
- data/lib/origen/generator/pattern_finder.rb +6 -5
- data/lib/origen/generator/pattern_sequence.rb +3 -0
- data/lib/origen/generator/renderer.rb +3 -4
- data/lib/origen/generator/resources.rb +1 -1
- data/lib/origen/generator/stage.rb +3 -0
- data/lib/origen/limits/limit.rb +14 -11
- data/lib/origen/limits/limit_set.rb +2 -1
- data/lib/origen/loader.rb +4 -2
- data/lib/origen/log.rb +3 -2
- data/lib/origen/memory.rb +1 -0
- data/lib/origen/model.rb +10 -4
- data/lib/origen/models.rb +2 -2
- data/lib/origen/netlist/list.rb +1 -0
- data/lib/origen/netlist.rb +5 -7
- data/lib/origen/org_file/interceptor.rb +1 -1
- data/lib/origen/org_file.rb +4 -1
- data/lib/origen/parameters/set.rb +1 -0
- data/lib/origen/parameters.rb +3 -1
- data/lib/origen/pins/pin.rb +18 -12
- data/lib/origen/pins/pin_bank.rb +3 -0
- data/lib/origen/pins/pin_clock.rb +3 -2
- data/lib/origen/pins/pin_collection.rb +3 -0
- data/lib/origen/pins/timing/wave.rb +5 -0
- data/lib/origen/pins.rb +7 -1
- data/lib/origen/ports.rb +1 -1
- data/lib/origen/power_domains/power_domain.rb +5 -2
- data/lib/origen/power_domains/power_domains_collection.rb +2 -1
- data/lib/origen/registers/bit.rb +21 -17
- data/lib/origen/registers/bit_collection.rb +15 -6
- data/lib/origen/registers/reg.rb +34 -28
- data/lib/origen/registers.rb +25 -24
- data/lib/origen/remote_manager.rb +3 -2
- data/lib/origen/revision_control/base.rb +1 -4
- data/lib/origen/revision_control/design_sync.rb +10 -10
- data/lib/origen/revision_control/git.rb +4 -2
- data/lib/origen/site_config/config.rb +3 -1
- data/lib/origen/site_config.rb +3 -0
- data/lib/origen/specs/checkers.rb +12 -8
- data/lib/origen/specs/doc_resource.rb +3 -4
- data/lib/origen/specs/spec.rb +5 -1
- data/lib/origen/specs/version_history.rb +1 -1
- data/lib/origen/specs.rb +52 -37
- data/lib/origen/sub_blocks.rb +20 -14
- data/lib/origen/top_level.rb +2 -1
- data/lib/origen/users/user.rb +4 -5
- data/lib/origen/utility/csv_data.rb +6 -4
- data/lib/origen/utility/diff.rb +9 -9
- data/lib/origen/utility/file_diff.rb +4 -0
- data/lib/origen/utility/input_capture.rb +6 -6
- data/lib/origen/utility/mailer.rb +8 -11
- data/lib/origen/utility/time_and_date.rb +1 -2
- data/lib/origen/utility.rb +2 -2
- data/lib/origen/value.rb +2 -1
- data/lib/origen/version_string.rb +33 -41
- data/lib/origen.rb +62 -64
- data/origen_app_generators/origen_app_generators.gemspec +1 -1
- metadata +9 -27
- data/config/rubocop/easy_disabled.yml +0 -275
- data/config/rubocop/easy_enabled.yml +0 -727
- data/config/rubocop/strict_disabled.yml +0 -251
- data/config/rubocop/strict_enabled.yml +0 -751
data/lib/origen/registers/reg.rb
CHANGED
@@ -127,6 +127,7 @@ module Origen
|
|
127
127
|
unless live_parameter.respond_to?(:is_a_live_parameter?) && live_parameter.is_a_live_parameter?
|
128
128
|
fail 'Only live updating parameters should be bound, make sure you have not missed .live in the path to the parameter!'
|
129
129
|
end
|
130
|
+
|
130
131
|
@parameter_bound_bits ||= {}
|
131
132
|
@parameter_bound_bits[bitname] = live_parameter
|
132
133
|
end
|
@@ -381,7 +382,8 @@ module Origen
|
|
381
382
|
# this register specifically however, use the meta method to get that.
|
382
383
|
def default_reg_metadata
|
383
384
|
Origen::Registers.default_reg_metadata.merge(
|
384
|
-
Origen::Registers.reg_metadata[owner.class] || {}
|
385
|
+
Origen::Registers.reg_metadata[owner.class] || {}
|
386
|
+
)
|
385
387
|
end
|
386
388
|
|
387
389
|
def bit_value_descriptions(bitname, options = {})
|
@@ -479,6 +481,7 @@ module Origen
|
|
479
481
|
unless File.exist?(define_file)
|
480
482
|
return desc
|
481
483
|
end
|
484
|
+
|
482
485
|
File.readlines(define_file).each do |line|
|
483
486
|
if line =~ /^\s*#(.*)/
|
484
487
|
desc << Regexp.last_match[1].strip
|
@@ -527,7 +530,7 @@ module Origen
|
|
527
530
|
bit_params[:res] = bit_params[:data] if bit_params[:data]
|
528
531
|
bit_params[:res] = bit_params[:reset] if bit_params[:reset]
|
529
532
|
if num_bits == 1
|
530
|
-
add_bit(bit_id, position, bit_params)
|
533
|
+
add_bit(bit_id, position, bit_params) # and add the new one
|
531
534
|
else
|
532
535
|
add_bus(bit_id, position, num_bits, bit_params)
|
533
536
|
end
|
@@ -975,14 +978,16 @@ module Origen
|
|
975
978
|
alias_method :has_bit, :has_bit?
|
976
979
|
alias_method :has_bits, :has_bit?
|
977
980
|
|
981
|
+
# rubocop:disable Layout/MultilineHashBraceLayout
|
982
|
+
|
978
983
|
# Add a bit to the register, should only be called internally
|
979
984
|
def add_bit(id, position, options = {}) # :nodoc:
|
980
|
-
options = { data: @bits[position].data,
|
981
|
-
res: @bits[position].data
|
985
|
+
options = { data: @bits[position].data, # If undefined preserve any data/reset value that has
|
986
|
+
res: @bits[position].data # already been applied at reg level
|
982
987
|
}.merge(options)
|
983
988
|
|
984
989
|
@lookup[id] = { pos: position, bits: 1, feature: options[:feature] }
|
985
|
-
@bits.delete_at(position)
|
990
|
+
@bits.delete_at(position) # Remove the initial bit from this position
|
986
991
|
|
987
992
|
@bits.insert(position, Bit.new(self, position, options))
|
988
993
|
self
|
@@ -994,8 +999,8 @@ module Origen
|
|
994
999
|
size.times do |n|
|
995
1000
|
default_data |= @bits[position + n].data << n
|
996
1001
|
end
|
997
|
-
options = { data: default_data,
|
998
|
-
res: default_data
|
1002
|
+
options = { data: default_data, # If undefined preserve any data/reset value that has
|
1003
|
+
res: default_data # already been applied at reg level
|
999
1004
|
}.merge(options)
|
1000
1005
|
|
1001
1006
|
@lookup[id] = { pos: position, bits: size }
|
@@ -1025,8 +1030,8 @@ module Origen
|
|
1025
1030
|
size.times do |n|
|
1026
1031
|
default_data |= @bits[position + n].data << n
|
1027
1032
|
end
|
1028
|
-
options = { data: default_data,
|
1029
|
-
res: default_data
|
1033
|
+
options = { data: default_data, # If undefined preserve any data/reset value that has
|
1034
|
+
res: default_data # already been applied at reg level
|
1030
1035
|
}.merge(options)
|
1031
1036
|
|
1032
1037
|
@lookup[id] = [] if @lookup[id].nil?
|
@@ -1038,9 +1043,10 @@ module Origen
|
|
1038
1043
|
@bits.delete_at(position + n)
|
1039
1044
|
@bits.insert(position + n, Bit.new(self, position + n, bit_options))
|
1040
1045
|
end
|
1041
|
-
self
|
1046
|
+
self # rubocop:disable Lint/Void
|
1042
1047
|
end
|
1043
1048
|
end
|
1049
|
+
# rubocop:enable Layout/MultilineHashBraceLayout
|
1044
1050
|
|
1045
1051
|
# Delete the bits in the collection from the register
|
1046
1052
|
def delete_bit(collection)
|
@@ -1048,7 +1054,7 @@ module Origen
|
|
1048
1054
|
@lookup.delete(name)
|
1049
1055
|
end
|
1050
1056
|
collection.each do |bit|
|
1051
|
-
@bits.delete_at(bit.position)
|
1057
|
+
@bits.delete_at(bit.position) # Remove the bit
|
1052
1058
|
@bits.insert(bit.position, Bit.new(self, bit.position, writable: @init_as_writable))
|
1053
1059
|
end
|
1054
1060
|
self
|
@@ -1163,6 +1169,7 @@ module Origen
|
|
1163
1169
|
end
|
1164
1170
|
|
1165
1171
|
return nil unless @bits[number]
|
1172
|
+
|
1166
1173
|
if (params == :default || !params) && @bits[number].enabled?
|
1167
1174
|
@bits[number]
|
1168
1175
|
elsif params == :none && !@bits[number].has_feature_constraint?
|
@@ -1174,12 +1181,13 @@ module Origen
|
|
1174
1181
|
unless @bits[number].enabled_by_feature?(param)
|
1175
1182
|
return nil
|
1176
1183
|
end
|
1184
|
+
|
1177
1185
|
@bits[number]
|
1178
1186
|
end
|
1179
1187
|
elsif @bits[number].enabled_by_feature?(params)
|
1180
1188
|
@bits[number]
|
1181
1189
|
else
|
1182
|
-
|
1190
|
+
Bit.new(self, number, writable: false)
|
1183
1191
|
end
|
1184
1192
|
end
|
1185
1193
|
|
@@ -1211,19 +1219,19 @@ module Origen
|
|
1211
1219
|
return collection
|
1212
1220
|
end
|
1213
1221
|
end
|
1214
|
-
|
1222
|
+
BitCollection.dummy(self, bit_name, size: collection.size, pos: @lookup[bit_name][:pos])
|
1215
1223
|
else
|
1216
|
-
|
1224
|
+
[]
|
1217
1225
|
end
|
1218
1226
|
|
1219
1227
|
elsif split_group_reg == true # if this registers has split bits in its range
|
1220
1228
|
if @lookup.is_a?(Hash) # && @lookup.include?(bit_name)
|
1221
1229
|
collection = false
|
1222
|
-
@lookup.each do |k, v|
|
1230
|
+
@lookup.each do |k, v| # k is the bitname, v is the hash of bit data
|
1223
1231
|
if k == bit_name
|
1224
1232
|
collection ||= BitCollection.new(self, k)
|
1225
1233
|
if v.is_a?(Array)
|
1226
|
-
v.reverse_each do |pb|
|
1234
|
+
v.reverse_each do |pb| # loop each piece of bit group data
|
1227
1235
|
(pb[:bits]).times do |i|
|
1228
1236
|
collection << @bits[pb[:pos] + i]
|
1229
1237
|
end
|
@@ -1255,12 +1263,12 @@ module Origen
|
|
1255
1263
|
end
|
1256
1264
|
end
|
1257
1265
|
if @lookup.is_a?(Hash) && @lookup[bit_name].is_a?(Array)
|
1258
|
-
|
1266
|
+
BitCollection.dummy(self, bit_name, size: collection.size, pos: @lookup[bit_name][0][:pos])
|
1259
1267
|
else
|
1260
|
-
|
1268
|
+
BitCollection.dummy(self, bit_name, size: collection.size, pos: @lookup[bit_name[:pos]])
|
1261
1269
|
end
|
1262
1270
|
else
|
1263
|
-
|
1271
|
+
[]
|
1264
1272
|
end
|
1265
1273
|
end
|
1266
1274
|
end
|
@@ -1274,9 +1282,7 @@ module Origen
|
|
1274
1282
|
end
|
1275
1283
|
|
1276
1284
|
if params
|
1277
|
-
|
1278
|
-
else
|
1279
|
-
return nil
|
1285
|
+
params[:enabled_features] || params[:enabled_feature]
|
1280
1286
|
end
|
1281
1287
|
end
|
1282
1288
|
|
@@ -1401,7 +1407,7 @@ module Origen
|
|
1401
1407
|
# Cleans an input value, in some cases it could be a register object, or an explicit value.
|
1402
1408
|
# This will return an explicit value in either case.
|
1403
1409
|
def self.clean_value(value) # :nodoc:
|
1404
|
-
value = value.val if value.respond_to?('val')
|
1410
|
+
value = value.val if value.respond_to?('val') # Pull out the data value if a reg object has been passed in
|
1405
1411
|
value
|
1406
1412
|
end
|
1407
1413
|
|
@@ -1439,9 +1445,9 @@ module Origen
|
|
1439
1445
|
return true
|
1440
1446
|
end
|
1441
1447
|
end
|
1442
|
-
|
1448
|
+
false
|
1443
1449
|
else
|
1444
|
-
|
1450
|
+
feature == name
|
1445
1451
|
end
|
1446
1452
|
end
|
1447
1453
|
end
|
@@ -1483,7 +1489,7 @@ module Origen
|
|
1483
1489
|
break # break if feature not found and return false
|
1484
1490
|
end
|
1485
1491
|
end # iterated through all features in array
|
1486
|
-
|
1492
|
+
value
|
1487
1493
|
else # if feature.class != Array
|
1488
1494
|
loop do
|
1489
1495
|
if current_owner.respond_to?(:owner)
|
@@ -1506,10 +1512,10 @@ module Origen
|
|
1506
1512
|
value = true
|
1507
1513
|
end
|
1508
1514
|
end
|
1509
|
-
|
1515
|
+
value
|
1510
1516
|
end
|
1511
1517
|
else
|
1512
|
-
|
1518
|
+
true
|
1513
1519
|
end
|
1514
1520
|
end
|
1515
1521
|
|
data/lib/origen/registers.rb
CHANGED
@@ -20,7 +20,7 @@ module Origen
|
|
20
20
|
included do
|
21
21
|
include Origen::ModelInitializer
|
22
22
|
include Origen::SubBlocks
|
23
|
-
include Origen::Callbacks
|
23
|
+
include Origen::Callbacks # Required for global register reset
|
24
24
|
|
25
25
|
attr_accessor :owner
|
26
26
|
attr_accessor :name
|
@@ -31,13 +31,11 @@ module Origen
|
|
31
31
|
# not explicitly defined on this model it will be inherited from the parent
|
32
32
|
# and will default to :lsb0 at the top-level
|
33
33
|
def bit_order
|
34
|
-
@bit_order ||=
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
34
|
+
@bit_order ||= if parent
|
35
|
+
parent.bit_order
|
36
|
+
else
|
37
|
+
:lsb0
|
38
|
+
end
|
41
39
|
end
|
42
40
|
|
43
41
|
def method_missing(method, *args, &block) # :nodoc:
|
@@ -189,7 +187,7 @@ module Origen
|
|
189
187
|
break # break if feature not found and return false
|
190
188
|
end
|
191
189
|
end # iterated through all features in array
|
192
|
-
|
190
|
+
value
|
193
191
|
else # if feature.class != Array
|
194
192
|
loop do
|
195
193
|
if current_owner.respond_to?(:owner)
|
@@ -212,10 +210,10 @@ module Origen
|
|
212
210
|
value = true
|
213
211
|
end
|
214
212
|
end
|
215
|
-
|
213
|
+
value
|
216
214
|
end
|
217
215
|
else
|
218
|
-
|
216
|
+
true
|
219
217
|
end
|
220
218
|
end
|
221
219
|
|
@@ -230,9 +228,9 @@ module Origen
|
|
230
228
|
return true
|
231
229
|
end
|
232
230
|
end
|
233
|
-
|
231
|
+
false
|
234
232
|
else
|
235
|
-
|
233
|
+
feature == name
|
236
234
|
end
|
237
235
|
end
|
238
236
|
end
|
@@ -311,6 +309,7 @@ module Origen
|
|
311
309
|
if address.is_a?(Hash)
|
312
310
|
fail 'add_reg requires the address to be supplied as the 2nd argument, e.g. add_reg :my_reg, 0x1000'
|
313
311
|
end
|
312
|
+
|
314
313
|
size, bit_info = nil, size if size.is_a?(Hash)
|
315
314
|
size ||= bit_info.delete(:size) || 32
|
316
315
|
description = bit_info.delete(:description)
|
@@ -328,7 +327,7 @@ module Origen
|
|
328
327
|
@max_reg_address ||= address
|
329
328
|
# Must set an initial value, otherwise max_address_reg_size will be nil if a sub_block contains only
|
330
329
|
# a single register.
|
331
|
-
@max_address_reg_size
|
330
|
+
@max_address_reg_size ||= size
|
332
331
|
@min_reg_address = address if address < @min_reg_address
|
333
332
|
if address > @max_reg_address
|
334
333
|
@max_address_reg_size = size
|
@@ -409,11 +408,11 @@ module Origen
|
|
409
408
|
@new_reg_attrs[name] = attrs
|
410
409
|
else
|
411
410
|
if @new_reg_attrs[name].is_a? Hash
|
412
|
-
temparray
|
411
|
+
temparray.push(@new_reg_attrs[name])
|
413
412
|
else
|
414
413
|
temparray = @new_reg_attrs[name]
|
415
414
|
end
|
416
|
-
temparray
|
415
|
+
temparray.push(attrs)
|
417
416
|
# added the sort so that the order the registers bits is described is not important
|
418
417
|
@new_reg_attrs[name] = temparray.sort { |a, b| b[:pos] <=> a[:pos] }
|
419
418
|
|
@@ -449,6 +448,7 @@ module Origen
|
|
449
448
|
# @api private
|
450
449
|
def instantiate_reg(id, attrs)
|
451
450
|
return _registers[id] unless _registers[id].is_a?(Origen::Registers::Placeholder)
|
451
|
+
|
452
452
|
attributes = {
|
453
453
|
define_file: attrs[:define_file],
|
454
454
|
description: attrs[:description]
|
@@ -493,10 +493,10 @@ module Origen
|
|
493
493
|
test_for_true_false: true
|
494
494
|
}.update(params)
|
495
495
|
if params.key?(:enabled_features) || params.key?(:enabled_feature)
|
496
|
-
|
496
|
+
!!get_registers(params).include?(name)
|
497
497
|
else
|
498
498
|
params[:enabled_features] = :default
|
499
|
-
|
499
|
+
!!get_registers(params).include?(name)
|
500
500
|
end
|
501
501
|
end
|
502
502
|
alias_method :has_reg, :has_reg?
|
@@ -520,13 +520,14 @@ module Origen
|
|
520
520
|
if !args.empty? && args.size == 1 && (args[0].class != Hash || (args[0].key?(:name) && args[0].size == 1))
|
521
521
|
if args[0].class == Hash
|
522
522
|
name = args[0][:name]
|
523
|
-
else
|
523
|
+
else
|
524
|
+
name = args.first
|
524
525
|
end
|
525
526
|
if has_reg(name)
|
526
|
-
|
527
|
+
_registers[name]
|
527
528
|
elsif name =~ /\/(.+)\//
|
528
529
|
regex = Regexp.last_match(1)
|
529
|
-
|
530
|
+
match_registers(regex)
|
530
531
|
else
|
531
532
|
if Origen.config.strict_errors
|
532
533
|
puts ''
|
@@ -560,7 +561,7 @@ module Origen
|
|
560
561
|
# Example use case:
|
561
562
|
# reg(:enabled_features =>[:fac, fac2])
|
562
563
|
elsif params.size == 1 && params.key?(:enabled_features)
|
563
|
-
|
564
|
+
get_registers(enabled_features: params[:enabled_features])
|
564
565
|
end
|
565
566
|
|
566
567
|
# Example use case:
|
@@ -578,9 +579,9 @@ module Origen
|
|
578
579
|
end
|
579
580
|
elsif args.empty?
|
580
581
|
if _registers.empty?
|
581
|
-
|
582
|
+
_registers
|
582
583
|
else
|
583
|
-
|
584
|
+
get_registers(enabled_features: :default)
|
584
585
|
end
|
585
586
|
else
|
586
587
|
if Origen.config.strict_errors
|
@@ -57,6 +57,7 @@ module Origen
|
|
57
57
|
if remote[:path]
|
58
58
|
fail "The following remote is defined as a path, but that is not allowed in production: #{remote}"
|
59
59
|
end
|
60
|
+
|
60
61
|
version = Origen::VersionString.new(remote[:version])
|
61
62
|
unless version.valid?
|
62
63
|
fail "The following remote version is not in a valid format: #{remote}"
|
@@ -269,7 +270,7 @@ module Origen
|
|
269
270
|
end
|
270
271
|
|
271
272
|
def top_level_remotes
|
272
|
-
Origen.app.config.remotes
|
273
|
+
Origen.app.config.remotes #+ Origen.app.config.remotes_dev (there are no core remotes at this time)
|
273
274
|
end
|
274
275
|
|
275
276
|
def remotes
|
@@ -353,7 +354,7 @@ module Origen
|
|
353
354
|
f.write tag
|
354
355
|
end
|
355
356
|
end
|
356
|
-
rescue Origen::GitError, Origen::DesignSyncError, Origen::PerforceError
|
357
|
+
rescue Origen::GitError, Origen::DesignSyncError, Origen::PerforceError => e
|
357
358
|
# If Git failed in the remote, its usually easy to see what the problem is, but now *where* it is.
|
358
359
|
# This will prepend the failing remote along with the error from the revision control system,
|
359
360
|
# then rethrow the error
|
@@ -19,14 +19,13 @@ module Origen
|
|
19
19
|
# Method to use by Origen::RemoteManager to handle fetching a remote file
|
20
20
|
attr_reader :remotes_method
|
21
21
|
|
22
|
-
# rubocop:disable Lint/UnusedMethodArgument
|
23
|
-
|
24
22
|
# All revision control instances represent a remote server mapping
|
25
23
|
# to a local directory, :remote and :local options are required
|
26
24
|
def initialize(options = {})
|
27
25
|
unless options[:remote] && options[:local]
|
28
26
|
fail ':remote and :local options must be supplied when instantiating a new RevisionControl object'
|
29
27
|
end
|
28
|
+
|
30
29
|
@remote = Pathname.new(options[:remote])
|
31
30
|
@local = Pathname.new(options[:local]).expand_path
|
32
31
|
@remotes_method = :checkout
|
@@ -207,8 +206,6 @@ module Origen
|
|
207
206
|
end
|
208
207
|
alias_method :subversion?, :svn?
|
209
208
|
|
210
|
-
# rubocop:enable Lint/UnusedMethodArgument
|
211
|
-
|
212
209
|
private
|
213
210
|
|
214
211
|
def clean_path(path = nil, options = {})
|
@@ -24,6 +24,7 @@ module Origen
|
|
24
24
|
fail "Directory does not exist: #{dir}" unless dir.exist?
|
25
25
|
fail "Only directories are supported by remote_check_in, this is not a directory: #{dir}" unless dir.directory?
|
26
26
|
fail 'No vault option supplied to remote_check_in!' unless options[:vault]
|
27
|
+
|
27
28
|
scratch = Pathname.new("#{Origen.app.workspace_manager.imports_directory}/design_sync/scratch")
|
28
29
|
FileUtils.rm_rf(scratch) if scratch.exist?
|
29
30
|
FileUtils.mkdir_p(scratch)
|
@@ -77,6 +78,7 @@ module Origen
|
|
77
78
|
dir = Pathname.new(dir)
|
78
79
|
fail "Directory does not exist: #{dir}" unless dir.exist?
|
79
80
|
fail "Only directories are supported by remove_dot_syncs, this is not a directory: #{dir}" unless dir.directory?
|
81
|
+
|
80
82
|
Dir.glob("#{dir}/**/.SYNC").sort.each do |dot_sync|
|
81
83
|
FileUtils.rm_rf(dot_sync)
|
82
84
|
end
|
@@ -180,10 +182,10 @@ module Origen
|
|
180
182
|
|
181
183
|
files = dssc(cmd, options).reject do |item|
|
182
184
|
item.strip.empty? ||
|
183
|
-
|
185
|
+
item =~ /^(Name|Directory|---)/
|
184
186
|
end
|
185
187
|
files.map! do |file|
|
186
|
-
file.strip!
|
188
|
+
file.strip! # Strip off any whitespace from all objects
|
187
189
|
file.sub!(/^#{full_path_prefix}/, '')
|
188
190
|
file.sub('|', ':')
|
189
191
|
file.sub!(/^/, "#{paths.first}/")
|
@@ -202,7 +204,7 @@ module Origen
|
|
202
204
|
item =~ /^(Name|Directory|---)/ || item.strip.empty?
|
203
205
|
end
|
204
206
|
files.map! do |file|
|
205
|
-
file.strip!
|
207
|
+
file.strip! # Strip off any whitespace from all objects
|
206
208
|
file.sub!(/^#{full_path_prefix}/, '')
|
207
209
|
file.sub('|', ':')
|
208
210
|
end
|
@@ -276,13 +278,11 @@ module Origen
|
|
276
278
|
private
|
277
279
|
|
278
280
|
def full_path_prefix
|
279
|
-
@full_path_prefix ||=
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
end
|
285
|
-
end
|
281
|
+
@full_path_prefix ||= if Origen.running_on_windows?
|
282
|
+
'file:///'
|
283
|
+
else
|
284
|
+
'file://'
|
285
|
+
end
|
286
286
|
end
|
287
287
|
|
288
288
|
def initialize_local_dir(options = {})
|
@@ -66,6 +66,7 @@ module Origen
|
|
66
66
|
if paths.size > 1 || paths.first != local.to_s
|
67
67
|
fail 'The Git driver does not support partial merge checkout, it has to be the whole workspace'
|
68
68
|
end
|
69
|
+
|
69
70
|
git 'reset HEAD'
|
70
71
|
res = git 'stash', options
|
71
72
|
stashed = !res.any? { |l| l =~ /^No local changes to save/ }
|
@@ -122,11 +123,11 @@ module Origen
|
|
122
123
|
if options[:comment] && !options[:comment].strip.empty?
|
123
124
|
cmd += " -m \"#{options[:comment].strip}\""
|
124
125
|
else
|
125
|
-
cmd +=
|
126
|
+
cmd += ' -m "No comment!"'
|
126
127
|
end
|
127
128
|
if options[:author]
|
128
129
|
if options[:author].respond_to?(:name_and_email)
|
129
|
-
author =
|
130
|
+
author = options[:author].name_and_email
|
130
131
|
else
|
131
132
|
author = "#{options[:author]} <>"
|
132
133
|
end
|
@@ -346,6 +347,7 @@ module Origen
|
|
346
347
|
|
347
348
|
def initialize_local_dir(options = {})
|
348
349
|
return if options[:build_method] == :clone
|
350
|
+
|
349
351
|
super
|
350
352
|
unless initialized?(options)
|
351
353
|
Origen.log.debug "Initializing Git workspace at #{local}"
|
@@ -86,7 +86,6 @@ module Origen
|
|
86
86
|
File.open(cached_file, 'w+') do |f|
|
87
87
|
f.write(text)
|
88
88
|
end
|
89
|
-
|
90
89
|
rescue SocketError => e
|
91
90
|
puts red("Origen: Site Config: Unable to connect to #{path}")
|
92
91
|
puts red('Origen: Site Config: Failed to retrieve centralized site config!')
|
@@ -125,6 +124,8 @@ module Origen
|
|
125
124
|
ERB.new(File.read(erb), 0, '%<>')
|
126
125
|
end
|
127
126
|
|
127
|
+
# YAML.safe_load is prefered
|
128
|
+
# rubocop:disable Security/YAMLLoad
|
128
129
|
if centralized?
|
129
130
|
if !cached?
|
130
131
|
if fetch
|
@@ -147,6 +148,7 @@ module Origen
|
|
147
148
|
@values = (YAML.load_file(path) || {})
|
148
149
|
end
|
149
150
|
end
|
151
|
+
# rubocop:enable Security/YAMLLoad
|
150
152
|
|
151
153
|
unless @values.is_a?(Hash)
|
152
154
|
puts red("Origen: Site Config: The config at #{path} was not parsed as a Hash, but as a #{@values.class}")
|
data/lib/origen/site_config.rb
CHANGED
@@ -243,11 +243,14 @@ module Origen
|
|
243
243
|
ENV.key?(val)
|
244
244
|
end
|
245
245
|
|
246
|
+
# rubocop:disable Lint/DuplicateMethods
|
247
|
+
|
246
248
|
def env(val)
|
247
249
|
if env_contains?(val)
|
248
250
|
ENV[val]
|
249
251
|
end
|
250
252
|
end
|
253
|
+
# rubocop:enable Lint/DuplicateMethods
|
251
254
|
|
252
255
|
def inspect_variable(*vars)
|
253
256
|
vars.each do |var|
|
@@ -5,6 +5,7 @@ module Origen
|
|
5
5
|
def name_audit(name)
|
6
6
|
return name if name.nil?
|
7
7
|
return nil unless name.is_a?(Symbol) || name.is_a?(String)
|
8
|
+
|
8
9
|
if name == :inspect
|
9
10
|
Origen.log.debug ':inspect is a reserved spec name'
|
10
11
|
return nil
|
@@ -28,6 +29,7 @@ module Origen
|
|
28
29
|
if (@min.exp.to_s.include? '/') || (@max.exp.to_s.include? '/')
|
29
30
|
return status
|
30
31
|
end
|
32
|
+
|
31
33
|
if @min.exp.nil? ^ @max.exp.nil?
|
32
34
|
@limit_type = :single_sided
|
33
35
|
if @typ.exp
|
@@ -72,6 +74,7 @@ module Origen
|
|
72
74
|
def evaluate_limit(limit)
|
73
75
|
return limit if limit.is_a?(Numeric)
|
74
76
|
return nil if limit.nil?
|
77
|
+
|
75
78
|
if limit.is_a? Symbol
|
76
79
|
limit = ':' + limit.to_s
|
77
80
|
else
|
@@ -129,18 +132,19 @@ module Origen
|
|
129
132
|
begin
|
130
133
|
result = eval(limit)
|
131
134
|
return result.round(4) if result.is_a? Numeric
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
135
|
+
rescue ::SyntaxError, ::NameError, ::TypeError
|
136
|
+
Origen.log.debug "Limit '#{limit}' had to be rescued, storing it as a #{limit.class}"
|
137
|
+
if limit.is_a? Symbol
|
138
|
+
limit
|
139
|
+
else
|
140
|
+
"#{limit}"
|
141
|
+
end
|
139
142
|
end
|
140
143
|
else
|
141
|
-
|
144
|
+
result
|
142
145
|
end
|
143
146
|
end
|
147
|
+
# rubocop:enable Style/RescueModifier:
|
144
148
|
end
|
145
149
|
end
|
146
150
|
end
|
@@ -62,9 +62,8 @@ module Origen
|
|
62
62
|
tmp['audience'] = @audience unless @audience.nil?
|
63
63
|
doc_resource_ml = Nokogiri::XML::Builder.new do |xml|
|
64
64
|
xml.doc_resource(tmp.each do |t, d|
|
65
|
-
"#{t}=\"#{d}\""
|
66
|
-
end
|
67
|
-
) do
|
65
|
+
"#{t}=\"#{d}\"" # rubocop:disable Lint/Void
|
66
|
+
end) do
|
68
67
|
unless @table_title.nil? && @note_refs.size == 0 && @exhibit_refs.size == 0
|
69
68
|
unless @note_refs.first.to_s.size == 0
|
70
69
|
unless @exhibit_refs.first.to_s.size == 0
|
@@ -98,7 +97,7 @@ module Origen
|
|
98
97
|
end # unless @exhibit_refs.size == 0
|
99
98
|
end # xml.title.done
|
100
99
|
end # unless @exhibit_refs.to_s.size == 0
|
101
|
-
end
|
100
|
+
end # unless @note_refs.to_s.size == 0
|
102
101
|
end # unless @table_title.nil? && @note_refs.size == 0 && @exhibit_refs.size == 0
|
103
102
|
unless @before_table.nil? && @after_table.nil?
|
104
103
|
xml.paragraphs do
|
data/lib/origen/specs/spec.rb
CHANGED
@@ -83,6 +83,7 @@ module Origen
|
|
83
83
|
def initialize(name, type, mode, owner_name, &block)
|
84
84
|
@name = name_audit(name)
|
85
85
|
fail 'Specification names must be of types Symbol or String and cannot start with a number' if @name.nil?
|
86
|
+
|
86
87
|
@type = type
|
87
88
|
@sub_type = nil # not necessary to be able to find a unique spec, but required for some specs
|
88
89
|
@mode = mode
|
@@ -98,6 +99,7 @@ module Origen
|
|
98
99
|
@guardband = nil
|
99
100
|
(block.arity < 1 ? (instance_eval(&block)) : block.call(self)) if block_given?
|
100
101
|
fail "Spec type must be one of #{TYPES.join(', ')}" unless TYPES.include? type
|
102
|
+
|
101
103
|
@min = Limit.new(@min)
|
102
104
|
@max = Limit.new(@max)
|
103
105
|
@typ = Limit.new(@typ)
|
@@ -206,6 +208,7 @@ module Origen
|
|
206
208
|
instance_variables.each do |ivar|
|
207
209
|
ivar_sym = ivar.to_s.gsub('@', '').to_sym
|
208
210
|
next if ivar_sym == :notes # temporarily disable until notes diff method written
|
211
|
+
|
209
212
|
ivar_str = ivar.to_s.gsub('@', '')
|
210
213
|
if compare_spec.respond_to? ivar_sym
|
211
214
|
# Check if the instance variable is a Limit and if so then find
|
@@ -261,6 +264,7 @@ module Origen
|
|
261
264
|
# Returns a Note object from the notes hash
|
262
265
|
def notes(id = nil)
|
263
266
|
return nil if @notes.nil?
|
267
|
+
|
264
268
|
@notes.filter(id)
|
265
269
|
end
|
266
270
|
|
@@ -310,7 +314,7 @@ module Origen
|
|
310
314
|
name_set += 4 unless @type.nil?
|
311
315
|
name_set += 2 unless @sub_type.nil?
|
312
316
|
unless @mode.nil?
|
313
|
-
unless
|
317
|
+
unless (@mode.to_s.include? 'local') || (@mode.to_s.include? 'global')
|
314
318
|
name_set += 1
|
315
319
|
end
|
316
320
|
end
|
@@ -4,7 +4,7 @@ module Origen
|
|
4
4
|
class Version_History
|
5
5
|
attr_accessor :label, :date, :author, :changes, :external_changes_internal
|
6
6
|
|
7
|
-
def initialize(date, author, changes, label = nil, external_changes_internal =
|
7
|
+
def initialize(date, author, changes, label = nil, external_changes_internal = nil)
|
8
8
|
@date = date
|
9
9
|
@author = author
|
10
10
|
@changes = changes
|