origen_sim 0.20.5 → 0.20.6
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_sim/simulator.rb +2 -0
- data/lib/origen_sim/tester.rb +15 -4
- data/lib/origen_sim_dev/dut.rb +6 -1
- data/pattern/fails.rb +12 -0
- data/templates/origen_guides/simulation/debugging.md.erb +15 -0
- 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: 460b8179907e128d77b2974255f034d547f60c33c91f1ffde8e1bd25726238a7
|
4
|
+
data.tar.gz: a76d417628ad05a2a8da4d6ad4a2c7d0f97e9f275c9fe8aaa8c3ec21fa2a3e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b355f2be67eab8558b7e396da1116bbb5895a12a706202e509e1d617858d711fe13f2a30ded4c575bb487358dea5d6c75bb9b7742442e6b50ea6242f8cc91c
|
7
|
+
data.tar.gz: 743428765629ffc1100a2f749f99f587eaf4e673bb049b43a919f16a940e74d35d34ba49ab2c9abf6fc569951f2ce31846626e60cdb0c28a9cf40580a0394f50
|
data/config/version.rb
CHANGED
data/lib/origen_sim/simulator.rb
CHANGED
data/lib/origen_sim/tester.rb
CHANGED
@@ -5,6 +5,8 @@ module OrigenSim
|
|
5
5
|
|
6
6
|
TEST_PROGRAM_GENERATOR = OrigenSim::Generator
|
7
7
|
|
8
|
+
attr_accessor :out_of_bounds_handler
|
9
|
+
|
8
10
|
def initialize(options = {}, &block)
|
9
11
|
# Use Origen's collector to allow options to be set either from the options hash, or from the block
|
10
12
|
if block_given?
|
@@ -328,10 +330,19 @@ module OrigenSim
|
|
328
330
|
end
|
329
331
|
|
330
332
|
diffs.each do |position, expected, received|
|
331
|
-
if
|
332
|
-
|
333
|
+
if position < reg_or_val.size
|
334
|
+
if received == -1 || received == -2
|
335
|
+
reg_or_val[position].unknown = true
|
336
|
+
else
|
337
|
+
reg_or_val[position].write(received, force: true)
|
338
|
+
end
|
333
339
|
else
|
334
|
-
|
340
|
+
# This bit position is beyond the bounds of the register
|
341
|
+
if @out_of_bounds_handler
|
342
|
+
@out_of_bounds_handler.call(position, received, expected, reg_or_val)
|
343
|
+
else
|
344
|
+
Origen.log.error "bit[#{position}] of read operation on #{reg_or_val.path}.#{reg_or_val.name}: expected #{expected} received #{received}"
|
345
|
+
end
|
335
346
|
end
|
336
347
|
end
|
337
348
|
|
@@ -345,7 +356,7 @@ module OrigenSim
|
|
345
356
|
# Put the data back so the application behaves as it would if generating
|
346
357
|
# for a non-simulation tester target
|
347
358
|
diffs.each do |position, expected, received|
|
348
|
-
reg_or_val[position].write(expected, force: true)
|
359
|
+
reg_or_val[position].write(expected, force: true) if position < reg_or_val.size
|
349
360
|
end
|
350
361
|
end
|
351
362
|
end
|
data/lib/origen_sim_dev/dut.rb
CHANGED
@@ -170,7 +170,12 @@ module OrigenSimDev
|
|
170
170
|
jtag.write_dr(dr)
|
171
171
|
dr.rg_enable.write(0)
|
172
172
|
dr.rg_data.copy_all(reg)
|
173
|
-
|
173
|
+
if !options[:force_out_of_bounds]
|
174
|
+
jtag.read_dr(dr)
|
175
|
+
else
|
176
|
+
expect_val = dr.data + 2**dr.size
|
177
|
+
jtag.read_dr expect_val, size: dr.size + 1
|
178
|
+
end
|
174
179
|
end
|
175
180
|
end
|
176
181
|
end
|
data/pattern/fails.rb
CHANGED
@@ -20,4 +20,16 @@ Pattern.create do
|
|
20
20
|
ss "Test reading an X register value, expect LSB nibble to be 0"
|
21
21
|
dut.x_reg[3..0].read!(0)
|
22
22
|
end
|
23
|
+
|
24
|
+
ss "Test an out of bounds miscompare"
|
25
|
+
dut.cmd.write!(0x1234_5678)
|
26
|
+
dut.cmd.read!(0x1233_5678, force_out_of_bounds: true)
|
27
|
+
|
28
|
+
ss "Test user out of bounds handler"
|
29
|
+
if tester.sim?
|
30
|
+
tester.out_of_bounds_handler = proc do |position, received, expected, reg|
|
31
|
+
Origen.log.error "User handler hook is working --> #{reg.name}, bit[#{position}]: expected #{expected}, received #{received}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
dut.cmd.read!(0x1233_5678, force_out_of_bounds: true)
|
23
35
|
end
|
@@ -100,6 +100,21 @@ For reference, here is the update that was made to the JTAG driver to support th
|
|
100
100
|
|
101
101
|
If the driver has not provided this then a warning will be output and no received data will be given.
|
102
102
|
|
103
|
+
In some cases the protocol being used may generate failed compares that contain bit position meta data
|
104
|
+
that does not map to the register being read. In this case a generic message will be displayed with the
|
105
|
+
bit position that failed along with the register that was being read. It may be desirable to have application
|
106
|
+
specific code interpret these bits (for example if it is a status bit). Origen provides a hook for this. Below
|
107
|
+
is an example of how to implement a custom interpreter.
|
108
|
+
|
109
|
+
~~~ruby
|
110
|
+
if tester.sim?
|
111
|
+
tester.out_of_bounds_handler = proc do |position, received, expected, reg|
|
112
|
+
Origen.log.error "Got data ouside of #{reg.name} during the transaction, bit[#{position}]: expected #{expected}, received #{received}"
|
113
|
+
Origen.log.error "ECC error during read of #{reg.path}.#{reg.name}" if position == 39
|
114
|
+
end
|
115
|
+
end
|
116
|
+
~~~
|
117
|
+
|
103
118
|
This feature will automatically be enabled for any reads launched via the register object itself, e.g.
|
104
119
|
`my_reg.read!`, but not for reads launched by calling the `read_register` method manually,
|
105
120
|
e.g. `dut.read_register(my_reg)`.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_sim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.6
|
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-
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|