origen 0.7.1 → 0.7.2
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/pins/pin.rb +37 -0
- data/lib/origen/registers/bit_collection.rb +24 -0
- data/lib/origen/registers/reg.rb +20 -11
- 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: 6924c8fd9b6f9043fc3e2706d24dd645c2ba3a04
|
4
|
+
data.tar.gz: 28ff7c05aa1857d2586aac761cfd7e7e6c2ff039
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c69ed2f1daeeb8c6d729ebde1fb8b7cf6fa41678600aa0f7fba5ce2453713662c9e6ec0beb0dac0e045a87b7576f9600dfd73241db12e5d10f6da586365dba7
|
7
|
+
data.tar.gz: b842b9584e28e6f19420a9dd553099488e6e849c2781331612ba1bd813c3806e91a95091ac6b5abbcf2ec15e60a54d561b85bac7032bff225630a277c7678c63
|
data/config/version.rb
CHANGED
data/lib/origen/pins/pin.rb
CHANGED
@@ -74,6 +74,43 @@ module Origen
|
|
74
74
|
send(@reset)
|
75
75
|
end
|
76
76
|
|
77
|
+
# Causes the pin to continuously drive 1 for 2 seconds and then drive 0 for 2 seconds.
|
78
|
+
#
|
79
|
+
# This is not an API that is intended to be used within a pattern. Rather it is a debug aid when
|
80
|
+
# setting up something like a bench test environment that uses Origen Link. For example you would
|
81
|
+
# call this method on a pin from a console session, then confirm with a multimeter that the pin
|
82
|
+
# is toggling on the relevant hardware.
|
83
|
+
#
|
84
|
+
# Call Pin#goodbye to stop it.
|
85
|
+
#
|
86
|
+
# @example Call from an origen console like this
|
87
|
+
#
|
88
|
+
# dut.pin(:tdi).hello
|
89
|
+
def hello
|
90
|
+
drive_hi
|
91
|
+
@@hello_pins ||= []
|
92
|
+
@@hello_pins << self unless @@hello_pins.include?(self)
|
93
|
+
@@hello_loop ||= Thread.new do
|
94
|
+
loop do
|
95
|
+
@@hello_pins.each(&:toggle)
|
96
|
+
if $tester
|
97
|
+
# Add a dummy timeset if one is not set yet, doesn't really matter what it is in this case
|
98
|
+
# and better not to force the user to setup a debug workaround due to running outside of a pattern
|
99
|
+
$tester.set_timeset('hello_world', 40) unless $tester.timeset
|
100
|
+
$tester.cycle
|
101
|
+
end
|
102
|
+
sleep 2
|
103
|
+
end
|
104
|
+
end
|
105
|
+
puts "Pin #{name} is toggling with a period of 2 seconds"
|
106
|
+
end
|
107
|
+
|
108
|
+
# See Pin#hello
|
109
|
+
def goodbye
|
110
|
+
@@hello_pins.delete(self)
|
111
|
+
puts "Pin #{name} has stopped toggling"
|
112
|
+
end
|
113
|
+
|
77
114
|
# When sorting pins do it by ID
|
78
115
|
def <=>(other_pin)
|
79
116
|
@id <=> other_pin.id
|
@@ -84,6 +84,30 @@ module Origen
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
# Update the register contents with the live value from the device under test.
|
88
|
+
#
|
89
|
+
# The current tester needs to be an OrigenLink driver. Upon calling this method a request will
|
90
|
+
# be made to read the given register, the read data will be captured and the register model
|
91
|
+
# will be updated.
|
92
|
+
#
|
93
|
+
# The register parent register object is returned, this means that calling .sync on a register
|
94
|
+
# or bitcollection object will automatically update it and the display the register in the
|
95
|
+
# console.
|
96
|
+
#
|
97
|
+
# Normally this method should be called from a breakpoint during pattern debug, and it is
|
98
|
+
# not intended to be inserted into production pattern logic.
|
99
|
+
def sync
|
100
|
+
if tester.try(:link?)
|
101
|
+
v = tester.capture do
|
102
|
+
store!
|
103
|
+
end
|
104
|
+
write(v.first)
|
105
|
+
parent
|
106
|
+
else
|
107
|
+
Origen.log.warning 'Sync is not supported on the current tester driver, register not updated'
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
87
111
|
# Copies all data and flags from one bit collection (or reg) object to another
|
88
112
|
#
|
89
113
|
# This method will accept a dumb value as the argument, in which case it is essentially a write,
|
data/lib/origen/registers/reg.rb
CHANGED
@@ -155,7 +155,7 @@ module Origen
|
|
155
155
|
bit_span = upper - lower + 1
|
156
156
|
end
|
157
157
|
width = bit_width * bit_span
|
158
|
-
line << '|' + "
|
158
|
+
line << '|' + "#{bit_name[0..width - 2]}".center(width + bit_span - 1)
|
159
159
|
|
160
160
|
else
|
161
161
|
bit.shift_out_left do |bit|
|
@@ -166,8 +166,13 @@ module Origen
|
|
166
166
|
end
|
167
167
|
|
168
168
|
else
|
169
|
-
|
170
|
-
|
169
|
+
if name
|
170
|
+
bit_name = "#{name}"
|
171
|
+
txt = "#{bit_name[0..bit_width - 2]}"
|
172
|
+
else
|
173
|
+
txt = ''
|
174
|
+
end
|
175
|
+
line << '|' + txt.center(bit_width)
|
171
176
|
end
|
172
177
|
end
|
173
178
|
end
|
@@ -252,17 +257,21 @@ module Origen
|
|
252
257
|
end
|
253
258
|
end
|
254
259
|
else
|
255
|
-
if
|
256
|
-
|
257
|
-
|
258
|
-
if bit.reset_val == :undefined
|
259
|
-
val = 'X'
|
260
|
+
if name
|
261
|
+
if bit.has_known_value?
|
262
|
+
val = bit.val
|
260
263
|
else
|
261
|
-
|
264
|
+
if bit.reset_val == :undefined
|
265
|
+
val = 'X'
|
266
|
+
else
|
267
|
+
val = 'M'
|
268
|
+
end
|
262
269
|
end
|
270
|
+
value = "#{val}" + _state_desc(bit)
|
271
|
+
line << '|' + value.center(bit_width)
|
272
|
+
else
|
273
|
+
line << '|' + ''.center(bit_width)
|
263
274
|
end
|
264
|
-
value = "#{val}" + _state_desc(bit)
|
265
|
-
line << '|' + value.center(bit_width)
|
266
275
|
end
|
267
276
|
end
|
268
277
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|