origen_sim 0.20.5 → 0.20.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10adeb117e20dbfb4c23febad8c5e17f690583c7aff915459459482610c9db73
4
- data.tar.gz: 0f6f9ce9fd304904a2c470e73d7e1fae6e377c1b3a28a2e1cbd5df1626f4f0d0
3
+ metadata.gz: 460b8179907e128d77b2974255f034d547f60c33c91f1ffde8e1bd25726238a7
4
+ data.tar.gz: a76d417628ad05a2a8da4d6ad4a2c7d0f97e9f275c9fe8aaa8c3ec21fa2a3e57
5
5
  SHA512:
6
- metadata.gz: 4459230d306681f87128cf22b9310fc101f7354a0bc6a0a79f1d08cd31fa66c9bb57f7b49b5cc9684abab7be8a47390db6bf6eaa663ddea8984853318429057f
7
- data.tar.gz: 778e3e0643ac8ceb58c2f741fae6ef954d494c85a9301e6e8e7c3b37d59910cd413e6a494a848ee860128a3b79f75e1f999d9255fff5b2df3cab8543395204b8
6
+ metadata.gz: d7b355f2be67eab8558b7e396da1116bbb5895a12a706202e509e1d617858d711fe13f2a30ded4c575bb487358dea5d6c75bb9b7742442e6b50ea6242f8cc91c
7
+ data.tar.gz: 743428765629ffc1100a2f749f99f587eaf4e673bb049b43a919f16a940e74d35d34ba49ab2c9abf6fc569951f2ce31846626e60cdb0c28a9cf40580a0394f50
@@ -1,7 +1,7 @@
1
1
  module OrigenSim
2
2
  MAJOR = 0
3
3
  MINOR = 20
4
- BUGFIX = 5
4
+ BUGFIX = 6
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -1252,6 +1252,8 @@ module OrigenSim
1252
1252
  end
1253
1253
 
1254
1254
  def clean(net)
1255
+ # substitute ruby syntax ".." for verilog ":"
1256
+ net.gsub!('..', ':')
1255
1257
  if net =~ /^dut\./
1256
1258
  "#{testbench_top}.#{net}"
1257
1259
  else
@@ -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 received == -1 || received == -2
332
- reg_or_val[position].unknown = true
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
- reg_or_val[position].write(received, force: true)
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
@@ -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
- jtag.read_dr(dr)
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
@@ -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.5
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-06-12 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen