From 53fee3ba82f067cd231ad4342d0bf2d0d5d08e45 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 4 Dec 2021 18:00:01 +0000 Subject: [PATCH] remove wb_get, should not have been massively duplicated. moved to openpower-isa --- src/soc/experiment/test/test_ldst_pi.py | 89 +++++-------------------- 1 file changed, 18 insertions(+), 71 deletions(-) diff --git a/src/soc/experiment/test/test_ldst_pi.py b/src/soc/experiment/test/test_ldst_pi.py index 86dec1cf..11535bfb 100644 --- a/src/soc/experiment/test/test_ldst_pi.py +++ b/src/soc/experiment/test/test_ldst_pi.py @@ -10,6 +10,8 @@ from nmigen.cli import rtlil from nmutil.mask import Mask, masked from nmutil.util import Display from random import randint, seed +from openpower.test.wb_get import wb_get +from openpower.test import wb_get as wbget if True: from nmigen.back.pysim import Simulator, Delay, Settle @@ -27,7 +29,7 @@ from soc.experiment.mmu import MMU from nmigen.compat.sim import run_simulation -stop = False +wbget.stop = False def b(x): # byte-reverse function return int.from_bytes(x.to_bytes(8, byteorder='little'), @@ -38,63 +40,16 @@ def b(x): # byte-reverse function # for cell in mem: # f.write(str(hex(cell))+"="+str(hex(mem[cell]))+"\n") -def wb_get(wb, mem): - """simulator process for getting memory load requests - """ - - global stop - assert(stop==False) - - while not stop: - while True: # wait for dc_valid - if stop: - return - cyc = yield (wb.cyc) - stb = yield (wb.stb) - if cyc and stb: - break - yield - addr = (yield wb.adr) << 3 - if addr not in mem: - print (" WB LOOKUP NO entry @ %x, returning zero" % (addr)) - - # 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<