From: Luke Kenneth Casson Leighton Date: Sat, 4 Dec 2021 18:22:06 +0000 (+0000) Subject: should have been using common version of wb_get, not 8 duplicates X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4844a926d59af5a2a5213ad47d63777c0206fb45;p=soc.git should have been using common version of wb_get, not 8 duplicates --- diff --git a/src/soc/experiment/test/test_compldst_multi_mmu.py b/src/soc/experiment/test/test_compldst_multi_mmu.py index cb8bff00..f3a3421b 100644 --- a/src/soc/experiment/test/test_compldst_multi_mmu.py +++ b/src/soc/experiment/test/test_compldst_multi_mmu.py @@ -27,7 +27,9 @@ from nmutil.util import Display 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 + ######################################## @@ -143,7 +145,7 @@ def ldst_sim(dut): assert(ld_data==data) print("dzbz test passed") - dut.stop = True # stop simulation + wbget.stop = True # stop simulation ######################################## class TestLDSTCompUnitMMU(LDSTCompUnit): @@ -194,10 +196,10 @@ def test_scoreboard_mmu(): 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() @@ -252,10 +254,10 @@ def test_scoreboard_regspec_mmu(): 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() diff --git a/src/soc/experiment/test/test_wishbone.py b/src/soc/experiment/test/test_wishbone.py index fd3279de..d1a99381 100644 --- a/src/soc/experiment/test/test_wishbone.py +++ b/src/soc/experiment/test/test_wishbone.py @@ -1,44 +1,2 @@ -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<