From 518a9171182d0a720f6fd5b3956e85699b181d10 Mon Sep 17 00:00:00 2001 From: Yinan Xu Date: Wed, 6 Sep 2023 22:20:29 +0800 Subject: [PATCH] ref: update cached mmu state after regcpy (#160) --- src/isa/riscv64/difftest/ref.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/isa/riscv64/difftest/ref.c b/src/isa/riscv64/difftest/ref.c index 822d410fe..3192454b3 100644 --- a/src/isa/riscv64/difftest/ref.c +++ b/src/isa/riscv64/difftest/ref.c @@ -172,6 +172,9 @@ void isa_difftest_regcpy(void *dut, bool direction) { if (direction == DIFFTEST_TO_REF) { memcpy(&cpu, dut, DIFFTEST_REG_SIZE); csr_writeback(); + // need to clear the cached mmu states as well + extern void update_mmu_state(); + update_mmu_state(); } else { csr_prepare(); memcpy(dut, &cpu, DIFFTEST_REG_SIZE);