If any error happens when fetching an instruction, we must preserve PC, not IA, in the mepc register.
We take the trap only if no IRQ is pending.
If another trap is pending from the execute stage, give it priority, since it came earlier in the program.
If any error happens when fetching an instruction, we must preserve PC, not IA, in the mepc register. We take the trap only if no IRQ is pending. If another trap is pending from the execute stage, give it priority, since it came earlier in the program.