From: Tobias Platen Date: Tue, 14 Dec 2021 14:30:35 +0000 (+0100) Subject: wip test case for virtual address fetch using fetch interface X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66e67a44554d9d9384d35dbb629ab2aa99c0ae39;p=soc.git wip test case for virtual address fetch using fetch interface --- diff --git a/src/soc/experiment/test/test_loadstore1.py b/src/soc/experiment/test/test_loadstore1.py index 29153e3a..2a9dc2b5 100644 --- a/src/soc/experiment/test/test_loadstore1.py +++ b/src/soc/experiment/test/test_loadstore1.py @@ -177,6 +177,11 @@ def _test_loadstore1_ifetch_multi(dut, mem): icache = dut.submodules.ldst.icache assert wbget.stop == False + print ("set process table") + yield from debug(dut, "set prtble") + yield mmu.rin.prtbl.eq(0x1000000) # set process table + yield + i_in = icache.i_in i_out = icache.i_out i_m_in = icache.m_in @@ -197,7 +202,34 @@ def _test_loadstore1_ifetch_multi(dut, mem): print ("TEST_MULTI: fetched %x from addr %x == %x" % (insn, nia,addr)) assert insn==0xF0+addr - # TODO: virt addrs + yield i_in.virt_mode.eq(1) + + virt_addrs = [0x10200,0x10204,0x10208,0x10200, + 0x102008,0x10204,0x10200,0x10200,0x10200C] + + for addr in virt_addrs: + yield from debug(dut, "virt_addr "+hex(addr)) + + timeout = 0 + + #TODO: use fetch interface here + ################################### + yield i_in.req.eq(1) + yield i_in.nia.eq(addr) + yield + valid = yield i_out.valid + failed = yield i_out.fetch_failed + while not valid and not failed and timeout < 100: + yield + valid = yield i_out.valid + failed = yield i_out.fetch_failed + timeout = timeout + 1 + yield i_in.req.eq(0) + ################################### + print("TEST_MULTI: failed=",failed) # this is reported wrong + + yield + yield wbget.stop = True