From e45514d6e3275887639a6074b535a68450ef6776 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 26 Jun 2020 19:00:07 +0100 Subject: [PATCH] load/store unit test needed to wait for busy_o otherwise, the bus was still processing the previous transaction --- src/soc/config/test/test_loadstore.py | 31 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/soc/config/test/test_loadstore.py b/src/soc/config/test/test_loadstore.py index cdcba940..0cbb81fc 100644 --- a/src/soc/config/test/test_loadstore.py +++ b/src/soc/config/test/test_loadstore.py @@ -5,6 +5,7 @@ import random from nmigen.back.pysim import Simulator, Settle from soc.config.loadstore import ConfigLoadStoreUnit from collections import namedtuple +from nmigen.cli import rtlil def write_to_addr(dut, addr, value): @@ -21,7 +22,7 @@ def write_to_addr(dut, addr, value): yield dut.x_stall_i.eq(0) yield yield dut.x_st_i.eq(0) - while (yield dut.x_stall_i): + while (yield dut.x_busy_o): yield @@ -35,7 +36,7 @@ def read_from_addr(dut, addr): yield yield dut.x_ld_i.eq(0) yield Settle() - while (yield dut.x_stall_i): + while (yield dut.x_busy_o): yield assert (yield dut.x_valid_i) return (yield dut.m_ld_data_o) @@ -44,16 +45,16 @@ def read_from_addr(dut, addr): def write_byte(dut, addr, val): offset = addr & 0x3 yield dut.x_addr_i.eq(addr) - yield dut.x_st_i.eq(1) yield dut.x_st_data_i.eq(val << (offset * 8)) + yield dut.x_st_i.eq(1) yield dut.x_mask_i.eq(1 << offset) - print ("write_byte", addr, hex(1<