Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dbltrp): add support for critical-error #486

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

lewislzh
Copy link
Contributor

@lewislzh lewislzh commented Oct 28, 2024

This pr raise critical-error in difftest when XiangShan issues a critical-error signal.
The critical-error state is defined in the smdbltrp extension. This extension specifies that when the critical-error signal is asserted, the CPU should halt execution. This PR implements a method for stopping execution in simulation mode, where difftest halts by triggering an abort.
In the future, an option to enter debug mode rather than directly halting the CPU will be introduced for handling critical-error. This incoming change won’t require modifications to the difftest framework; Xiangshan will only need to control it through an valid signal.

@lewislzh lewislzh added the do not merge do not merge this pr label Oct 28, 2024
Copy link
Member

@poemonsense poemonsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between this and trap?

@lewislzh
Copy link
Contributor Author

what's the difference between this and trap?
the critical-error state is defined in smdbltrp extension. critical-error
Xiangshan will send a critical-error signal to the top level and difftest. At this point, the core should stop running: during simulation comparison, difftest will stop by triggering an abort; in other cases, after Xiangshan generates the critical-error signal, the ROB will stop committing instructions.
I think this represents an interruption more severe than exceptions or interrupts, causing the CPU to halt execution directly.

@lewislzh
Copy link
Contributor Author

In the future, an option will be introduced to enter debug mode in the event of a critical-error, allowing the CPU to handle the critical-error in a way that improves error diagnosis and resolution. Currently, the handling method for critical-error is to directly halt CPU execution.

@poemonsense
Copy link
Member

poemonsense commented Oct 28, 2024

In the future, an option will be introduced to enter debug mode in the event of a critical-error, allowing the CPU to handle the critical-error in a way that improves error diagnosis and resolution. Currently, the handling method for critical-error is to directly halt CPU execution.

Make sense. Look good. Maybe we should add comments to explain its relationship with the double trap extension.

@lewislzh
Copy link
Contributor Author

In the future, an option will be introduced to enter debug mode in the event of a critical-error, allowing the CPU to handle the critical-error in a way that improves error diagnosis and resolution. Currently, the handling method for critical-error is to directly halt CPU execution.

Make sense. Look good. Maybe we should add comments to explain its relationship with the double trap extension.

Sure, I have updated the comment to clarify the relationship.

@lewislzh lewislzh removed the do not merge do not merge this pr label Oct 31, 2024
@poemonsense poemonsense merged commit 7c4bd54 into master Oct 31, 2024
5 checks passed
@poemonsense poemonsense deleted the dev-criticalerror branch October 31, 2024 07:55
@poemonsense
Copy link
Member

Thanks. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants