Incorrect `mepc` value after irq is taken
Hi all,
During a test, this segment of code is running on the core:
At PC=0x80000276 (a nop instruction), our testbench asserts a software interrupt, as shown from the waves below:
However, we see that mepc_q gets set to 0x80000274 after this interrupt is detected and handling begins, meaning that after the interrupt handler has ended, the core will jump back to this address, but as you can see from the code snippet, this is a misaligned address, so Ibex immediately takes an illegal instruction exception, and fails the test. This address comes from the exception_pc, which is muxed to the value of pc_if_i, which for some reason is set to this misaligned address, and is less than the pc_id_i.
Looks like the prefetch buffer changes are causing this - I'll look into it.