[rtl] Flush Zcmp state machine on exception or interrupt#2374
[rtl] Flush Zcmp state machine on exception or interrupt#2374SamuelRiedel wants to merge 1 commit intolowRISC:masterfrom
Conversation
Bug reported by "Xingzhi Zhang" (https://github.com/zxz2004626)
|
@zxz2004626 Can you please verify that those changes fix the bugs also on your side? |
Sure, I will test it and report to you later. |
|
Hi @SamuelRiedel , I carefully verified these patches. Your patches fix most of the problems. The state machine is capable of successfully resetting itself when encountering interruptions or exceptions. Thank you for your quick response and serious attitude! However, there still some subtle problems. The spec (cm.popret and cm.popretz) statement I have some improvements for this. You could see my PR in your fork. |
|
Thank you for the verification. And you're right, we'll fix that as well. |
Correctly reset the Zcmp expanded instruction state machine when a trap (exception or interrupt) occurs.
Previously, if a trap interrupts the execution of expanded instructions, the state machine retains its progress. This stale state will cause the processor to incorrectly resume or misinterpret the next Zcmp instruction, leading to an incorrect execution. This bug was reported by "Xingzhi Zhang" (https://github.com/zxz2004626).
I tested this fix manually for now. We still need to implement dedicated regression tests in the future.