origen 0.7.45 → 0.7.46
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 +1 -1
- data/lib/origen/application.rb +12 -0
- data/lib/origen/application/lsf.rb +6 -4
- data/lib/origen/pins/pin.rb +22 -2
- data/lib/origen/pins/pin_clock.rb +87 -73
- data/lib/origen/pins/power_pin.rb +9 -0
- data/lib/origen/remote_manager.rb +35 -9
- data/lib/origen/utility/mailer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aa96dc40d731d65be9719183658fed3eaa4b059
|
4
|
+
data.tar.gz: 6acae3a224086bd332b90cd2d9ebbe4fc056ab61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26689bc47d753ad5e51eba5e1bdfddfaca1553baaefa5906dd4404db569a5b2c7a5bc1bc3aacabe77d4020303eb32965f0624a990c7b63db1630250823552ded
|
7
|
+
data.tar.gz: 0a94636dd35a31dd73aad8c474ffeab045aa84dc37dc9fe13115dd6ddf1cfb9ebc32ca4544a0c48642d647da91b4539db1a660b194f7ecc7dbb9caf74dc77c1f
|
data/config/version.rb
CHANGED
data/lib/origen/application.rb
CHANGED
@@ -181,6 +181,18 @@ module Origen
|
|
181
181
|
end
|
182
182
|
alias_method :imports_dir, :imports_directory
|
183
183
|
|
184
|
+
# Returns a path to the remotes directory for the application. e.g. if the app live
|
185
|
+
# at /home/thao/my_app, then the remotes directory will typically
|
186
|
+
# be /home/thao/.my_app_remotes_DO_NOT_HAND_MODIFY
|
187
|
+
#
|
188
|
+
# Origen will ensure that this directory is outside of the scope of the current application's revision
|
189
|
+
# control system. This prevents conflicts with the revision control system for the application and those
|
190
|
+
# used to import 3rd party dependencies
|
191
|
+
def remotes_directory
|
192
|
+
workspace_manager.remotes_directory
|
193
|
+
end
|
194
|
+
alias_method :remotes_dir, :remotes_directory
|
195
|
+
|
184
196
|
# Returns the namespace used by the application as a string
|
185
197
|
def namespace
|
186
198
|
@namespace ||= self.class.to_s.split('::').first.gsub('_', '').sub('Application', '')
|
@@ -37,11 +37,13 @@ module Origen
|
|
37
37
|
# Example
|
38
38
|
# # soc/nevis.rb
|
39
39
|
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
40
|
+
# Origen::Runner::LSF.configuration do |config|
|
41
|
+
# # Use "msg.nevis" for the project string when running in Noida
|
42
|
+
# if %x["domainname"] =~ /nidc/
|
43
|
+
# config.lsf.project = "msg.nevis"
|
44
|
+
# end
|
44
45
|
# end
|
46
|
+
#
|
45
47
|
# # Change the default group
|
46
48
|
# Origen.config.lsf.group = "lam"
|
47
49
|
def self.configuration
|
data/lib/origen/pins/pin.rb
CHANGED
@@ -73,6 +73,7 @@ module Origen
|
|
73
73
|
@size = 1
|
74
74
|
@value = 0
|
75
75
|
@clock = nil
|
76
|
+
@meta = options[:meta] || {}
|
76
77
|
on_init(owner, options)
|
77
78
|
# Assign the initial state from the method so that any inversion is picked up...
|
78
79
|
send(@reset)
|
@@ -159,7 +160,13 @@ module Origen
|
|
159
160
|
default = instance_variable_get("@#{attribute}")
|
160
161
|
if options[:function]
|
161
162
|
v = functions[:ids][options[:function]][attribute]
|
162
|
-
|
163
|
+
if v
|
164
|
+
if v.is_a?(Hash) && default.is_a?(Hash)
|
165
|
+
return default.merge(v) # v will overwrite any default values
|
166
|
+
else
|
167
|
+
return v
|
168
|
+
end
|
169
|
+
end
|
163
170
|
# else fall back to context-based lookup
|
164
171
|
end
|
165
172
|
mode_id = options[:mode] || current_mode_id
|
@@ -170,7 +177,16 @@ module Origen
|
|
170
177
|
config_id = config_id.to_sym if config_id
|
171
178
|
configuration = mode[config_id] || mode[:all]
|
172
179
|
if configuration
|
173
|
-
configuration[attribute]
|
180
|
+
v = configuration[attribute]
|
181
|
+
if v
|
182
|
+
if v.is_a?(Hash) && default.is_a?(Hash)
|
183
|
+
return default.merge(v) # v will overwrite any default values
|
184
|
+
else
|
185
|
+
return v
|
186
|
+
end
|
187
|
+
else
|
188
|
+
default
|
189
|
+
end
|
174
190
|
else
|
175
191
|
default
|
176
192
|
end
|
@@ -863,6 +879,10 @@ module Origen
|
|
863
879
|
@clock.next_edge
|
864
880
|
end
|
865
881
|
|
882
|
+
def duty_cycles
|
883
|
+
@clock.cycles_per_duty
|
884
|
+
end
|
885
|
+
|
866
886
|
def half_period
|
867
887
|
@clock.cycles_per_half_period
|
868
888
|
end
|
@@ -1,123 +1,137 @@
|
|
1
1
|
module Origen
|
2
2
|
module Pins
|
3
3
|
class PinClock
|
4
|
-
|
5
|
-
attr_accessor :cycles_per_half_period
|
6
|
-
attr_accessor :last_edge
|
7
|
-
attr_accessor :next_edge
|
4
|
+
attr_reader :cycles_per_duty, :last_edge, :next_edge
|
8
5
|
|
9
6
|
def initialize(owner, options = {})
|
10
7
|
@owner = owner
|
11
8
|
@running = false
|
12
|
-
@cycles_per_half_period = 0
|
13
|
-
@ns_per_half_period = 0
|
14
|
-
update_half_period(options)
|
15
|
-
end
|
16
9
|
|
17
|
-
|
18
|
-
@
|
10
|
+
@clock_period_in_ns = 0
|
11
|
+
@tester_period_in_ns = 0
|
12
|
+
|
13
|
+
update_clock_period(options)
|
14
|
+
update_tester_period_local
|
15
|
+
update_clock_parameters
|
19
16
|
end
|
20
17
|
|
21
18
|
def start_clock(options = {})
|
22
|
-
|
19
|
+
# Throw error if this pin is already a running clock
|
20
|
+
if running?
|
21
|
+
fail "PIN CLOCK ERROR: Clock on #{@owner.name} already running."
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
clock_updated = update_clock_period(options)
|
25
|
+
tester_updated = update_tester_period_local
|
26
|
+
if clock_updated || tester_updated
|
27
|
+
update_clock_parameters
|
26
28
|
end
|
27
29
|
|
28
|
-
@
|
29
|
-
|
30
|
-
cc "Start clock on #{@owner.name}: cycles_per_half_period=#{@cycles_per_half_period}, start cycle=#{@last_edge}"
|
30
|
+
cc "[PinClock] Start #{@owner.name}.clock at #{Origen.tester.cycle_count}: period=#{@clock_period_in_ns}ns, cycles=#{cycles_per_period}, duty=#{duty_str}"
|
31
|
+
update_edges
|
31
32
|
Origen.tester.push_running_clock(@owner) unless running?
|
32
33
|
@running = true
|
33
34
|
end
|
34
35
|
|
35
|
-
def
|
36
|
+
def stop_clock(options = {})
|
37
|
+
cc "[PinClock] Stop #{@owner.name}.clock: stop_cycle=#{Origen.tester.cycle_count}" if running?
|
38
|
+
Origen.tester.pop_running_clock(@owner) if running?
|
39
|
+
@running = false
|
40
|
+
end
|
41
|
+
|
42
|
+
def restart_clock
|
36
43
|
stop_clock
|
37
44
|
update_clock
|
38
45
|
start_clock
|
39
46
|
end
|
40
47
|
|
41
|
-
def stop_clock(_options = {})
|
42
|
-
cc "Stop clock on #{@owner.name}: stop cycle=#{Origen.tester.cycle_count}" if running?
|
43
|
-
Origen.tester.pop_running_clock(@owner) if running?
|
44
|
-
@running = false
|
45
|
-
end
|
46
|
-
|
47
48
|
def update_clock
|
48
|
-
|
49
|
-
|
50
|
-
@
|
49
|
+
if update_tester_period_local
|
50
|
+
update_clock_parameters
|
51
|
+
cc "[PinClock] Update #{@owner.name}.clock at #{Origen.tester.cycle_count}: period=#{@clock_period_in_ns}ns, cycles=#{cycles_per_period}, duty=#{duty_str}"
|
52
|
+
update_edges
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
56
|
+
def running?
|
57
|
+
@running
|
58
|
+
end
|
59
|
+
|
54
60
|
def toggle
|
55
61
|
@owner.toggle
|
56
|
-
|
57
|
-
|
62
|
+
update_edges
|
63
|
+
end
|
64
|
+
|
65
|
+
# The only caller to this should be legacy support so just force 50% duty cycle
|
66
|
+
def cycles_per_half_period
|
67
|
+
@cycles_per_duty.min
|
58
68
|
end
|
59
69
|
|
60
70
|
private
|
61
71
|
|
62
|
-
def
|
63
|
-
|
64
|
-
options = { cycles: 0,
|
65
|
-
period_in_s: 0, period_in_ms: 0, period_in_us: 0, period_in_ns: 0,
|
66
|
-
frequency_in_hz: 0, frequency_in_khz: 0, frequency_in_mhz: 0,
|
67
|
-
freq_in_hz: 0, freq_in_khz: 0, freq_in_mhz: 0
|
68
|
-
}.merge(options)
|
69
|
-
|
70
|
-
cycles = 0
|
71
|
-
cycles += options[:cycles]
|
72
|
-
cycles += s_to_cycles(options[:period_in_s])
|
73
|
-
cycles += ms_to_cycles(options[:period_in_ms])
|
74
|
-
cycles += us_to_cycles(options[:period_in_us])
|
75
|
-
cycles += ns_to_cycles(options[:period_in_ns])
|
76
|
-
cycles += hz_to_cycles(options[:frequency_in_hz])
|
77
|
-
cycles += khz_to_cycles(options[:frequency_in_khz])
|
78
|
-
cycles += mhz_to_cycles(options[:frequency_in_mhz])
|
79
|
-
cycles += hz_to_cycles(options[:freq_in_hz])
|
80
|
-
cycles += khz_to_cycles(options[:freq_in_khz])
|
81
|
-
cycles += mhz_to_cycles(options[:freq_in_mhz])
|
82
|
-
|
83
|
-
@cycles_per_half_period = cycles / 2
|
84
|
-
@ns_per_half_period = cycles * Origen.tester.current_period_in_ns
|
85
|
-
@cycles_per_half_period == old_cycles_per_half_period
|
72
|
+
def update_clock_parameters
|
73
|
+
@cycles_per_duty = [(cycles_per_period / 2.0).floor, (cycles_per_period / 2.0).ceil]
|
86
74
|
end
|
87
75
|
|
88
|
-
def
|
89
|
-
(
|
76
|
+
def cycles_per_period
|
77
|
+
(@clock_period_in_ns / @tester_period_in_ns).to_int
|
90
78
|
end
|
91
79
|
|
92
|
-
def
|
93
|
-
|
80
|
+
def update_edges
|
81
|
+
@last_edge = Origen.tester.cycle_count
|
82
|
+
@next_edge = Origen.tester.cycle_count + @cycles_per_duty[0]
|
83
|
+
@cycles_per_duty.reverse!
|
94
84
|
end
|
95
85
|
|
96
|
-
def
|
97
|
-
|
86
|
+
def update_tester_period_local
|
87
|
+
if Origen.tester.current_period_in_ns == @tester_period_in_ns
|
88
|
+
return false
|
89
|
+
else
|
90
|
+
@tester_period_in_ns = Origen.tester.current_period_in_ns
|
91
|
+
return true
|
92
|
+
end
|
98
93
|
end
|
99
94
|
|
100
|
-
def
|
101
|
-
|
102
|
-
end
|
95
|
+
def update_clock_period(options = {})
|
96
|
+
new = get_clock_period(options)
|
103
97
|
|
104
|
-
|
105
|
-
|
98
|
+
if new == @clock_period_in_ns
|
99
|
+
false
|
100
|
+
else
|
101
|
+
@clock_period_in_ns = new
|
102
|
+
true
|
103
|
+
end
|
106
104
|
end
|
107
105
|
|
108
|
-
def
|
109
|
-
|
110
|
-
|
106
|
+
def get_clock_period(options = {})
|
107
|
+
return @clock_period_in_ns if options.empty?
|
108
|
+
|
109
|
+
p = []
|
110
|
+
|
111
|
+
# Passed in as time
|
112
|
+
p << (options[:period_in_s] * 1_000_000_000) if options[:period_in_s]
|
113
|
+
p << (options[:period_in_ms] * 1_000_000) if options[:period_in_ms]
|
114
|
+
p << (options[:period_in_us] * 1_000) if options[:period_in_us]
|
115
|
+
p << (options[:period_in_ns] * 1) if options[:period_in_ns]
|
116
|
+
|
117
|
+
# Passed in as frequency (or freq.)
|
118
|
+
p << ((1.0 / options[:frequency_in_hz]) * 1_000_000_000) if options[:frequency_in_hz]
|
119
|
+
p << ((1.0 / options[:freq_in_hz]) * 1_000_000_000) if options[:freq_in_hz]
|
120
|
+
p << ((1.0 / options[:frequency_in_khz]) * 1_000_000) if options[:frequency_in_khz]
|
121
|
+
p << ((1.0 / options[:freq_in_khz]) * 1_000_000) if options[:freq_in_khz]
|
122
|
+
p << ((1.0 / options[:frequency_in_mhz]) * 1_000) if options[:frequency_in_mhz]
|
123
|
+
p << ((1.0 / options[:freq_in_mhz]) * 1_000) if options[:freq_in_mhz]
|
124
|
+
|
125
|
+
# Passed in as cycles (not advised)
|
126
|
+
p << (options[:cycles] * Origen.tester.period_in_ns) if options[:cycles]
|
111
127
|
|
112
|
-
|
113
|
-
|
128
|
+
return @clock_period_in_ns if p.empty?
|
129
|
+
fail "[Pin Clock] ERROR: Multiple unit declarations for #{@owner.name}.clock" if p.size > 1
|
130
|
+
p[0].to_int
|
114
131
|
end
|
115
132
|
|
116
|
-
def
|
117
|
-
|
118
|
-
options[:period_in_s] || options[:period_in_ms] || options[:period_in_us] || options[:period_in_ns]
|
119
|
-
options[:frequency_in_hz] || options[:frequency_in_khz] || options[:frequency_in_mhz] ||
|
120
|
-
options[:freq_in_hz] || options[:freq_in_khz] || options[:freq_in_mhz]
|
133
|
+
def duty_str
|
134
|
+
"#{@cycles_per_duty[0]}/#{@cycles_per_duty[1]}"
|
121
135
|
end
|
122
136
|
end
|
123
137
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
module Origen
|
2
2
|
module Pins
|
3
3
|
class PowerPin < Pin
|
4
|
+
attr_accessor :current_limit
|
5
|
+
|
6
|
+
def initialize(id, owner, options = {}) # :nodoc:
|
7
|
+
v = options[:voltage] || options[:voltages]
|
8
|
+
self.voltage = v if v
|
9
|
+
self.current_limit = options[:current_limit] if options[:current_limit]
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
4
13
|
# Set the operating voltage for the pin, can be a single value or an array
|
5
14
|
def voltage=(val)
|
6
15
|
@voltages = [val].flatten.uniq
|
@@ -18,15 +18,22 @@ module Origen
|
|
18
18
|
def require!
|
19
19
|
unless required?
|
20
20
|
while updates_required?
|
21
|
+
Origen.log.info '*******************************************************************************'
|
21
22
|
Origen.log.info 'The following remotes need to be updated, this will now happen automatically:'
|
22
23
|
dirty_remotes.each do |name, remote|
|
23
24
|
if remote[:path]
|
24
|
-
Origen.log.info " #{name} - #{remote[:path]}"
|
25
|
+
Origen.log.info " #{name} - #{remote[:path]}".green
|
25
26
|
else
|
26
|
-
Origen.log.info " #{name} - #{remote[:version]}"
|
27
|
+
Origen.log.info " #{name} - #{remote[:version]}".green
|
27
28
|
end
|
28
29
|
end
|
30
|
+
Origen.log.info ''
|
31
|
+
|
29
32
|
update!
|
33
|
+
|
34
|
+
Origen.log.info ''
|
35
|
+
Origen.log.info 'Finished updating remotes.'
|
36
|
+
Origen.log.info '*******************************************************************************'
|
30
37
|
end
|
31
38
|
@required = true
|
32
39
|
end
|
@@ -289,7 +296,7 @@ module Origen
|
|
289
296
|
end
|
290
297
|
end
|
291
298
|
|
292
|
-
# Makes all dirty
|
299
|
+
# Makes all dirty remotes clean
|
293
300
|
def update!
|
294
301
|
ensure_remotes_directory
|
295
302
|
dirty_remotes.each do |_name, remote|
|
@@ -305,12 +312,20 @@ module Origen
|
|
305
312
|
create_symlink(remote[:path], dir)
|
306
313
|
|
307
314
|
else
|
308
|
-
|
309
|
-
|
310
|
-
|
315
|
+
rc_url = remote[:rc_url] || remote[:vault]
|
316
|
+
tag = Origen::VersionString.new(remote[:version])
|
317
|
+
version_file = dir.to_s + '/.current_version'
|
318
|
+
if File.exist?("#{dir}/.initial_populate_successful")
|
319
|
+
FileUtils.rm_f(version_file) if File.exist?(version_file)
|
320
|
+
rc = RevisionControl.new remote: rc_url, local: dir
|
321
|
+
rc.checkout version: prefix_tag(tag), force: true
|
322
|
+
`echo "#{tag}" >> "#{version_file}"`
|
323
|
+
else
|
324
|
+
rc = RevisionControl.new remote: rc_url, local: dir
|
325
|
+
rc.checkout version: prefix_tag(tag), force: true
|
311
326
|
`touch "#{dir}/.initial_populate_successful"`
|
327
|
+
`echo "#{tag}" >> "#{version_file}"`
|
312
328
|
end
|
313
|
-
ws.switch_version(dir, remote[:version])
|
314
329
|
end
|
315
330
|
end
|
316
331
|
end
|
@@ -321,8 +336,8 @@ module Origen
|
|
321
336
|
|
322
337
|
def ensure_remotes_directory
|
323
338
|
unless remotes.empty?
|
324
|
-
unless File.exist?(
|
325
|
-
FileUtils.mkdir_p
|
339
|
+
unless File.exist?(Origen.app.remotes_dir)
|
340
|
+
FileUtils.mkdir_p Origen.app.remotes_dir
|
326
341
|
end
|
327
342
|
end
|
328
343
|
end
|
@@ -330,5 +345,16 @@ module Origen
|
|
330
345
|
def ws
|
331
346
|
Origen.app.workspace_manager
|
332
347
|
end
|
348
|
+
|
349
|
+
# If the supplied tag looks like a semantic version number, then make sure it has the
|
350
|
+
# 'v' prefix
|
351
|
+
def prefix_tag(tag)
|
352
|
+
tag = Origen::VersionString.new(tag)
|
353
|
+
if tag.semantic?
|
354
|
+
tag.prefixed
|
355
|
+
else
|
356
|
+
tag
|
357
|
+
end
|
358
|
+
end
|
333
359
|
end
|
334
360
|
end
|
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.7.
|
4
|
+
version: 0.7.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|