From: Luke Kenneth Casson Leighton Date: Thu, 13 May 2021 21:02:32 +0000 (+0100) Subject: added STORE test in test_ldst_pi.py, and it worked straight off X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=20738782e90bd3fe47c2bb6f887456872c7a3ad3;p=soc.git added STORE test in test_ldst_pi.py, and it worked straight off --- 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<