Skip to content

Commit 1ed060e

Browse files
author
M0stafaRady
committed
Mask bytes and half bytes in the ref model
1 parent a533915 commit 1ed060e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

verify/uvm-python/dffram_ref_model/dffram_ref_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ def write_bus(self, tr):
8787
# For example, to read the same resgiter uncomment the following lines
8888
td = tr.do_clone()
8989
if tr.write_size == "byte":
90-
td.data = self.ram.read_word(tr.addr >> 2)
90+
td.data = self.ram.read_word(tr.addr >> 2) & 0xFF
9191
elif tr.write_size == "half":
9292
if tr.addr & 0b1 != 0b0:
9393
uvm_error(
9494
self.tag,
9595
f"Half word address not aligned transaction: {tr.convert2string()}",
9696
)
97-
td.data = self.ram.read_word(tr.addr >> 2)
97+
td.data = self.ram.read_word(tr.addr >> 2) & 0xFFFF
9898
elif tr.write_size == "word":
9999
if tr.addr & 0b11 != 0b00:
100100
uvm_error(

0 commit comments

Comments
 (0)