Skip to content

Commit

Permalink
Ensure that comparisons are run on value returned by signal
Browse files Browse the repository at this point in the history
On upcoming cocotb 2.0 LogicObject has less implicit conversions and
accordingly the tests should explicitly acquire its value
  • Loading branch information
p12tic committed Sep 6, 2024
1 parent b2381e7 commit 295f3d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/axi_lite_slave/tests/test_axi_lite_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ async def write_address_0(dut):
await axim.write(ADDRESS, DATA)
await Timer(CLK_PERIOD_NS * 10, units='ns')

value = dut.dut.r_temp_0
value = dut.dut.r_temp_0.value

assert value == DATA, ("Register at address 0x%08X should have been "
"0x%08X but was 0x%08X" % (ADDRESS, DATA, int(value)))
dut._log.info("Write 0x%08X to address 0x%08X" % (int(value), ADDRESS))
Expand Down Expand Up @@ -110,7 +111,7 @@ async def write_and_read(dut):
value = await axim.read(ADDRESS)
await Timer(CLK_PERIOD_NS * 10, units='ns')

value = dut.dut.r_temp_0
value = dut.dut.r_temp_0.value
assert value == DATA, ("Register at address 0x%08X should have been "
"0x%08X but was 0x%08X" % (ADDRESS, DATA, int(value)))
dut._log.info("Write 0x%08X to address 0x%08X" % (int(value), ADDRESS))
Expand Down

0 comments on commit 295f3d4

Please sign in to comment.