From 031e413d1753e67de48067a066230ca8c3b7e1f2 Mon Sep 17 00:00:00 2001 From: Dennis Date: Sat, 30 Oct 2021 23:27:14 -0700 Subject: [PATCH] Fix test_simple_rw_reg.test_illegal_address so that it always recognizes issue #9 Before this fix, the bug would only pop up for addresses that were dividable by 4. Otherwise, the AMBA AHB 3 Lite widget would return an error response because of an illegal HSIZE/HADDR combination. --- tests/cocotb_tests/test_simple_rw_reg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cocotb_tests/test_simple_rw_reg.py b/tests/cocotb_tests/test_simple_rw_reg.py index e649d3f..0d2c483 100644 --- a/tests/cocotb_tests/test_simple_rw_reg.py +++ b/tests/cocotb_tests/test_simple_rw_reg.py @@ -158,7 +158,7 @@ async def test_illegal_address(dut): await bus.reset() rand_addr = random.randint(8, 1337) - rand_val = random.randint(0, (1 << 32)-1) + rand_val = random.randint(0, (1 << 8)-1) dut._log.info(f"Write value {rand_val} to illegal addres {rand_addr}.") @@ -168,8 +168,8 @@ async def test_illegal_address(dut): await bus.write( address=rand_addr, value=rand_val, - nbytes=4, - step_size=4) + nbytes=1, + step_size=1) except AMBA3AHBLiteDriver.BusErrorResponse: write_error = True @@ -180,8 +180,8 @@ async def test_illegal_address(dut): try: await bus.read( address=rand_addr, - nbytes=4, - step_size=4) + nbytes=1, + step_size=1) except AMBA3AHBLiteDriver.BusErrorResponse: read_error = True