from soc.config.loadstore import ConfigMemoryPortInterface
from soc.experiment.test import pagetables
-from soc.experiment.test.test_wishbone import wb_get
+from openpower.test.wb_get import wb_get
+from openpower.test import wb_get as wbget
+
########################################
assert(ld_data==data)
print("dzbz test passed")
- dut.stop = True # stop simulation
+ wbget.stop = True # stop simulation
########################################
class TestLDSTCompUnitMMU(LDSTCompUnit):
sim.add_clock(1e-6)
dut.mem = pagetables.test1
- dut.stop = False
+ wbget.stop = False
sim.add_sync_process(wrap(ldst_sim(dut)))
- sim.add_sync_process(wrap(wb_get(dut)))
+ sim.add_sync_process(wrap(wb_get(dut.cmpi.wb_bus(), dut.mem)))
with sim.write_vcd('test_scoreboard_mmu.vcd'):
sim.run()
sim.add_clock(1e-6)
dut.mem = pagetables.test1
- dut.stop = False
+ wbget.stop = False
sim.add_sync_process(wrap(ldst_sim(dut)))
- sim.add_sync_process(wrap(wb_get(dut)))
+ sim.add_sync_process(wrap(wb_get(dut.cmpi.wb_bus(), dut.mem)))
with sim.write_vcd('test_scoreboard_regspec_mmu.vcd'):
sim.run()
-def wb_get(dut):
- """simulator process for getting memory load requests
- """
- mem = dut.mem
- wb = dut.cmpi.wb_bus()
+from openpower.test.wb_get import wb_get
- while not dut.stop:
- while True: # wait for dc_valid
- if dut.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<<i):
- res |= store & mask
- else:
- res |= data & mask
- mem[addr] = res
- print (" DCACHE set %x mask %x data %x" % (addr, sel, res))
- else:
- data = mem.get(addr, 0)
- yield wb.dat_r.eq(data)
- print (" DCACHE get %x data %x" % (addr, data))
-
- yield wb.ack.eq(1)
- yield
- yield wb.ack.eq(0)
- yield