From d7095fad716666a5a4f368fed07158833aeb910f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 4 Dec 2021 18:17:13 +0000 Subject: [PATCH] should not have been duplicating wb_get function in 5 places --- src/soc/experiment/test/test_loadstore1.py | 67 ++++------------------ 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/src/soc/experiment/test/test_loadstore1.py b/src/soc/experiment/test/test_loadstore1.py index 25938282..c8dd70ea 100644 --- a/src/soc/experiment/test/test_loadstore1.py +++ b/src/soc/experiment/test/test_loadstore1.py @@ -18,59 +18,13 @@ from soc.experiment.test import pagetables from nmigen.compat.sim import run_simulation from random import random +from openpower.test.wb_get import wb_get +from openpower.test import wb_get as wbget -stop = False - -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<