origen 0.42.2 → 0.43.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +2 -2
- data/lib/origen/application/runner.rb +4 -2
- data/lib/origen/commands.rb +1 -6
- data/lib/origen/file_handler.rb +10 -2
- data/lib/origen/generator.rb +2 -0
- data/lib/origen/generator/flow.rb +3 -1
- data/lib/origen/generator/job.rb +14 -11
- data/lib/origen/generator/pattern.rb +8 -8
- data/lib/origen/log.rb +122 -37
- data/lib/origen/pins/pin.rb +61 -46
- data/lib/origen/registers/bit_collection.rb +5 -5
- data/lib/origen/registers/reg.rb +7 -1
- data/origen_app_generators/origen_app_generators.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50ff914ed84d58eef72d7c1eee3919a420d0a4af50bd9fe01fbf4c79f334578b
|
4
|
+
data.tar.gz: b51d183c27e9cb027f520a21f7bae2f8a21cd41d1158dfc8ec41feecb55409fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b227567f13516ee3cb2aeef1ea5b423febcfb3cfe2443f61a0e79857032cd301df77753cede06d88bd2ce2d1eea9720b48e60fb3b235946cf1121ede63f3f22
|
7
|
+
data.tar.gz: ef83425ec57f409158281bd045c9847dc5b97cbed7a89e99feb18a7037581309cfd7f7e3ae846e2b5626991f07cb310ade1cf4c2ce479337e38b80db576d6921
|
data/config/version.rb
CHANGED
@@ -46,7 +46,9 @@ module Origen
|
|
46
46
|
Origen.log.info 'Monitor status of remote jobs via:'
|
47
47
|
Origen.log.info ' origen l'
|
48
48
|
else
|
49
|
-
|
49
|
+
unless tester && tester.try(:sim?)
|
50
|
+
Origen.log.info '*' * 70 unless options[:quiet]
|
51
|
+
end
|
50
52
|
Origen.app.listeners_for(:before_generate).each do |listener|
|
51
53
|
if listener.class.instance_method(:before_generate).arity == 0
|
52
54
|
listener.before_generate
|
@@ -104,7 +106,7 @@ module Origen
|
|
104
106
|
end
|
105
107
|
end
|
106
108
|
|
107
|
-
unless options[:quiet]
|
109
|
+
unless options[:quiet] || (tester && tester.try(:sim?))
|
108
110
|
Origen.log.info '*' * 70
|
109
111
|
stats.print_summary unless options[:action] == :merge
|
110
112
|
end
|
data/lib/origen/commands.rb
CHANGED
@@ -97,12 +97,7 @@ Origen.lsf.current_command = @command
|
|
97
97
|
|
98
98
|
if ARGV.delete('-d') || ARGV.delete('--debug')
|
99
99
|
begin
|
100
|
-
|
101
|
-
require 'byebug'
|
102
|
-
else
|
103
|
-
require 'rubygems'
|
104
|
-
require 'ruby-debug'
|
105
|
-
end
|
100
|
+
require 'byebug'
|
106
101
|
rescue LoadError
|
107
102
|
def debugger
|
108
103
|
caller[0] =~ /.*\/(\w+\.rb):(\d+).*/
|
data/lib/origen/file_handler.rb
CHANGED
@@ -15,7 +15,10 @@ module Origen
|
|
15
15
|
# This will also take care of recursively expanding any embedded
|
16
16
|
# list references.
|
17
17
|
def expand_list(files, options = {})
|
18
|
-
|
18
|
+
options = {
|
19
|
+
preserve_duplicates: tester && tester.try(:sim?)
|
20
|
+
}.merge(options)
|
21
|
+
list_of_files = [files].flatten.map do |file|
|
19
22
|
f = file.strip
|
20
23
|
# Takes care of blank or comment lines in a list file
|
21
24
|
if f.empty? || f =~ /^\s*#/
|
@@ -28,7 +31,12 @@ module Origen
|
|
28
31
|
else
|
29
32
|
f
|
30
33
|
end
|
31
|
-
end.flatten.compact
|
34
|
+
end.flatten.compact
|
35
|
+
if options[:preserve_duplicates]
|
36
|
+
list_of_files
|
37
|
+
else
|
38
|
+
list_of_files.uniq
|
39
|
+
end
|
32
40
|
end
|
33
41
|
|
34
42
|
# Returns the contents of the given list file in an array, if it
|
data/lib/origen/generator.rb
CHANGED
@@ -31,7 +31,9 @@ module Origen
|
|
31
31
|
end
|
32
32
|
interface.close(flow: true, sub_flow: true)
|
33
33
|
else
|
34
|
-
|
34
|
+
unless tester.try(:sim?)
|
35
|
+
Origen.log.info "Generating... #{Origen.file_handler.current_file.basename}"
|
36
|
+
end
|
35
37
|
interface = Origen.reset_interface(options)
|
36
38
|
Origen.interface.set_top_level_flow
|
37
39
|
Origen.interface.flow_generator.set_flow_description(Origen.interface.consume_comments)
|
data/lib/origen/generator/job.rb
CHANGED
@@ -165,19 +165,22 @@ module Origen
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
rescue Exception => e
|
168
|
-
|
169
|
-
|
170
|
-
Origen.
|
171
|
-
|
172
|
-
Origen.log.error
|
173
|
-
|
174
|
-
|
175
|
-
|
168
|
+
# Whoever has aborted the job is responsible for cleaning it up
|
169
|
+
unless e.is_a?(Origen::Generator::AbortError)
|
170
|
+
if @options[:continue] || Origen.running_remotely?
|
171
|
+
Origen.log.error "FAILED - #{@requested_pattern} (for target #{Origen.target.name})"
|
172
|
+
Origen.log.error e.message
|
173
|
+
e.backtrace.each do |l|
|
174
|
+
Origen.log.error l
|
175
|
+
end
|
176
|
+
if @options[:compile]
|
177
|
+
Origen.app.stats.failed_files += 1
|
178
|
+
else
|
179
|
+
Origen.app.stats.failed_patterns += 1
|
180
|
+
end
|
176
181
|
else
|
177
|
-
|
182
|
+
raise
|
178
183
|
end
|
179
|
-
else
|
180
|
-
raise
|
181
184
|
end
|
182
185
|
end
|
183
186
|
Origen.log.stop_job
|
@@ -372,9 +372,7 @@ module Origen
|
|
372
372
|
unless job.test?
|
373
373
|
File.delete(job.output_pattern) if File.exist?(job.output_pattern)
|
374
374
|
|
375
|
-
|
376
|
-
log.info "Generating... #{job.output_pattern_directory}/#{job.output_pattern_filename}".ljust(50)
|
377
|
-
else
|
375
|
+
unless tester.try(:sim?)
|
378
376
|
log.info "Generating... #{job.output_pattern_directory}/#{job.output_pattern_filename}".ljust(50)
|
379
377
|
end
|
380
378
|
end
|
@@ -468,11 +466,13 @@ module Origen
|
|
468
466
|
end
|
469
467
|
end
|
470
468
|
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
469
|
+
unless tester.try(:sim?)
|
470
|
+
log.info ' '
|
471
|
+
log.info "Pattern vectors: #{stats.number_of_vectors_for(job.output_pattern).to_s.ljust(10)}"
|
472
|
+
log.info 'Execution time'.ljust(15) + ': %.6f' % stats.execution_time_for(job.output_pattern)
|
473
|
+
log.info '----------------------------------------------------------------------'
|
474
|
+
check_for_changes(job.output_pattern, job.reference_pattern) unless tester.try(:disable_pattern_diffs)
|
475
|
+
end
|
476
476
|
stats.record_pattern_completion(job.output_pattern)
|
477
477
|
end
|
478
478
|
|
data/lib/origen/log.rb
CHANGED
@@ -17,6 +17,7 @@ module Origen
|
|
17
17
|
@log_time_0 = @t0 = Time.new
|
18
18
|
self.level = :normal
|
19
19
|
@custom_logs = {}
|
20
|
+
@interceptors = {}
|
20
21
|
end
|
21
22
|
|
22
23
|
def console_only?(options = {})
|
@@ -79,57 +80,94 @@ module Origen
|
|
79
80
|
@level
|
80
81
|
end
|
81
82
|
|
83
|
+
# @api private
|
84
|
+
#
|
85
|
+
# @example of an interceptor:
|
86
|
+
#
|
87
|
+
# # An interceptor ID is returned, this should be given to stop_intercepting
|
88
|
+
# @log_intercept_id = Origen.log.start_intercepting do |msg, type, options, original|
|
89
|
+
# if some_condition_is_true?
|
90
|
+
# # Handling it ourselves
|
91
|
+
# my_method(msg, type)
|
92
|
+
# else
|
93
|
+
# # Call the original Origen.log method (or the next interceptor in line)
|
94
|
+
# original.call(msg, type, options)
|
95
|
+
# end
|
96
|
+
# end
|
97
|
+
def start_intercepting(&block)
|
98
|
+
id = block.object_id
|
99
|
+
@interceptors[id] = block
|
100
|
+
id
|
101
|
+
end
|
102
|
+
|
103
|
+
# @api private
|
104
|
+
def stop_intercepting(id)
|
105
|
+
@interceptors.delete(id)
|
106
|
+
end
|
107
|
+
|
82
108
|
def debug(string = '', options = {})
|
83
109
|
string, options = sanitize_args(string, options)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
110
|
+
intercept(string, :debug, options) do |msg, type, options|
|
111
|
+
msg = format_msg('DEBUG', msg)
|
112
|
+
log_files(:debug, msg) unless console_only?(options)
|
113
|
+
console.debug msg
|
114
|
+
nil
|
115
|
+
end
|
88
116
|
end
|
89
117
|
|
90
|
-
def info(string = '',
|
118
|
+
def info(string = '', options = {})
|
91
119
|
string, options = sanitize_args(string, options)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
120
|
+
intercept(string, :info, options) do |msg, type, options|
|
121
|
+
msg = format_msg('INFO', msg)
|
122
|
+
log_files(:info, msg) unless console_only?(options)
|
123
|
+
console.info msg
|
124
|
+
nil
|
125
|
+
end
|
96
126
|
end
|
97
127
|
# Legacy methods
|
98
128
|
alias_method :lputs, :info
|
99
129
|
alias_method :lprint, :info
|
100
130
|
|
101
|
-
def success(string = '',
|
131
|
+
def success(string = '', options = {})
|
102
132
|
string, options = sanitize_args(string, options)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
133
|
+
intercept(string, :success, options) do |msg, type, options|
|
134
|
+
msg = format_msg('SUCCESS', msg)
|
135
|
+
log_files(:info, msg) unless console_only?(options)
|
136
|
+
console.info color_unless_remote(msg, :green)
|
137
|
+
nil
|
138
|
+
end
|
107
139
|
end
|
108
140
|
|
109
|
-
def deprecate(string = '',
|
141
|
+
def deprecate(string = '', options = {})
|
110
142
|
string, options = sanitize_args(string, options)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
143
|
+
intercept(string, :deprecate, options) do |msg, type, options|
|
144
|
+
msg = format_msg('DEPRECATED', msg)
|
145
|
+
log_files(:warn, msg) unless console_only?(options)
|
146
|
+
console.warn color_unless_remote(msg, :yellow)
|
147
|
+
nil
|
148
|
+
end
|
115
149
|
end
|
116
150
|
alias_method :deprecated, :deprecate
|
117
151
|
|
118
|
-
def warn(string = '',
|
152
|
+
def warn(string = '', options = {})
|
119
153
|
string, options = sanitize_args(string, options)
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
154
|
+
intercept(string, :warn, options) do |msg, type, options|
|
155
|
+
msg = format_msg('WARNING', msg)
|
156
|
+
log_files(:warn, msg) unless console_only?(options)
|
157
|
+
console.warn color_unless_remote(msg, :yellow)
|
158
|
+
nil
|
159
|
+
end
|
124
160
|
end
|
125
161
|
alias_method :warning, :warn
|
126
162
|
|
127
|
-
def error(string = '',
|
163
|
+
def error(string = '', options = {})
|
128
164
|
string, options = sanitize_args(string, options)
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
165
|
+
intercept(string, :error, options) do |msg, type, options|
|
166
|
+
msg = format_msg('ERROR', msg)
|
167
|
+
log_files(:error, msg) unless console_only?(options)
|
168
|
+
console.error color_unless_remote(msg, :red)
|
169
|
+
nil
|
170
|
+
end
|
133
171
|
end
|
134
172
|
|
135
173
|
# Made these all class methods so that they can be read without
|
@@ -154,22 +192,25 @@ module Origen
|
|
154
192
|
level == :verbose
|
155
193
|
end
|
156
194
|
|
157
|
-
#
|
195
|
+
# Force the logger to write any buffered output to the log files
|
158
196
|
def flush
|
159
|
-
|
160
|
-
|
197
|
+
@open_logs.each do |logger, file|
|
198
|
+
file.flush
|
199
|
+
end
|
200
|
+
nil
|
161
201
|
end
|
162
202
|
|
163
203
|
# Mainly intended for testing the logger, this will return the log level to the default (:normal)
|
164
204
|
# and close all log files, such that any further logging will be done to a new file(s)
|
165
205
|
def reset
|
166
206
|
self.level = :normal
|
167
|
-
|
207
|
+
flush
|
208
|
+
close_log(@last_file)
|
168
209
|
@last_file = nil
|
169
|
-
@job_file
|
210
|
+
close_log(@job_file)
|
170
211
|
@job_file = nil
|
171
212
|
@custom_logs.each do |name, log|
|
172
|
-
log
|
213
|
+
close_log(log)
|
173
214
|
end
|
174
215
|
@custom_logs = {}
|
175
216
|
end
|
@@ -184,7 +225,16 @@ module Origen
|
|
184
225
|
dir = File.join(dir, env)
|
185
226
|
end
|
186
227
|
FileUtils.mkdir_p dir unless File.exist?(dir)
|
228
|
+
@@job_file_paths = {} unless defined?(@@job_file_paths)
|
229
|
+
# Make sure the log name is unique in this run, duplication and overwrite can occur in cases where
|
230
|
+
# a pattern is run multiple times during a simulation
|
187
231
|
@job_file_path = File.join(dir, "#{name}.txt")
|
232
|
+
if n = @@job_file_paths[@job_file_path]
|
233
|
+
@@job_file_paths[@job_file_path] += 1
|
234
|
+
@job_file_path = File.join(dir, "#{name}_#{n}.txt")
|
235
|
+
else
|
236
|
+
@@job_file_paths[@job_file_path] = 1
|
237
|
+
end
|
188
238
|
FileUtils.rm_f(@job_file_path) if File.exist?(@job_file_path)
|
189
239
|
@job_file = open_log(@job_file_path)
|
190
240
|
end
|
@@ -192,8 +242,13 @@ module Origen
|
|
192
242
|
# @api private
|
193
243
|
def stop_job
|
194
244
|
if @job_file
|
195
|
-
|
196
|
-
|
245
|
+
if tester && tester.respond_to?(:log_file_written)
|
246
|
+
tester.log_file_written @job_file_path
|
247
|
+
else
|
248
|
+
Origen.log.info "Log file written to: #{@job_file_path}"
|
249
|
+
end
|
250
|
+
flush
|
251
|
+
close_log(@job_file)
|
197
252
|
@job_file = nil
|
198
253
|
end
|
199
254
|
end
|
@@ -218,6 +273,24 @@ module Origen
|
|
218
273
|
|
219
274
|
private
|
220
275
|
|
276
|
+
def intercept(msg, type, options, &block)
|
277
|
+
if @interceptors.size > 0
|
278
|
+
call_interceptor(@interceptors.values, msg, type, options, &block)
|
279
|
+
else
|
280
|
+
yield(msg, type, options)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
def call_interceptor(interceptors, msg, type, options, &original)
|
285
|
+
interceptor = interceptors.shift
|
286
|
+
if interceptors.empty?
|
287
|
+
func = -> (msg, type, options) { original.call(msg, type, options) }
|
288
|
+
else
|
289
|
+
func = -> (msg, type, options) { call_interceptor(interceptors, msg, type, options, &original) }
|
290
|
+
end
|
291
|
+
interceptor.call(msg, type, options, func)
|
292
|
+
end
|
293
|
+
|
221
294
|
def sanitize_args(*args)
|
222
295
|
message = ''
|
223
296
|
options = {}
|
@@ -266,13 +339,25 @@ module Origen
|
|
266
339
|
end
|
267
340
|
|
268
341
|
def open_log(file)
|
342
|
+
@open_logs ||= {}
|
343
|
+
unless file.class == IO
|
344
|
+
file = File.open(file, 'w+')
|
345
|
+
end
|
269
346
|
l = Logger.new(file)
|
270
347
|
l.formatter = proc do |severity, dateime, progname, msg|
|
271
348
|
msg
|
272
349
|
end
|
350
|
+
@open_logs[l] = file
|
273
351
|
l
|
274
352
|
end
|
275
353
|
|
354
|
+
def close_log(logger)
|
355
|
+
if logger
|
356
|
+
@open_logs.delete(logger)
|
357
|
+
logger.close
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
276
361
|
def relog(msg)
|
277
362
|
if msg =~ /^\[(\w+)\] .*/
|
278
363
|
method = Regexp.last_match(1).downcase
|
data/lib/origen/pins/pin.rb
CHANGED
@@ -56,6 +56,14 @@ module Origen
|
|
56
56
|
attr_accessor :description
|
57
57
|
attr_accessor :notes
|
58
58
|
|
59
|
+
# Returns a hash containing any meta data associated with the current pin state
|
60
|
+
#
|
61
|
+
# my_pin.read!(1, meta: { position: 10 })
|
62
|
+
# my_pin.state_meta # => { position: 10 }
|
63
|
+
# my_pin.dont_care
|
64
|
+
# my_pin.state_meta # => {}
|
65
|
+
attr_reader :state_meta
|
66
|
+
|
59
67
|
# Should be instantiated through the HasPins macros
|
60
68
|
def initialize(id, owner, options = {}) # :nodoc:
|
61
69
|
options = {
|
@@ -89,6 +97,7 @@ module Origen
|
|
89
97
|
@clock = nil
|
90
98
|
@meta = options[:meta] || {}
|
91
99
|
@dib_meta = options[:dib_meta] || {}
|
100
|
+
@state_meta = {}
|
92
101
|
@_saved_state = []
|
93
102
|
@_saved_value = []
|
94
103
|
@_saved_suspend = []
|
@@ -638,6 +647,11 @@ module Origen
|
|
638
647
|
@repeat_previous
|
639
648
|
end
|
640
649
|
|
650
|
+
def set_state_with_options(state, options = {})
|
651
|
+
@state_meta = options[:meta] || {}
|
652
|
+
set_state(state)
|
653
|
+
end
|
654
|
+
|
641
655
|
def set_state(state)
|
642
656
|
invalidate_vector_cache
|
643
657
|
@repeat_previous = false
|
@@ -690,76 +704,77 @@ module Origen
|
|
690
704
|
|
691
705
|
def state=(value)
|
692
706
|
invalidate_vector_cache
|
707
|
+
@state_meta = {}
|
693
708
|
@state = value
|
694
709
|
end
|
695
710
|
|
696
711
|
# Set the pin to drive a 1 on future cycles
|
697
|
-
def drive_hi
|
698
|
-
|
712
|
+
def drive_hi(options = {})
|
713
|
+
set_state_with_options(:drive, options)
|
699
714
|
set_value(1)
|
700
715
|
end
|
701
716
|
alias_method :write_hi, :drive_hi
|
702
717
|
|
703
|
-
def drive_hi!
|
704
|
-
drive_hi
|
718
|
+
def drive_hi!(options = {})
|
719
|
+
drive_hi(options)
|
705
720
|
cycle
|
706
721
|
end
|
707
722
|
alias_method :write_hi!, :drive_hi!
|
708
723
|
|
709
724
|
# Set the pin to drive a high voltage on future cycles (if the tester supports it).
|
710
725
|
# For example on a J750 high-voltage channel the pin state would be set to "2"
|
711
|
-
def drive_very_hi
|
712
|
-
|
726
|
+
def drive_very_hi(options = {})
|
727
|
+
set_state_with_options(:drive_very_hi, options)
|
713
728
|
set_value(1)
|
714
729
|
end
|
715
730
|
|
716
|
-
def drive_very_hi!
|
717
|
-
drive_very_hi
|
731
|
+
def drive_very_hi!(options = {})
|
732
|
+
drive_very_hi(options)
|
718
733
|
cycle
|
719
734
|
end
|
720
735
|
|
721
736
|
# Set the pin to drive a 0 on future cycles
|
722
|
-
def drive_lo
|
723
|
-
|
737
|
+
def drive_lo(options = {})
|
738
|
+
set_state_with_options(:drive, options)
|
724
739
|
set_value(0)
|
725
740
|
end
|
726
741
|
alias_method :write_lo, :drive_lo
|
727
742
|
|
728
|
-
def drive_lo!
|
729
|
-
drive_lo
|
743
|
+
def drive_lo!(options = {})
|
744
|
+
drive_lo(options)
|
730
745
|
cycle
|
731
746
|
end
|
732
747
|
alias_method :write_lo!, :drive_lo!
|
733
748
|
|
734
|
-
def drive_mem
|
735
|
-
|
749
|
+
def drive_mem(options = {})
|
750
|
+
set_state_with_options(:drive_mem, options)
|
736
751
|
end
|
737
752
|
|
738
|
-
def drive_mem!
|
739
|
-
drive_mem
|
753
|
+
def drive_mem!(options = {})
|
754
|
+
drive_mem(options)
|
740
755
|
cycle
|
741
756
|
end
|
742
757
|
|
743
|
-
def expect_mem
|
744
|
-
|
758
|
+
def expect_mem(options = {})
|
759
|
+
set_state_with_options(:expect_mem, options)
|
745
760
|
end
|
746
761
|
|
747
|
-
def expect_mem!
|
748
|
-
expect_mem
|
762
|
+
def expect_mem!(options = {})
|
763
|
+
expect_mem(options)
|
749
764
|
cycle
|
750
765
|
end
|
751
766
|
|
752
767
|
# Set the pin to expect a 1 on future cycles
|
753
|
-
def assert_hi(
|
754
|
-
|
768
|
+
def assert_hi(options = {})
|
769
|
+
set_state_with_options(:compare, options)
|
755
770
|
set_value(1)
|
756
771
|
end
|
757
772
|
alias_method :expect_hi, :assert_hi
|
758
773
|
alias_method :compare_hi, :assert_hi
|
759
774
|
alias_method :read_hi, :assert_hi
|
760
775
|
|
761
|
-
def assert_hi!
|
762
|
-
assert_hi
|
776
|
+
def assert_hi!(options = {})
|
777
|
+
assert_hi(options)
|
763
778
|
cycle
|
764
779
|
end
|
765
780
|
alias_method :expect_hi!, :assert_hi!
|
@@ -767,8 +782,8 @@ module Origen
|
|
767
782
|
alias_method :read_hi!, :assert_hi!
|
768
783
|
|
769
784
|
# Set the pin to expect a 0 on future cycles
|
770
|
-
def assert_lo(
|
771
|
-
|
785
|
+
def assert_lo(options = {})
|
786
|
+
set_state_with_options(:compare, options)
|
772
787
|
set_value(0)
|
773
788
|
# Planning to add the active load logic to the tester instead...
|
774
789
|
# options = { :active => false #if active true means to take tester active load capability into account
|
@@ -783,8 +798,8 @@ module Origen
|
|
783
798
|
alias_method :compare_lo, :assert_lo
|
784
799
|
alias_method :read_lo, :assert_lo
|
785
800
|
|
786
|
-
def assert_lo!
|
787
|
-
assert_lo
|
801
|
+
def assert_lo!(options = {})
|
802
|
+
assert_lo(options)
|
788
803
|
cycle
|
789
804
|
end
|
790
805
|
alias_method :expect_lo!, :assert_lo!
|
@@ -792,12 +807,12 @@ module Origen
|
|
792
807
|
alias_method :read_lo!, :assert_lo!
|
793
808
|
|
794
809
|
# Set the pin to X on future cycles
|
795
|
-
def dont_care
|
796
|
-
|
810
|
+
def dont_care(options = {})
|
811
|
+
set_state_with_options(:dont_care, options)
|
797
812
|
end
|
798
813
|
|
799
|
-
def dont_care!
|
800
|
-
dont_care
|
814
|
+
def dont_care!(options = {})
|
815
|
+
dont_care(options)
|
801
816
|
cycle
|
802
817
|
end
|
803
818
|
|
@@ -807,14 +822,14 @@ module Origen
|
|
807
822
|
# [0,1,1,0].each do |level|
|
808
823
|
# $pin(:d_in).drive(level)
|
809
824
|
# end
|
810
|
-
def drive(value)
|
811
|
-
|
825
|
+
def drive(value, options = {})
|
826
|
+
set_state_with_options(:drive, options)
|
812
827
|
set_value(value)
|
813
828
|
end
|
814
829
|
alias_method :write, :drive
|
815
830
|
|
816
|
-
def drive!(value)
|
817
|
-
drive(value)
|
831
|
+
def drive!(value, options = {})
|
832
|
+
drive(value, options)
|
818
833
|
cycle
|
819
834
|
end
|
820
835
|
alias_method :write!, :drive!
|
@@ -825,8 +840,8 @@ module Origen
|
|
825
840
|
# [0,1,1,0].each do |level|
|
826
841
|
# $pin(:d_in).assert(level)
|
827
842
|
# end
|
828
|
-
def assert(value,
|
829
|
-
|
843
|
+
def assert(value, options = {})
|
844
|
+
set_state_with_options(:compare, options)
|
830
845
|
set_value(value)
|
831
846
|
end
|
832
847
|
alias_method :compare, :assert
|
@@ -841,15 +856,15 @@ module Origen
|
|
841
856
|
alias_method :expect!, :assert!
|
842
857
|
alias_method :read!, :assert!
|
843
858
|
|
844
|
-
def assert_midband
|
845
|
-
|
859
|
+
def assert_midband(options = {})
|
860
|
+
set_state_with_options(:compare_midband, options)
|
846
861
|
end
|
847
862
|
alias_method :compare_midband, :assert_midband
|
848
863
|
alias_method :expect_midband, :assert_midband
|
849
864
|
alias_method :read_midband, :assert_midband
|
850
865
|
|
851
|
-
def assert_midband!
|
852
|
-
assert_midband
|
866
|
+
def assert_midband!(options = {})
|
867
|
+
assert_midband(options)
|
853
868
|
cycle
|
854
869
|
end
|
855
870
|
alias_method :compare_midband!, :assert_midband!
|
@@ -909,14 +924,14 @@ module Origen
|
|
909
924
|
end
|
910
925
|
|
911
926
|
# Mark the (data) from the pin to be captured
|
912
|
-
def capture
|
913
|
-
|
927
|
+
def capture(options = {})
|
928
|
+
set_state_with_options(:capture, options)
|
914
929
|
end
|
915
930
|
alias_method :store, :capture
|
916
931
|
|
917
932
|
# Mark the (data) from the pin to be captured and trigger a cycle
|
918
|
-
def capture!
|
919
|
-
capture
|
933
|
+
def capture!(options = {})
|
934
|
+
capture(options)
|
920
935
|
cycle
|
921
936
|
end
|
922
937
|
alias_method :store!, :capture!
|
@@ -919,7 +919,7 @@ module Origen
|
|
919
919
|
else
|
920
920
|
fail "Unknown operation (#{operation}), must be :read or :write"
|
921
921
|
end
|
922
|
-
make_hex_like(str, size / 4)
|
922
|
+
make_hex_like(str, (size / 4.0).ceil)
|
923
923
|
end
|
924
924
|
|
925
925
|
# Shifts the data in the collection left by one place. The data held
|
@@ -972,11 +972,11 @@ module Origen
|
|
972
972
|
|
973
973
|
# Converts a binary-like representation of a data value into a hex-like version.
|
974
974
|
# e.g. input => 010S0011SSSS0110 (where S, X or V represent store, don't care or overlay)
|
975
|
-
# output =>
|
975
|
+
# output => [010s]3S6 (i.e. nibbles that are not all of the same type are expanded)
|
976
976
|
def make_hex_like(regval, size_in_nibbles)
|
977
977
|
outstr = ''
|
978
|
-
regex = '^'
|
979
|
-
size_in_nibbles.times { regex += '(....)' }
|
978
|
+
regex = '^(.?.?.?.)'
|
979
|
+
(size_in_nibbles - 1).times { regex += '(....)' }
|
980
980
|
regex += '$'
|
981
981
|
Regexp.new(regex) =~ regval
|
982
982
|
|
@@ -993,7 +993,7 @@ module Origen
|
|
993
993
|
outstr += nibble[0, 1] # .to_s
|
994
994
|
# Otherwise present this nibble in 'binary' format
|
995
995
|
else
|
996
|
-
outstr += "
|
996
|
+
outstr += "[#{nibble.downcase}]"
|
997
997
|
end
|
998
998
|
# Otherwise if all 1s and 0s...
|
999
999
|
else
|
data/lib/origen/registers/reg.rb
CHANGED
@@ -796,7 +796,13 @@ module Origen
|
|
796
796
|
object = writer
|
797
797
|
(Origen.top_level || owner).write_register_missing!(self) unless object
|
798
798
|
end
|
799
|
-
|
799
|
+
if tester && tester.respond_to?(operation)
|
800
|
+
tester.send(operation, self, options) do
|
801
|
+
object.send(operation, self, options)
|
802
|
+
end
|
803
|
+
else
|
804
|
+
object.send(operation, self, options)
|
805
|
+
end
|
800
806
|
self
|
801
807
|
end
|
802
808
|
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
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 = "2018-12-19"
|
12
12
|
s.email = ["stephen.f.mcginty@gmail.com".freeze]
|
13
13
|
s.files = ["bin/boot.rb".freeze, "bin/fix_my_workspace".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/origen_infrastructure/app_generator_plugin.rb".freeze, "lib/origen_app_generators/plugin.rb".freeze, "lib/origen_app_generators/sub_block_parser.rb".freeze, "lib/origen_app_generators/test_engineering/stand_alone_application.rb".freeze, "lib/origen_app_generators/test_engineering/test_block.rb".freeze, "lib/tasks/app_generators.rake".freeze, "lib/tasks/new_app_tests.rake".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/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/lib".freeze, "templates/app_generators/application/lib/app.rake".freeze, "templates/app_generators/application/lib/module.rb".freeze, "templates/app_generators/application/lib/top_level.rb".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/application/templates".freeze, "templates/app_generators/application/templates/web".freeze, "templates/app_generators/application/templates/web/index.md.erb".freeze, "templates/app_generators/application/templates/web/layouts".freeze, "templates/app_generators/application/templates/web/layouts/_basic.html.erb".freeze, "templates/app_generators/application/templates/web/partials".freeze, "templates/app_generators/application/templates/web/partials/_navbar.html.erb".freeze, "templates/app_generators/application/templates/web/release_notes.md.erb".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/config".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/application.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/base.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/module.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/plugin.rb".freeze, "templates/app_generators/plugin".freeze, "templates/app_generators/plugin/Gemfile".freeze, "templates/app_generators/plugin/Rakefile".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/plugin/lib".freeze, "templates/app_generators/plugin/lib/README".freeze, "templates/app_generators/plugin/lib_dev".freeze, "templates/app_generators/plugin/lib_dev/README".freeze, "templates/app_generators/plugin/templates".freeze, "templates/app_generators/plugin/templates/web".freeze, "templates/app_generators/plugin/templates/web/index.md.erb".freeze, "templates/app_generators/plugin/templates/web/partials".freeze, "templates/app_generators/plugin/templates/web/partials/_navbar_external.html.erb".freeze, "templates/app_generators/plugin/templates/web/partials/_navbar_internal.html.erb".freeze, "templates/app_generators/test_engineering".freeze, "templates/app_generators/test_engineering/stand_alone_application".freeze, "templates/app_generators/test_engineering/stand_alone_application/Gemfile".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/j750.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/uflex.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/pattern".freeze, "templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/target".freeze, "templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb".freeze, "templates/app_generators/test_engineering/test_block".freeze, "templates/app_generators/test_engineering/test_block/environment".freeze, "templates/app_generators/test_engineering/test_block/environment/j750.rb".freeze, "templates/app_generators/test_engineering/test_block/environment/ultraflex.rb".freeze, "templates/app_generators/test_engineering/test_block/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/test_block/lib".freeze, "templates/app_generators/test_engineering/test_block/lib/controller.rb".freeze, "templates/app_generators/test_engineering/test_block/lib/interface.rb".freeze, "templates/app_generators/test_engineering/test_block/lib/model.rb".freeze, "templates/app_generators/test_engineering/test_block/lib_dev".freeze, "templates/app_generators/test_engineering/test_block/lib_dev/dut.rb".freeze, "templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb".freeze, "templates/app_generators/test_engineering/test_block/pattern".freeze, "templates/app_generators/test_engineering/test_block/pattern/example.rb".freeze, "templates/app_generators/test_engineering/test_block/program".freeze, "templates/app_generators/test_engineering/test_block/program/prb1.rb".freeze, "templates/app_generators/test_engineering/test_block/target".freeze, "templates/app_generators/test_engineering/test_block/target/default.rb".freeze]
|
14
14
|
s.homepage = "http://origen-sdk.org/origen_app_generators".freeze
|
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.
|
4
|
+
version: 0.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|