From: Tobias Platen Date: Fri, 10 Dec 2021 19:30:14 +0000 (+0100) Subject: test_loadstore1.py: begin code deduplication X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=413e89e1f150489462a803fdbaaaf9ecbd4a9b21;p=soc.git test_loadstore1.py: begin code deduplication --- diff --git a/src/soc/experiment/test/test_loadstore1.py b/src/soc/experiment/test/test_loadstore1.py index 6c50cfc0..366e8e61 100644 --- a/src/soc/experiment/test/test_loadstore1.py +++ b/src/soc/experiment/test/test_loadstore1.py @@ -66,6 +66,33 @@ def setup_mmu(): return m, cmpi +def icache_read(dut,addr,priv,virt): + + yield i_in.priv_mode.eq(priv) + yield i_in.virt_mode.eq(virt) + yield i_in.req.eq(1) + yield i_in.nia.eq(addr) + yield i_in.stop_mark.eq(0) + + 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: + yield + valid = yield i_out.valid + failed = yield i_out.fetch_failed + yield i_in.req.eq(0) + + nia = yield i_out.nia + insn = yield i_out.insn + yield + yield + + return nia, insn, valid, failed + + test_exceptions = True test_dcbz = True test_random = True