From 413e89e1f150489462a803fdbaaaf9ecbd4a9b21 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Fri, 10 Dec 2021 20:30:14 +0100 Subject: [PATCH] test_loadstore1.py: begin code deduplication --- src/soc/experiment/test/test_loadstore1.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 -- 2.30.2