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/features.rb
CHANGED
@@ -27,7 +27,7 @@ module Origen
|
|
27
27
|
options[:description] = fetch_description(name)
|
28
28
|
end
|
29
29
|
features[name] = Feature.new(name, options)
|
30
|
-
else
|
30
|
+
else # if feature with given name already exists
|
31
31
|
fail "Feature #{name} already added!"
|
32
32
|
end
|
33
33
|
end
|
@@ -72,17 +72,15 @@ module Origen
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
public
|
76
|
-
|
77
75
|
def has_features?(name = nil)
|
78
76
|
if !name
|
79
77
|
if feature.size == 0
|
80
|
-
|
78
|
+
false
|
81
79
|
else
|
82
|
-
|
80
|
+
true
|
83
81
|
end
|
84
82
|
else
|
85
|
-
|
83
|
+
feature.include?(name)
|
86
84
|
end
|
87
85
|
end
|
88
86
|
alias_method :has_feature?, :has_features?
|
data/lib/origen/file_handler.rb
CHANGED
@@ -133,14 +133,14 @@ module Origen
|
|
133
133
|
Pathname.new(m)
|
134
134
|
else
|
135
135
|
if options[:allow_missing]
|
136
|
-
|
136
|
+
nil
|
137
137
|
else
|
138
138
|
fail "Can't find: #{file}"
|
139
139
|
end
|
140
140
|
end
|
141
141
|
else
|
142
142
|
if options[:allow_missing]
|
143
|
-
|
143
|
+
nil
|
144
144
|
else
|
145
145
|
fail "Can't find: #{file}"
|
146
146
|
end
|
@@ -152,17 +152,17 @@ module Origen
|
|
152
152
|
if file_plugin
|
153
153
|
if Origen.app.plugins.current
|
154
154
|
if file_plugin == Origen.app.plugins.current.name
|
155
|
-
|
155
|
+
path
|
156
156
|
else
|
157
157
|
puts "The requested file is from plugin #{file_plugin} and current system plugin is set to plugin #{Origen.app.plugins.current.name}!"
|
158
158
|
fail 'Incorrect plugin error!'
|
159
159
|
end
|
160
160
|
else
|
161
161
|
Origen.app.plugins.temporary = file_plugin
|
162
|
-
|
162
|
+
path
|
163
163
|
end
|
164
164
|
else
|
165
|
-
|
165
|
+
path
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
@@ -184,13 +184,13 @@ module Origen
|
|
184
184
|
end
|
185
185
|
|
186
186
|
if matches.size == 0
|
187
|
-
|
187
|
+
nil
|
188
188
|
elsif matches.size > 1
|
189
189
|
puts 'The following matches were found:'
|
190
190
|
puts matches
|
191
191
|
fail "Ambiguous file #{file}"
|
192
192
|
else
|
193
|
-
|
193
|
+
check(matches.first)
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
@@ -380,6 +380,7 @@ module Origen
|
|
380
380
|
|
381
381
|
def current_directory
|
382
382
|
return @current_directory if @current_directory
|
383
|
+
|
383
384
|
@current_directory = clean_path_to(current_file).dirname if current_file
|
384
385
|
end
|
385
386
|
|
@@ -33,11 +33,11 @@ module Origen
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def reprogrammeable?
|
36
|
-
|
36
|
+
respond_to?(:reprogrammeable) ? reprogrammeable : true
|
37
37
|
end
|
38
38
|
|
39
39
|
def customer_visible?
|
40
|
-
|
40
|
+
respond_to?(:customer_visible) ? customer_visible : false
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -13,7 +13,7 @@ module Origen
|
|
13
13
|
}.merge(options)
|
14
14
|
|
15
15
|
if File.exist?(old)
|
16
|
-
if Utility::Diff.new(file_a: new, file_b: old, ignore_blank_lines:
|
16
|
+
if Utility::Diff.new(file_a: new, file_b: old, ignore_blank_lines: options[:ignore_blank_lines],
|
17
17
|
comment_char: options[:comment_char],
|
18
18
|
suspend_string: options[:suspend_string],
|
19
19
|
resume_string: options[:resume_string]).diffs?
|
@@ -39,9 +39,10 @@ module Origen
|
|
39
39
|
# to the destination un-altered
|
40
40
|
def compile(file_or_dir, options = {})
|
41
41
|
options = {
|
42
|
-
check_for_changes:
|
43
|
-
sub_template:
|
44
|
-
collect_stats:
|
42
|
+
check_for_changes: true,
|
43
|
+
sub_template: false,
|
44
|
+
collect_stats: true,
|
45
|
+
ignore_blank_lines: true
|
45
46
|
}.merge(options)
|
46
47
|
@scope = options[:scope]
|
47
48
|
# Doing here so the output_directory (requiring target load) doesn't get hit if
|
@@ -118,7 +119,7 @@ module Origen
|
|
118
119
|
else
|
119
120
|
File.open(f, 'w') { |out| out.puts output }
|
120
121
|
end
|
121
|
-
else
|
122
|
+
else # Just copy it across
|
122
123
|
out = output_file(file, options)
|
123
124
|
# Delete the target if it already exists, this prevents permission denied errors when copying
|
124
125
|
FileUtils.rm_f(out.to_s) if File.exist?(out.to_s)
|
@@ -130,7 +131,7 @@ module Origen
|
|
130
131
|
if @check_for_changes
|
131
132
|
check_for_changes(output_file(file, options), reference_file(file, options),
|
132
133
|
comment_char: Origen.app.tester ? Origen.app.tester.program_comment_char : nil,
|
133
|
-
compile_job:
|
134
|
+
compile_job: true, ignore_blank_lines: options[:ignore_blank_lines])
|
134
135
|
end
|
135
136
|
end
|
136
137
|
end
|
@@ -178,9 +179,7 @@ module Origen
|
|
178
179
|
# to get a hold of its internal scope
|
179
180
|
unless b.is_a?(Binding)
|
180
181
|
b.define_singleton_method :_get_binding do |local_opts, &_block|
|
181
|
-
# rubocop:disable Lint/UselessAssignment
|
182
182
|
options = local_opts
|
183
|
-
# rubocop:enable Lint/UselessAssignment
|
184
183
|
binding
|
185
184
|
end
|
186
185
|
# Here the global options, the ones visible right now, are passed to into the method defined above,
|
data/lib/origen/generator/job.rb
CHANGED
@@ -54,6 +54,7 @@ module Origen
|
|
54
54
|
if !@pattern && !@output_file_body
|
55
55
|
fail 'Sorry the output_pattern is not available until the job has been run'
|
56
56
|
end
|
57
|
+
|
57
58
|
body = @output_file_body ? @output_file_body : File.basename(@pattern, '.rb')
|
58
59
|
output_prefix + body + output_postfix + split_number + output_extension
|
59
60
|
end
|
@@ -155,7 +156,7 @@ module Origen
|
|
155
156
|
else
|
156
157
|
Origen.log.start_job(strip_dir_and_ext(@requested_pattern), :pattern_generator)
|
157
158
|
end
|
158
|
-
Origen.generator.pattern.reset
|
159
|
+
Origen.generator.pattern.reset # Resets the pattern controller ready for a new pattern
|
159
160
|
# Give the app a chance to handle pattern dispatch
|
160
161
|
skip = false
|
161
162
|
Origen.app.listeners_for(:before_pattern_lookup).each do |listener|
|
@@ -190,7 +191,7 @@ module Origen
|
|
190
191
|
@output_file_body = @pattern[:output]
|
191
192
|
@pattern = @pattern[:pattern]
|
192
193
|
end
|
193
|
-
load @pattern unless @pattern == :skip
|
194
|
+
load @pattern unless @pattern == :skip # Run the pattern
|
194
195
|
end
|
195
196
|
end
|
196
197
|
end
|
@@ -245,7 +245,7 @@ module Origen
|
|
245
245
|
#
|
246
246
|
# @api private
|
247
247
|
def reset
|
248
|
-
$desc = nil
|
248
|
+
$desc = nil # Clear the description
|
249
249
|
end
|
250
250
|
|
251
251
|
private
|
@@ -267,7 +267,7 @@ module Origen
|
|
267
267
|
# Creates a header and footer for the pattern based on the current tester and any supplied options
|
268
268
|
def pattern_wrapper(iterators, args, options = {})
|
269
269
|
pattern_open(options.merge(iterators: iterators, args: args))
|
270
|
-
yield
|
270
|
+
yield # Pass control back to the pattern source
|
271
271
|
pattern_close(options)
|
272
272
|
end
|
273
273
|
|
@@ -400,7 +400,7 @@ module Origen
|
|
400
400
|
injection = config_loc.config.send(scope).call({})
|
401
401
|
if injection.nil?
|
402
402
|
# Do nothing. It is assumed in this acase that the pattern header has not comments to add at this scope.
|
403
|
-
|
403
|
+
nil
|
404
404
|
elsif injection.is_a?(String)
|
405
405
|
c2(' ' * message_spacing + message)
|
406
406
|
c2(' ' * line_spacing + injection.to_s)
|
@@ -11,7 +11,7 @@ module Origen
|
|
11
11
|
end
|
12
12
|
|
13
13
|
name = File.basename(name)
|
14
|
-
@requested_pattern = name
|
14
|
+
@requested_pattern = name # Remember what was originally asked for in case
|
15
15
|
# it needs to be output in an error message
|
16
16
|
|
17
17
|
# Strip the prefix if exists
|
@@ -56,6 +56,7 @@ module Origen
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
return :skip unless proceed_with_pattern?(name) # The application has elected not to run this pattern
|
59
|
+
|
59
60
|
pats = matching_patterns(name)
|
60
61
|
if pats.size == 0
|
61
62
|
pats = all_matches(name)
|
@@ -132,20 +133,20 @@ module Origen
|
|
132
133
|
if file_plugin
|
133
134
|
if Origen.app.plugins.current
|
134
135
|
if file_plugin == Origen.app.plugins.current.name
|
135
|
-
|
136
|
+
proceed_with_pattern?(path) ? path : :skip
|
136
137
|
elsif !options[:current_plugin]
|
137
138
|
Origen.app.plugins.current.temporary = file_plugin
|
138
|
-
|
139
|
+
proceed_with_pattern?(path) ? path : :skip
|
139
140
|
else
|
140
141
|
puts "The requested pattern is from plugin #{file_plugin} and current system plugin is set to plugin #{Origen.app.plugins.current.name}!"
|
141
142
|
fail 'Incorrect plugin error!'
|
142
143
|
end
|
143
144
|
else
|
144
145
|
Origen.app.plugins.current.temporary = file_plugin
|
145
|
-
|
146
|
+
proceed_with_pattern?(path) ? path : :skip
|
146
147
|
end
|
147
148
|
else
|
148
|
-
|
149
|
+
proceed_with_pattern?(path) ? path : :skip
|
149
150
|
end
|
150
151
|
end
|
151
152
|
|
@@ -89,6 +89,7 @@ module Origen
|
|
89
89
|
end
|
90
90
|
# Just continue if this thread is not in the list
|
91
91
|
return unless ids.include?(current_thread.id)
|
92
|
+
|
92
93
|
# If we have entered the same sync up point after having previously completed it,
|
93
94
|
# then clear it and start again
|
94
95
|
if @sync_ups[location] && @sync_ups[location][:completed]
|
@@ -139,6 +140,7 @@ module Origen
|
|
139
140
|
# It should be possible to get an execution profile in these cases if someone were to invest the
|
140
141
|
# time in it to workout why this variable is not set upstream in these cases.
|
141
142
|
return unless @cycle_count_stop
|
143
|
+
|
142
144
|
cycles_per_tick = (@cycle_count_stop / (line_size * 1.0)).ceil
|
143
145
|
if tester.try(:sim?)
|
144
146
|
execution_time = tester.execution_time_in_ns / 1_000_000_000.0
|
@@ -193,6 +195,7 @@ module Origen
|
|
193
195
|
|
194
196
|
def pretty_time(time, number_decimal_places = 0)
|
195
197
|
return '0' if time == 0
|
198
|
+
|
196
199
|
if time < 1.us
|
197
200
|
"%.#{number_decimal_places}fns" % (time * 1_000_000_000)
|
198
201
|
elsif time < 1.ms
|
@@ -5,11 +5,11 @@ module Origen
|
|
5
5
|
module Renderer
|
6
6
|
def render(file, options = {}, &block)
|
7
7
|
fail 'File argument is nil' unless file
|
8
|
+
|
8
9
|
file = Origen.file_handler.clean_path_to_sub_template(file)
|
9
10
|
current_pipeline << { file: file, options: options,
|
10
11
|
placeholder: placeholder, block: block,
|
11
|
-
indent: options[:indent] || 0
|
12
|
-
}
|
12
|
+
indent: options[:indent] || 0 }
|
13
13
|
if block_given?
|
14
14
|
self.current_buffer += current_pipeline.last[:placeholder] + "\n"
|
15
15
|
end
|
@@ -47,8 +47,7 @@ module Origen
|
|
47
47
|
output = compile(current[:file],
|
48
48
|
sub_template: true,
|
49
49
|
block: current[:block],
|
50
|
-
scope: @scope
|
51
|
-
)
|
50
|
+
scope: @scope)
|
52
51
|
if current[:indent] && current[:indent] > 0
|
53
52
|
indent = ' ' * current[:indent]
|
54
53
|
output = output.split("\n").map { |l| indent + l }.join("\n")
|
@@ -9,7 +9,7 @@ module Origen
|
|
9
9
|
Origen.app.reload_target!
|
10
10
|
Origen.tester.generating = :program
|
11
11
|
sub_flow = @top_level
|
12
|
-
@top_level
|
12
|
+
@top_level ||= true
|
13
13
|
job.output_file_body = options.delete(:name).to_s if options[:name]
|
14
14
|
if sub_flow
|
15
15
|
interface = Origen.interface
|
@@ -19,8 +19,10 @@ module Origen
|
|
19
19
|
i = current_bank.size - 1
|
20
20
|
while offset >= 0
|
21
21
|
return nil if i < 0
|
22
|
+
|
22
23
|
unless current_bank[i].is_a?(String)
|
23
24
|
return current_bank[i] if offset == 0
|
25
|
+
|
24
26
|
offset -= 1
|
25
27
|
end
|
26
28
|
i -= 1
|
@@ -74,6 +76,7 @@ module Origen
|
|
74
76
|
|
75
77
|
def current_bank
|
76
78
|
return @vault[@bank] if @vault[@bank]
|
79
|
+
|
77
80
|
@vault[@bank] = []
|
78
81
|
end
|
79
82
|
|
data/lib/origen/limits/limit.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Origen
|
2
2
|
module Limits
|
3
3
|
class Limit
|
4
|
-
attr_accessor :expr, :
|
4
|
+
attr_accessor :expr, :owner, :type
|
5
|
+
attr_writer :value
|
5
6
|
|
6
7
|
def initialize(expr, type, owner, options = {})
|
7
8
|
@expr = expr
|
@@ -35,6 +36,7 @@ module Origen
|
|
35
36
|
return owner.limits(ref).send(type).value
|
36
37
|
# Check if the reference is to a power domain
|
37
38
|
end
|
39
|
+
|
38
40
|
if Origen.top_level.respond_to? :power_domains
|
39
41
|
if Origen.top_level.power_domains.include? ref
|
40
42
|
# Need to check the limit type and retrieve the appropriate value
|
@@ -52,9 +54,9 @@ module Origen
|
|
52
54
|
# Need to check the limit type and retrieve the appropriate value
|
53
55
|
case @type.to_s
|
54
56
|
when /target|typ/
|
55
|
-
|
57
|
+
Origen.top_level.clocks(ref).freq_target
|
56
58
|
else
|
57
|
-
|
59
|
+
Origen.top_level.clocks(ref).send(@type)
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
@@ -63,6 +65,7 @@ module Origen
|
|
63
65
|
def evaluate_expr
|
64
66
|
return @expr if @expr.is_a?(Numeric)
|
65
67
|
return nil if @expr.nil?
|
68
|
+
|
66
69
|
if @expr.is_a? Symbol
|
67
70
|
@expr = ':' + @expr.to_s
|
68
71
|
else
|
@@ -109,16 +112,16 @@ module Origen
|
|
109
112
|
begin
|
110
113
|
result = eval(@expr)
|
111
114
|
return result.round(4) if result.is_a? Numeric
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
115
|
+
rescue ::SyntaxError, ::NameError, ::TypeError
|
116
|
+
Origen.log.debug "Limit '#{@expr}' had to be rescued, storing it as a #{@expr.class}"
|
117
|
+
if @expr.is_a? Symbol
|
118
|
+
@expr
|
119
|
+
else
|
120
|
+
"#{@expr}"
|
121
|
+
end
|
119
122
|
end
|
120
123
|
else
|
121
|
-
|
124
|
+
result
|
122
125
|
end
|
123
126
|
end
|
124
127
|
end
|
@@ -2,7 +2,8 @@ require_relative './limit'
|
|
2
2
|
module Origen
|
3
3
|
module Limits
|
4
4
|
class LimitSet
|
5
|
-
attr_accessor :id, :
|
5
|
+
attr_accessor :id, :description, :static, :owner, :type
|
6
|
+
attr_reader :min, :typ, :max, :target
|
6
7
|
|
7
8
|
def initialize(id, owner, options)
|
8
9
|
@id = id
|
data/lib/origen/loader.rb
CHANGED
@@ -121,7 +121,7 @@ module Origen
|
|
121
121
|
# as well unless disable_bug_inheritance or disable_feature_inheritance options are passed
|
122
122
|
# Returns true if a model is found and loaded, otherwise nil.
|
123
123
|
def self.load_block(model, options = {})
|
124
|
-
model = model.model
|
124
|
+
model = model.model # Ensure we have a handle on the model and not its controller
|
125
125
|
loaded = nil
|
126
126
|
|
127
127
|
if options[:inherit]
|
@@ -139,7 +139,7 @@ module Origen
|
|
139
139
|
local_full_paths = Array(options[:path])
|
140
140
|
else
|
141
141
|
local_full_paths = model.class.to_s.split('::')
|
142
|
-
local_full_paths.shift
|
142
|
+
local_full_paths.shift # Throw away the app namespace
|
143
143
|
local_full_paths = [local_full_paths.join('/')]
|
144
144
|
end
|
145
145
|
app_paths_map = { local_app => local_full_paths }
|
@@ -213,6 +213,7 @@ module Origen
|
|
213
213
|
base.class_eval do
|
214
214
|
# Emulate #exclude via an ivar
|
215
215
|
return if defined?(@_const_missing) && @_const_missing
|
216
|
+
|
216
217
|
@_const_missing = instance_method(:const_missing)
|
217
218
|
remove_method(:const_missing)
|
218
219
|
end
|
@@ -256,6 +257,7 @@ module Origen
|
|
256
257
|
name = "#{self}::#{name}"
|
257
258
|
end
|
258
259
|
return nil if @_checking_name == name
|
260
|
+
|
259
261
|
names = name.split('::')
|
260
262
|
namespace = names.shift
|
261
263
|
if app = Origen::Application.from_namespace(namespace)
|
data/lib/origen/log.rb
CHANGED
@@ -55,6 +55,7 @@ module Origen
|
|
55
55
|
unless LEVELS.include?(val)
|
56
56
|
fail "Unknown log level, valid values are: #{LEVELS}"
|
57
57
|
end
|
58
|
+
|
58
59
|
# Map the log4r levels to our simplified 3 level system
|
59
60
|
# log4r level order is DEBUG < INFO < WARN < ERROR < FATAL
|
60
61
|
case val
|
@@ -291,9 +292,9 @@ module Origen
|
|
291
292
|
def call_interceptor(interceptors, msg, type, options, &original)
|
292
293
|
interceptor = interceptors.shift
|
293
294
|
if interceptors.empty?
|
294
|
-
func = ->
|
295
|
+
func = ->(msg, type, options) { original.call(msg, type, options) }
|
295
296
|
else
|
296
|
-
func = ->
|
297
|
+
func = ->(msg, type, options) { call_interceptor(interceptors, msg, type, options, &original) }
|
297
298
|
end
|
298
299
|
interceptor.call(msg, type, options, func)
|
299
300
|
end
|
data/lib/origen/memory.rb
CHANGED
data/lib/origen/model.rb
CHANGED
@@ -114,11 +114,13 @@ module Origen
|
|
114
114
|
|
115
115
|
def write_memory(*args)
|
116
116
|
return super if defined?(super)
|
117
|
+
|
117
118
|
write_register(*args)
|
118
119
|
end
|
119
120
|
|
120
121
|
def read_memory(*args)
|
121
122
|
return super if defined?(super)
|
123
|
+
|
122
124
|
read_register(*args)
|
123
125
|
end
|
124
126
|
|
@@ -128,7 +130,7 @@ module Origen
|
|
128
130
|
|
129
131
|
def wrap_in_controller
|
130
132
|
c = Origen.controllers.find do |params|
|
131
|
-
|
133
|
+
is_a?(params[:model_class]) if params[:model_class]
|
132
134
|
end
|
133
135
|
if c
|
134
136
|
c = c[:controller_class].send(:allocate)
|
@@ -176,7 +178,7 @@ module Origen
|
|
176
178
|
end
|
177
179
|
|
178
180
|
def current_configuration
|
179
|
-
if
|
181
|
+
if respond_to?(:configuration)
|
180
182
|
configuration
|
181
183
|
end
|
182
184
|
end
|
@@ -222,12 +224,14 @@ module Origen
|
|
222
224
|
def current_mode
|
223
225
|
if @current_mode
|
224
226
|
return _modes[@current_mode] if _modes[@current_mode]
|
227
|
+
|
225
228
|
fail "The mode #{@current_mode} of #{self.class} has not been defined!"
|
226
229
|
else
|
227
230
|
unless top_level?
|
228
231
|
# Need to do this in case a class besides SubBlock includes Origen::Model
|
229
232
|
obj_above_self = parent.nil? ? Origen.top_level : parent
|
230
233
|
return nil if obj_above_self.nil?
|
234
|
+
|
231
235
|
if obj_above_self.current_mode
|
232
236
|
_modes[obj_above_self.current_mode.id] if _modes.include? obj_above_self.current_mode.id
|
233
237
|
end
|
@@ -242,7 +246,7 @@ module Origen
|
|
242
246
|
Origen.app.listeners_for(:on_mode_changed).each do |listener|
|
243
247
|
listener.on_mode_changed(mode: @current_mode, instance: self)
|
244
248
|
end
|
245
|
-
@current_mode
|
249
|
+
@current_mode # rubocop:disable Lint/Void
|
246
250
|
end
|
247
251
|
alias_method :mode=, :current_mode=
|
248
252
|
|
@@ -308,7 +312,7 @@ module Origen
|
|
308
312
|
def find_specs
|
309
313
|
specs_found = []
|
310
314
|
# Check for specs the object owns
|
311
|
-
if
|
315
|
+
if respond_to? :specs
|
312
316
|
object_specs = specs
|
313
317
|
unless object_specs.nil?
|
314
318
|
if object_specs.class == Origen::Specs::Spec
|
@@ -320,6 +324,7 @@ module Origen
|
|
320
324
|
end
|
321
325
|
sub_blocks.each do |_name, sb|
|
322
326
|
next unless sb.respond_to? :specs
|
327
|
+
|
323
328
|
child_specs = sb.specs
|
324
329
|
unless child_specs.nil?
|
325
330
|
if child_specs.class == Origen::Specs::Spec
|
@@ -340,6 +345,7 @@ module Origen
|
|
340
345
|
obj.delete_all_exhibits
|
341
346
|
obj.children.each do |_name, child|
|
342
347
|
next unless child.has_specs?
|
348
|
+
|
343
349
|
delete_all_specs_and_notes(child)
|
344
350
|
end
|
345
351
|
end
|
data/lib/origen/models.rb
CHANGED
data/lib/origen/netlist/list.rb
CHANGED
data/lib/origen/netlist.rb
CHANGED
@@ -4,13 +4,11 @@ module Origen
|
|
4
4
|
autoload :Connectable, 'origen/netlist/connectable'
|
5
5
|
|
6
6
|
def netlist
|
7
|
-
@netlist ||=
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
7
|
+
@netlist ||= if netlist_top_level == self
|
8
|
+
List.new(self)
|
9
|
+
else
|
10
|
+
netlist_top_level.netlist
|
11
|
+
end
|
14
12
|
end
|
15
13
|
|
16
14
|
def netlist_top_level
|
data/lib/origen/org_file.rb
CHANGED
@@ -8,12 +8,14 @@ module Origen
|
|
8
8
|
if @internal_new
|
9
9
|
super
|
10
10
|
else
|
11
|
-
open
|
11
|
+
# Kernel#open is a serious security risk
|
12
|
+
open(*args, &block) # rubocop:disable Security/Open
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
def open(id, options = {})
|
16
17
|
fail "An org_file is already open with id: #{id}" if open_files[id]
|
18
|
+
|
17
19
|
@internal_new = true
|
18
20
|
f = OrgFile.new(id, options)
|
19
21
|
@internal_new = nil
|
@@ -28,6 +30,7 @@ module Origen
|
|
28
30
|
|
29
31
|
def close(id, options = {})
|
30
32
|
fail "An org_file with this ID has not been opened id: #{id}" unless open_files[id]
|
33
|
+
|
31
34
|
open_files[id].close unless options[:_internal_org_file_call_]
|
32
35
|
open_files.delete(id)
|
33
36
|
end
|
data/lib/origen/parameters.rb
CHANGED
@@ -88,6 +88,7 @@ module Origen
|
|
88
88
|
unless valid
|
89
89
|
fail 'Invalid parameters context, must be :top or a string path to a model object'
|
90
90
|
end
|
91
|
+
|
91
92
|
@parameters_context = obj
|
92
93
|
else
|
93
94
|
@parameters_context
|
@@ -136,6 +137,7 @@ module Origen
|
|
136
137
|
redefine_children.each { |model, set_name| Origen::Parameters.redefine(model, set_name) }
|
137
138
|
end
|
138
139
|
end
|
140
|
+
|
139
141
|
_parameter_sets[name]
|
140
142
|
end
|
141
143
|
alias_method :define_parameters, :define_params
|
@@ -231,7 +233,7 @@ module Origen
|
|
231
233
|
end
|
232
234
|
end
|
233
235
|
if param_context[:obj]._parameter_sets.key?(param_context[:context])
|
234
|
-
|
236
|
+
param_context
|
235
237
|
else
|
236
238
|
puts "Unknown parameter set :#{param_context[:context]} requested for #{param_context[:obj].class}, these are the valid sets:"
|
237
239
|
param_context[:obj]._parameter_sets.keys.each { |k| puts " :#{k}" }
|