solving two problems related to the interrupt + mret,sret instructions
The first issue was that interrupt_cause_r lagged one cycle behind interrupt_pending. As a result, the previous interrupt cause was incorrectly used for delegation, which led to unexpected behavior.
The second issue occurred when an sret instruction coincided with an interrupt, causing the CPU to halt.