From 20738782e90bd3fe47c2bb6f887456872c7a3ad3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 13 May 2021 22:02:32 +0100 Subject: [PATCH] added STORE test in test_ldst_pi.py, and it worked straight off --- src/soc/experiment/test/test_ldst_pi.py | 31 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/soc/experiment/test/test_ldst_pi.py b/src/soc/experiment/test/test_ldst_pi.py index 8688bd94..9c1d83bc 100644 --- a/src/soc/experiment/test/test_ldst_pi.py +++ b/src/soc/experiment/test/test_ldst_pi.py @@ -73,9 +73,27 @@ def wb_get(wb): if addr not in mem: print (" WB LOOKUP NO entry @ %x, returning zero" % (addr)) - data = mem.get(addr, 0) - yield wb.dat_r.eq(data) - print (" DCACHE get %x data %x" % (addr, data)) + # read or write? + we = (yield wb.we) + if we: + store = (yield wb.dat_w) + sel = (yield wb.sel) + data = mem.get(addr, 0) + # note we assume 8-bit sel, here + res = 0 + for i in range(8): + mask = 0xff << (i*8) + if sel & (1<