From 861f8d3187fa8a58e14d2394d56b28f1f434adc2 Mon Sep 17 00:00:00 2001 From: lewislzh Date: Fri, 1 Nov 2024 10:53:58 +0800 Subject: [PATCH] fix(dbltrp): No critical error is reported when comparing with Xiangshan. --- src/isa/riscv64/system/intr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/isa/riscv64/system/intr.c b/src/isa/riscv64/system/intr.c index 3ca72918c..ea22498e8 100644 --- a/src/isa/riscv64/system/intr.c +++ b/src/isa/riscv64/system/intr.c @@ -106,7 +106,13 @@ word_t raise_intr(word_t NO, vaddr_t epc) { case EX_SPF: difftest_skip_dut(1, 2); break; } #endif - MUXDEF(CONFIG_RV_SMRNMI,Assert( mnstatus->nmie, "critical error: trap when nmie close"), ); +#ifdef CONFIG_RV_SMRNMI +#ifdef CONFIG_SHARE + if (!mnstatus->nmie){return 0; } // this will assert in difftest +#else + Assert(mnstatus->nmie, "critical error: trap when nmie close"); +#endif // CONFIG_SHARE +#endif // CONFIG_RV_SMRNMI bool isNMI = MUXDEF(CONFIG_RV_SMRNMI, cpu.hasNMI && (NO & INTR_BIT), false); bool delegS = intr_deleg_S(NO); bool delegM = !delegS && !isNMI;