origen 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen/application/workspace_manager.rb +1 -1
- data/lib/origen/application.rb +8 -4
- data/lib/origen/commands/program.rb +1 -0
- data/lib/origen/core_ext/string.rb +8 -7
- data/lib/origen/database/key_value_store.rb +1 -1
- data/lib/origen/generator/compiler.rb +42 -19
- data/lib/origen/generator/pattern_thread.rb +48 -32
- data/lib/origen/loader.rb +4 -4
- data/lib/origen/model.rb +1 -1
- data/lib/origen/pins/pin_bank.rb +13 -0
- data/lib/origen/pins/pin_common.rb +4 -3
- data/lib/origen/registers/reg.rb +3 -1
- data/lib/origen/undefined.rb +2 -0
- data/lib/origen/utility/diff.rb +23 -24
- data/lib/origen.rb +2 -1
- data/origen_app_generators/origen_app_generators.gemspec +12 -6
- metadata +9 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d0cd92b95c4542f0045ac4f4171b77695d1217c45e1efdf80e304189feb4a49
|
|
4
|
+
data.tar.gz: d2342afd2d6fbf16c76015fc4788a3c87968619005e6bea0b3d51d6992c65fae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0bed751f3757790266147d1adfeaf2e5c65de26cb3c3cda6c09ba1f3a387ba26e014e84d2c6f61e20cf18d3f4236f72c879ed6482f4cc7c981698144626b796
|
|
7
|
+
data.tar.gz: 2a521e08eba8771a2bbd0682f953cdaaf6ea91cbd0d86f464cbda3116d05cc3ccba8e1f930be052b1394cd0e80aef0c51eb69009f8faebc3b743909c5125b82e
|
data/config/version.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Origen
|
|
|
18
18
|
# This may not necessarily be Origen.root if the application is embedded within
|
|
19
19
|
# a larger project workspace (for example in tool_data/origen)
|
|
20
20
|
def revision_control_root
|
|
21
|
-
Origen.app.rc ? Origen.app.rc.root : Origen.root
|
|
21
|
+
@revision_control_root ||= (Origen.app.rc ? Origen.app.rc.root : Origen.root)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# Origen.root may not necessarily be the same as the revision control root.
|
data/lib/origen/application.rb
CHANGED
|
@@ -102,11 +102,10 @@ module Origen
|
|
|
102
102
|
# A simple class to load all rake tasks available to an application, a class is used here
|
|
103
103
|
# to avoid collision with the Rake namespace method
|
|
104
104
|
class RakeLoader
|
|
105
|
-
require 'rake'
|
|
106
|
-
include Rake::DSL
|
|
107
|
-
|
|
108
105
|
def load_tasks
|
|
109
106
|
$VERBOSE = nil # Don't care about world writable dir warnings and the like
|
|
107
|
+
require 'rake'
|
|
108
|
+
extend Rake::DSL
|
|
110
109
|
require 'colored'
|
|
111
110
|
|
|
112
111
|
# Load all Origen tasks first
|
|
@@ -644,7 +643,12 @@ END
|
|
|
644
643
|
# Returns the name of the given application, this is the name that will
|
|
645
644
|
# be used to refer to the application when it is used as a plugin
|
|
646
645
|
def name
|
|
647
|
-
(@name ||= namespace)
|
|
646
|
+
raw_name = (@name ||= namespace)
|
|
647
|
+
unless defined?(@normalized_name_source) && @normalized_name_source == raw_name
|
|
648
|
+
@normalized_name_source = raw_name
|
|
649
|
+
@normalized_name = raw_name.to_s.underscore.symbolize
|
|
650
|
+
end
|
|
651
|
+
@normalized_name
|
|
648
652
|
end
|
|
649
653
|
|
|
650
654
|
def gem_name
|
|
@@ -18,6 +18,7 @@ opt_parser = OptionParser.new do |opts|
|
|
|
18
18
|
opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
|
|
19
19
|
opts.on('-r', '--reference DIR', String, 'Override the default reference directory') { |o| options[:reference] = o }
|
|
20
20
|
opts.on('--list FILE', String, 'Override the default pattern list file name') { |o| options[:referenced_pattern_list] = o }
|
|
21
|
+
opts.on('--skip-referenced-pattern-write', 'Do not write or compare the referenced pattern list') { options[:skip_referenced_pattern_write] = true }
|
|
21
22
|
opts.on('--doc', 'Generate into doc (yaml) format, requires a Doc interface to be setup in your application') { options[:doc] = true }
|
|
22
23
|
opts.on('-q', '--queue NAME', String, 'Specify the LSF queue, default is short') { |o| options[:queue] = o }
|
|
23
24
|
opts.on('-p', '--project NAME', String, 'Specify the LSF project, default is msg.te') { |o| options[:project] = o }
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
require 'active_support/core_ext/string/inflections'
|
|
2
2
|
require 'uri'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
# String#scrub is built into supported modern Rubies. Only load the compatibility
|
|
4
|
+
# gem when running on an older Ruby that does not provide it natively.
|
|
5
|
+
unless ''.respond_to?(:scrub)
|
|
6
|
+
begin
|
|
7
|
+
require 'scrub_rb'
|
|
8
|
+
rescue LoadError
|
|
9
|
+
# When running outside an application the compatibility gem may not be installed.
|
|
10
|
+
end
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
class String
|
|
@@ -4,6 +4,7 @@ module Origen
|
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'erb'
|
|
6
6
|
require 'pathname'
|
|
7
|
+
require 'digest'
|
|
7
8
|
require "#{Origen.top}/helpers/url"
|
|
8
9
|
|
|
9
10
|
include Helpers
|
|
@@ -109,33 +110,55 @@ module Origen
|
|
|
109
110
|
rescue
|
|
110
111
|
Origen.log.info "Compiling... #{file}" unless options[:quiet]
|
|
111
112
|
end
|
|
112
|
-
|
|
113
|
+
destination = output_file(file, options)
|
|
114
|
+
Origen.log.info " Created... #{relative_path_to(destination)}" unless options[:quiet]
|
|
113
115
|
stats.completed_files += 1 if options[:collect_stats]
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
|
|
117
|
+
with_output_file_lock(destination) do
|
|
118
|
+
replace_output_file(destination) do |temporary_file|
|
|
119
|
+
if is_erb?(file)
|
|
120
|
+
output = run_erb(file, options)
|
|
121
|
+
if output.is_a?(Pathname)
|
|
122
|
+
FileUtils.mv(output.to_s, temporary_file.to_s)
|
|
123
|
+
else
|
|
124
|
+
File.open(temporary_file, 'w') { |out| out.puts output }
|
|
125
|
+
end
|
|
126
|
+
else
|
|
127
|
+
FileUtils.cp(file.to_s, temporary_file.to_s)
|
|
128
|
+
end
|
|
121
129
|
end
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
end
|
|
128
|
-
if options[:zip]
|
|
129
|
-
`gzip -f -9 #{output_file(file, options)}`
|
|
130
|
-
else
|
|
131
|
-
if @check_for_changes
|
|
132
|
-
check_for_changes(output_file(file, options), reference_file(file, options),
|
|
130
|
+
|
|
131
|
+
if options[:zip]
|
|
132
|
+
`gzip -f -9 #{destination}`
|
|
133
|
+
elsif @check_for_changes
|
|
134
|
+
check_for_changes(destination, reference_file(file, options),
|
|
133
135
|
comment_char: Origen.app.tester ? Origen.app.tester.program_comment_char : nil,
|
|
134
136
|
compile_job: true, ignore_blank_lines: options[:ignore_blank_lines])
|
|
135
137
|
end
|
|
136
138
|
end
|
|
137
139
|
end
|
|
138
140
|
|
|
141
|
+
def with_output_file_lock(destination)
|
|
142
|
+
lock_dir = Pathname.new(Origen.root).join('tmp', 'origen_output_locks')
|
|
143
|
+
FileUtils.mkdir_p(lock_dir.to_s)
|
|
144
|
+
lock_name = Digest::SHA256.hexdigest(destination.expand_path.to_s)
|
|
145
|
+
File.open(lock_dir.join("#{lock_name}.lock"), 'w') do |lock|
|
|
146
|
+
lock.flock(File::LOCK_EX)
|
|
147
|
+
yield
|
|
148
|
+
ensure
|
|
149
|
+
lock.flock(File::LOCK_UN)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def replace_output_file(destination)
|
|
154
|
+
temporary_file = destination.dirname.join(".#{destination.basename}.#{Process.pid}.#{Thread.current.object_id}.tmp")
|
|
155
|
+
FileUtils.rm_f(temporary_file.to_s)
|
|
156
|
+
yield temporary_file
|
|
157
|
+
File.rename(temporary_file.to_s, destination.to_s)
|
|
158
|
+
ensure
|
|
159
|
+
FileUtils.rm_f(temporary_file.to_s) if temporary_file
|
|
160
|
+
end
|
|
161
|
+
|
|
139
162
|
def run_erb(file, opts = {}, &block)
|
|
140
163
|
# Refresh the target to start all settings from scratch each time
|
|
141
164
|
# This is an easy way to reset all registered values
|
|
@@ -26,8 +26,7 @@ module Origen
|
|
|
26
26
|
@block = block
|
|
27
27
|
@pre_block = pre_block
|
|
28
28
|
@primary = primary
|
|
29
|
-
@
|
|
30
|
-
@waiting = Concurrent::Event.new
|
|
29
|
+
@waiting = false
|
|
31
30
|
@pending_cycles = nil
|
|
32
31
|
@completed = false
|
|
33
32
|
@reservations = {}
|
|
@@ -41,11 +40,13 @@ module Origen
|
|
|
41
40
|
|
|
42
41
|
# @api private
|
|
43
42
|
#
|
|
44
|
-
# This method is called once by the pattern sequence to start a new
|
|
45
|
-
#
|
|
43
|
+
# This method is called once by the pattern sequence to start a new cooperative
|
|
44
|
+
# execution context. Pattern sequences intentionally run only one context at a
|
|
45
|
+
# time to keep generated output deterministic, so an OS thread and two
|
|
46
|
+
# synchronization events only add context-switching overhead. A Fiber provides
|
|
47
|
+
# the same yield/resume behavior without involving the thread scheduler.
|
|
46
48
|
def start
|
|
47
|
-
@
|
|
48
|
-
PatSeq.send(:thread=, self)
|
|
49
|
+
@fiber = Fiber.new do
|
|
49
50
|
wait
|
|
50
51
|
@pre_block.call if @pre_block
|
|
51
52
|
@block.call(sequence)
|
|
@@ -54,7 +55,7 @@ module Origen
|
|
|
54
55
|
@completed = true
|
|
55
56
|
wait
|
|
56
57
|
end
|
|
57
|
-
|
|
58
|
+
resume
|
|
58
59
|
end
|
|
59
60
|
|
|
60
61
|
def record_cycle_count_stop
|
|
@@ -129,16 +130,22 @@ module Origen
|
|
|
129
130
|
remainder = @pending_cycles - 1
|
|
130
131
|
@pending_cycles = 1
|
|
131
132
|
end
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
loop do
|
|
134
|
+
wait
|
|
135
|
+
if remainder
|
|
136
|
+
@pending_cycles = remainder
|
|
137
|
+
remainder = nil
|
|
138
|
+
end
|
|
139
|
+
# If another context requested fewer cycles, keep yielding the same
|
|
140
|
+
# request until the coordinator has consumed it. The previous recursive
|
|
141
|
+
# call to Integer#cycles retained one Ruby stack frame per partial
|
|
142
|
+
# advance and could overflow on long concurrent delays.
|
|
143
|
+
if @pending_cycles == 0
|
|
144
|
+
@pending_cycles = nil
|
|
145
|
+
break
|
|
146
|
+
elsif @pending_cycles < 0
|
|
147
|
+
fail "Something has gone wrong @pending_cycles is #{@pending_cycles}"
|
|
148
|
+
end
|
|
142
149
|
end
|
|
143
150
|
end
|
|
144
151
|
|
|
@@ -153,24 +160,33 @@ module Origen
|
|
|
153
160
|
|
|
154
161
|
# Returns true if the thread is currently waiting for the pattern sequence to advance it
|
|
155
162
|
def waiting?
|
|
156
|
-
@waiting
|
|
163
|
+
@waiting
|
|
157
164
|
end
|
|
158
165
|
|
|
159
|
-
#
|
|
160
|
-
# advance by the pattern sequence running in the main thread
|
|
166
|
+
# Yield to the pattern sequence until this context is advanced again.
|
|
161
167
|
def wait
|
|
162
|
-
@
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
@waiting = true
|
|
169
|
+
Fiber.yield
|
|
170
|
+
# Thread-local variables are fiber-local on Ruby 2.6, so restore the
|
|
171
|
+
# active context from inside the resumed fiber as well.
|
|
172
|
+
PatSeq.send(:thread=, self)
|
|
173
|
+
@waiting = false
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Resume this context and return when it reaches its next cycle/wait point.
|
|
177
|
+
def advance(_completed_cycles = nil)
|
|
178
|
+
resume
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
private
|
|
182
|
+
|
|
183
|
+
def resume
|
|
184
|
+
PatSeq.send(:thread=, self)
|
|
185
|
+
@fiber.resume
|
|
186
|
+
ensure
|
|
187
|
+
# The sequence coordinator generates the combined vector between context
|
|
188
|
+
# advances; it must not look like one of the pattern contexts itself.
|
|
189
|
+
PatSeq.send(:thread=, nil)
|
|
174
190
|
end
|
|
175
191
|
end
|
|
176
192
|
end
|
data/lib/origen/loader.rb
CHANGED
|
@@ -146,11 +146,11 @@ module Origen
|
|
|
146
146
|
# load the inherit files, then the current app's block files
|
|
147
147
|
app_paths_map.each do |app, full_paths|
|
|
148
148
|
full_paths.each do |full_path|
|
|
149
|
-
paths = full_path.to_s.split('/')
|
|
149
|
+
paths = full_path.to_s.split('/').map(&:underscore)
|
|
150
150
|
key = ''
|
|
151
151
|
only = Array(options[:only]) if options[:only]
|
|
152
152
|
except = Array(options[:except]) if options[:except]
|
|
153
|
-
path = paths.
|
|
153
|
+
path = paths.join('/')
|
|
154
154
|
# If the path refers to a nested sub-block then don't load the full hierarchy since they
|
|
155
155
|
# don't support inheritance or derivatives, modify the paths array so that only the sub-block
|
|
156
156
|
# level will be loaded and nothing else.
|
|
@@ -166,7 +166,7 @@ module Origen
|
|
|
166
166
|
unless (only && !only.include?(type)) || (except && except.include?(type))
|
|
167
167
|
with_parameters_transaction(type) do
|
|
168
168
|
paths.each_with_index do |path, i|
|
|
169
|
-
key = i == 0 ? path
|
|
169
|
+
key = i == 0 ? path : "#{key}/#{path}"
|
|
170
170
|
if app.blocks_files[key] && app.blocks_files[key][type]
|
|
171
171
|
app.blocks_files[key][type].each do |f|
|
|
172
172
|
if type == :attributes
|
|
@@ -187,7 +187,7 @@ module Origen
|
|
|
187
187
|
|
|
188
188
|
# Now load the rest
|
|
189
189
|
paths.each_with_index do |path, i|
|
|
190
|
-
key = i == 0 ? path
|
|
190
|
+
key = i == 0 ? path : "#{key}/#{path}"
|
|
191
191
|
if app.blocks_files[key]
|
|
192
192
|
app.blocks_files[key].each do |type, files|
|
|
193
193
|
unless type == :_sub_block || load_first.include?(type) || (only && !only.include?(type)) || (except && except.include?(type))
|
data/lib/origen/model.rb
CHANGED
|
@@ -246,7 +246,7 @@ module Origen
|
|
|
246
246
|
Origen.app.listeners_for(:on_mode_changed).each do |listener|
|
|
247
247
|
listener.on_mode_changed(mode: @current_mode, instance: self)
|
|
248
248
|
end
|
|
249
|
-
@current_mode # rubocop:disable Lint/Void
|
|
249
|
+
@current_mode # rubocop:disable Lint/Void, Lint/RedundantCopDisableDirective
|
|
250
250
|
end
|
|
251
251
|
alias_method :mode=, :current_mode=
|
|
252
252
|
|
data/lib/origen/pins/pin_bank.rb
CHANGED
|
@@ -61,30 +61,35 @@ module Origen
|
|
|
61
61
|
|
|
62
62
|
# Returns a hash containing all pins available in the current context stored by their primary ID
|
|
63
63
|
def pins(options = {})
|
|
64
|
+
options = options_with_current_package(options)
|
|
64
65
|
all_pins.select do |_id, pin|
|
|
65
66
|
pin.enabled?(options)
|
|
66
67
|
end
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
def power_pins(options = {})
|
|
71
|
+
options = options_with_current_package(options)
|
|
70
72
|
all_power_pins.select do |_id, pin|
|
|
71
73
|
pin.enabled?(options)
|
|
72
74
|
end
|
|
73
75
|
end
|
|
74
76
|
|
|
75
77
|
def ground_pins(options = {})
|
|
78
|
+
options = options_with_current_package(options)
|
|
76
79
|
all_ground_pins.select do |_id, pin|
|
|
77
80
|
pin.enabled?(options)
|
|
78
81
|
end
|
|
79
82
|
end
|
|
80
83
|
|
|
81
84
|
def other_pins(options = {})
|
|
85
|
+
options = options_with_current_package(options)
|
|
82
86
|
all_other_pins.select do |_id, pin|
|
|
83
87
|
pin.enabled?(options)
|
|
84
88
|
end
|
|
85
89
|
end
|
|
86
90
|
|
|
87
91
|
def virtual_pins(options = {})
|
|
92
|
+
options = options_with_current_package(options)
|
|
88
93
|
all_virtual_pins.select do |_id, pin|
|
|
89
94
|
pin.enabled?(options)
|
|
90
95
|
end
|
|
@@ -365,6 +370,14 @@ module Origen
|
|
|
365
370
|
# Returns the current configuration context for this pin/pin group, if a configuration has been
|
|
366
371
|
# explicitly set on this pin that will be returned, otherwise the current chip-level configuration
|
|
367
372
|
# context will be returned (nil if none is set)
|
|
373
|
+
def options_with_current_package(options)
|
|
374
|
+
if !options.key?(:package) && (package = current_package_id)
|
|
375
|
+
options.merge(package: package)
|
|
376
|
+
else
|
|
377
|
+
options
|
|
378
|
+
end
|
|
379
|
+
end
|
|
380
|
+
|
|
368
381
|
def current_configuration
|
|
369
382
|
if Origen.top_level
|
|
370
383
|
Origen.top_level.current_configuration
|
|
@@ -127,9 +127,10 @@ module Origen
|
|
|
127
127
|
|
|
128
128
|
# Returns the current top-level package ID, nil if none is set.
|
|
129
129
|
def current_package_id
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
top = owner if owner.respond_to?(:current_package)
|
|
131
|
+
top ||= Origen.top_level
|
|
132
|
+
package = top.current_package if top
|
|
133
|
+
package.id if package
|
|
133
134
|
end
|
|
134
135
|
|
|
135
136
|
# Returns the current top-level mode ID, nil if none is set.
|
data/lib/origen/registers/reg.rb
CHANGED
|
@@ -1318,7 +1318,9 @@ module Origen
|
|
|
1318
1318
|
# application-specific meta data properties
|
|
1319
1319
|
def respond_to?(*args) # :nodoc:
|
|
1320
1320
|
sym = args.first.to_sym
|
|
1321
|
-
|
|
1321
|
+
# Concrete methods are by far the common case. Check Ruby's normal method
|
|
1322
|
+
# table before building and merging the dynamic metadata hashes.
|
|
1323
|
+
super(sym) || has_bits?(sym) || meta_data_method?(sym) || BitCollection.instance_methods.include?(sym)
|
|
1322
1324
|
end
|
|
1323
1325
|
|
|
1324
1326
|
# Copy overlays from one reg object to another
|
data/lib/origen/undefined.rb
CHANGED
data/lib/origen/utility/diff.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Origen
|
|
|
21
21
|
# Set this attribute to the comment char used by the given file and comments will
|
|
22
22
|
# be ignored by the diff.
|
|
23
23
|
# An array of strings can be passed in to mask multiple comment identifiers.
|
|
24
|
-
|
|
24
|
+
attr_reader :comment_char
|
|
25
25
|
|
|
26
26
|
# Create a new diff, attributes can be initialized via the options, or can be
|
|
27
27
|
# set later.
|
|
@@ -29,13 +29,24 @@ module Origen
|
|
|
29
29
|
@file_a = options[:file_a]
|
|
30
30
|
@file_b = options[:file_b]
|
|
31
31
|
@ignore_blank_lines = options[:ignore_blank_lines]
|
|
32
|
-
|
|
32
|
+
self.comment_char = options[:comment_char]
|
|
33
33
|
@suspend_string = options[:suspend_string] # permits suspending diff check based on a string
|
|
34
34
|
@resume_string = options[:resume_string] # permits resuming diff check based on a string
|
|
35
|
+
@suspend_regex = Regexp.new(@suspend_string.to_s) if @suspend_string
|
|
36
|
+
@resume_regex = Regexp.new(@resume_string.to_s) if @resume_string
|
|
35
37
|
@suspend_diff = false
|
|
36
38
|
@resume_diff = false
|
|
37
39
|
end
|
|
38
40
|
|
|
41
|
+
def comment_char=(value)
|
|
42
|
+
@comment_char = value
|
|
43
|
+
chars = Array(value)
|
|
44
|
+
# These expressions are used for every line in both files. Compiling them
|
|
45
|
+
# once avoids allocating multiple arrays and regexps per compared line.
|
|
46
|
+
@comment_line_regexes = chars.map { |char| /^\s*#{char}.*/ }
|
|
47
|
+
@inline_comment_regexes = chars.map { |char| /(.*)\s*#{char}.*/ }
|
|
48
|
+
end
|
|
49
|
+
|
|
39
50
|
# Returns true if there are differences between the two files based on the
|
|
40
51
|
# current configuration
|
|
41
52
|
def diffs?
|
|
@@ -71,14 +82,10 @@ module Origen
|
|
|
71
82
|
|
|
72
83
|
def set_suspend_diff(line)
|
|
73
84
|
if line.valid_encoding?
|
|
74
|
-
if @
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
elsif @resume_string && @suspend_diff
|
|
79
|
-
if line =~ /#{@resume_string}/
|
|
80
|
-
@resume_diff = true
|
|
81
|
-
end
|
|
85
|
+
if @suspend_regex && !@suspend_diff
|
|
86
|
+
@suspend_diff = true if @suspend_regex.match(line)
|
|
87
|
+
elsif @resume_regex && @suspend_diff
|
|
88
|
+
@resume_diff = true if @resume_regex.match(line)
|
|
82
89
|
end
|
|
83
90
|
end
|
|
84
91
|
end
|
|
@@ -101,13 +108,10 @@ module Origen
|
|
|
101
108
|
if @comment_char
|
|
102
109
|
# Screen off any inline comments at the end of line
|
|
103
110
|
begin
|
|
104
|
-
|
|
105
|
-
unless line
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
else
|
|
109
|
-
return line.strip
|
|
110
|
-
end
|
|
111
|
+
@comment_line_regexes.each_with_index do |line_regex, i|
|
|
112
|
+
unless line_regex.match?(line)
|
|
113
|
+
match = @inline_comment_regexes[i].match(line)
|
|
114
|
+
return match ? match[1].strip : line.strip
|
|
111
115
|
end
|
|
112
116
|
end
|
|
113
117
|
# This rescue is a crude way to guard against non-ASCII files that find
|
|
@@ -127,14 +131,9 @@ module Origen
|
|
|
127
131
|
matched = false
|
|
128
132
|
while !matched && ix < array.size
|
|
129
133
|
begin
|
|
130
|
-
comment_matched = false
|
|
131
134
|
# Skip comment lines
|
|
132
|
-
|
|
133
|
-
[
|
|
134
|
-
if array[ix] =~ /^\s*#{char}.*/
|
|
135
|
-
comment_matched = true
|
|
136
|
-
end
|
|
137
|
-
end
|
|
135
|
+
comment_matched = @comment_char && @comment_line_regexes.any? do |regex|
|
|
136
|
+
regex.match(array[ix])
|
|
138
137
|
end
|
|
139
138
|
# Skip blank lines
|
|
140
139
|
if comment_matched
|
data/lib/origen.rb
CHANGED
|
@@ -60,7 +60,8 @@ unless defined? RGen::ORIGENTRANSITION
|
|
|
60
60
|
|
|
61
61
|
require 'English'
|
|
62
62
|
require 'pathname'
|
|
63
|
-
|
|
63
|
+
# Pry is only needed by the interactive command, which loads it on demand.
|
|
64
|
+
# Avoiding it here saves every non-interactive Origen process from loading Pry.
|
|
64
65
|
# require these here to make required files consistent between global commands invoke globally and global commands
|
|
65
66
|
# invoked from an application workspace
|
|
66
67
|
require 'colored'
|
|
@@ -3,23 +3,29 @@
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "origen_app_generators".freeze
|
|
6
|
-
s.version = "2.2.1"
|
|
6
|
+
s.version = "2.2.1"
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.8.11".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|
|
10
10
|
s.authors = ["Stephen McGinty".freeze]
|
|
11
|
-
s.date = "
|
|
11
|
+
s.date = "2026-08-06"
|
|
12
12
|
s.email = ["stephen.f.mcginty@gmail.com".freeze]
|
|
13
13
|
s.files = ["bin/boot.rb".freeze, "config/application.rb".freeze, "config/boot.rb".freeze, "config/commands.rb".freeze, "config/shared_commands.rb".freeze, "config/version.rb".freeze, "lib/origen_app_generators.rb".freeze, "lib/origen_app_generators/application.rb".freeze, "lib/origen_app_generators/base.rb".freeze, "lib/origen_app_generators/empty_application.rb".freeze, "lib/origen_app_generators/empty_plugin.rb".freeze, "lib/origen_app_generators/new.rb".freeze, "lib/origen_app_generators/new_app_tests.rb".freeze, "lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb".freeze, "lib/origen_app_generators/plugin.rb".freeze, "lib/origen_app_generators/test_engineering/common.rb".freeze, "lib/origen_app_generators/test_engineering/stand_alone_application.rb".freeze, "lib/origen_app_generators/test_engineering/test_block.rb".freeze, "templates/app_generators".freeze, "templates/app_generators/application".freeze, "templates/app_generators/application/.gitignore".freeze, "templates/app_generators/application/.irbrc".freeze, "templates/app_generators/application/.rspec".freeze, "templates/app_generators/application/.travis.yml".freeze, "templates/app_generators/application/Gemfile".freeze, "templates/app_generators/application/Rakefile".freeze, "templates/app_generators/application/app".freeze, "templates/app_generators/application/app/blocks".freeze, "templates/app_generators/application/app/blocks/top_level.rb".freeze, "templates/app_generators/application/app/lib".freeze, "templates/app_generators/application/app/lib/module.rb".freeze, "templates/app_generators/application/app/templates".freeze, "templates/app_generators/application/app/templates/web".freeze, "templates/app_generators/application/app/templates/web/index.md.erb".freeze, "templates/app_generators/application/app/templates/web/layouts".freeze, "templates/app_generators/application/app/templates/web/layouts/_basic.html.erb".freeze, "templates/app_generators/application/app/templates/web/partials".freeze, "templates/app_generators/application/app/templates/web/partials/_navbar.html.erb".freeze, "templates/app_generators/application/app/templates/web/release_notes.md.erb".freeze, "templates/app_generators/application/config".freeze, "templates/app_generators/application/config/application.rb".freeze, "templates/app_generators/application/config/boot.rb".freeze, "templates/app_generators/application/config/commands.rb".freeze, "templates/app_generators/application/config/maillist_dev.txt".freeze, "templates/app_generators/application/config/maillist_prod.txt".freeze, "templates/app_generators/application/config/version.rb".freeze, "templates/app_generators/application/doc".freeze, "templates/app_generators/application/doc/history".freeze, "templates/app_generators/application/dot_keep".freeze, "templates/app_generators/application/origen_core_session".freeze, "templates/app_generators/application/spec".freeze, "templates/app_generators/application/spec/spec_helper.rb".freeze, "templates/app_generators/application/target".freeze, "templates/app_generators/application/target/debug.rb".freeze, "templates/app_generators/application/target/default.rb".freeze, "templates/app_generators/application/target/production.rb".freeze, "templates/app_generators/new".freeze, "templates/app_generators/new/generator.rb".freeze, "templates/app_generators/new/info.md.erb".freeze, "templates/app_generators/origen_infrastructure".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/application.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/base.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/module.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/plugin.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/config".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb".freeze, "templates/app_generators/plugin".freeze, "templates/app_generators/plugin/Gemfile".freeze, "templates/app_generators/plugin/Rakefile".freeze, "templates/app_generators/plugin/app".freeze, "templates/app_generators/plugin/app/templates".freeze, "templates/app_generators/plugin/app/templates/web".freeze, "templates/app_generators/plugin/app/templates/web/index.md.erb".freeze, "templates/app_generators/plugin/app/templates/web/partials".freeze, "templates/app_generators/plugin/app/templates/web/partials/_navbar_external.html.erb".freeze, "templates/app_generators/plugin/app/templates/web/partials/_navbar_internal.html.erb".freeze, "templates/app_generators/plugin/config".freeze, "templates/app_generators/plugin/config/boot.rb".freeze, "templates/app_generators/plugin/gemspec.rb".freeze, "templates/app_generators/test_engineering".freeze, "templates/app_generators/test_engineering/environment".freeze, "templates/app_generators/test_engineering/environment/j750.rb".freeze, "templates/app_generators/test_engineering/environment/uflex.rb".freeze, "templates/app_generators/test_engineering/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application".freeze, "templates/app_generators/test_engineering/stand_alone_application/.keep".freeze, "templates/app_generators/test_engineering/test_block".freeze, "templates/app_generators/test_engineering/test_block/.keep".freeze]
|
|
14
14
|
s.homepage = "http://origen-sdk.org/origen_app_generators".freeze
|
|
15
15
|
s.licenses = ["MIT".freeze]
|
|
16
16
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
|
|
17
|
-
s.rubygems_version = "
|
|
17
|
+
s.rubygems_version = "3.2.3".freeze
|
|
18
18
|
s.summary = "Origen application generators".freeze
|
|
19
19
|
|
|
20
|
-
s.installed_by_version = "
|
|
20
|
+
s.installed_by_version = "3.2.3" if s.respond_to? :installed_by_version
|
|
21
21
|
|
|
22
|
-
s.specification_version
|
|
22
|
+
if s.respond_to? :specification_version then
|
|
23
|
+
s.specification_version = 4
|
|
24
|
+
end
|
|
23
25
|
|
|
24
|
-
s.add_runtime_dependency
|
|
26
|
+
if s.respond_to? :add_runtime_dependency then
|
|
27
|
+
s.add_runtime_dependency(%q<origen>.freeze, [">= 0.40.2"])
|
|
28
|
+
else
|
|
29
|
+
s.add_dependency(%q<origen>.freeze, [">= 0.40.2"])
|
|
30
|
+
end
|
|
25
31
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: origen
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.63.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen McGinty
|
|
8
8
|
- Priyavadan Kumar
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2026-08-06 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: activesupport
|
|
@@ -232,7 +233,7 @@ dependencies:
|
|
|
232
233
|
requirements:
|
|
233
234
|
- - ">="
|
|
234
235
|
- !ruby/object:Gem::Version
|
|
235
|
-
version: '1.
|
|
236
|
+
version: '1.50'
|
|
236
237
|
- - "<"
|
|
237
238
|
- !ruby/object:Gem::Version
|
|
238
239
|
version: '2'
|
|
@@ -242,7 +243,7 @@ dependencies:
|
|
|
242
243
|
requirements:
|
|
243
244
|
- - ">="
|
|
244
245
|
- !ruby/object:Gem::Version
|
|
245
|
-
version: '1.
|
|
246
|
+
version: '1.50'
|
|
246
247
|
- - "<"
|
|
247
248
|
- !ruby/object:Gem::Version
|
|
248
249
|
version: '2'
|
|
@@ -462,6 +463,7 @@ dependencies:
|
|
|
462
463
|
- - ">="
|
|
463
464
|
- !ruby/object:Gem::Version
|
|
464
465
|
version: '0'
|
|
466
|
+
description:
|
|
465
467
|
email:
|
|
466
468
|
- stephen.f.mcginty@gmail.com
|
|
467
469
|
- priyavadan@gmail.com
|
|
@@ -832,6 +834,7 @@ homepage: https://origen-sdk.org
|
|
|
832
834
|
licenses:
|
|
833
835
|
- MIT
|
|
834
836
|
metadata: {}
|
|
837
|
+
post_install_message:
|
|
835
838
|
rdoc_options: []
|
|
836
839
|
require_paths:
|
|
837
840
|
- lib
|
|
@@ -846,7 +849,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
846
849
|
- !ruby/object:Gem::Version
|
|
847
850
|
version: 1.8.11
|
|
848
851
|
requirements: []
|
|
849
|
-
rubygems_version:
|
|
852
|
+
rubygems_version: 3.2.3
|
|
853
|
+
signing_key:
|
|
850
854
|
specification_version: 4
|
|
851
855
|
summary: The Semiconductor Developer's Kit
|
|
852
856
|
test_files: []
|