From f4248ef86d32178be86bb6dcb87bf630fa2f975b Mon Sep 17 00:00:00 2001 From: Mingkai Li Date: Sat, 19 Aug 2023 11:38:24 +0000 Subject: [PATCH] #1 normal_pc + 4 for exception --- riscv/processor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riscv/processor.cc b/riscv/processor.cc index f31c570d..46aa0f14 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -1083,7 +1083,7 @@ void processor_t::take_trap(trap_t& t, reg_t epc) } } /*normal_pc & normal_sp*/ - state.pc = state.normal_pc; + state.pc = state.normal_pc + 4; updateRC(state.cap_pc.node_id, -1); state.cap_pc.reset(); state.XPR.write(2, state.normal_sp); @@ -1096,7 +1096,7 @@ void processor_t::take_trap(trap_t& t, reg_t epc) else { /*switch_cap is invalid*/ /*pc & sp*/ - state.pc = state.normal_pc; + state.pc = state.normal_pc + 4; updateRC(state.cap_pc.node_id, -1); state.cap_pc.reset(); state.XPR.write(2, state.normal_sp);