-
Notifications
You must be signed in to change notification settings - Fork 188
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
Draft: refactor the instruction stepper to better support waiting instructions like WFI, WRS.{NTO, STO} #746
Conversation
The main goal here is to surface wait-states of the hart (e.g. as caused by WFI and WRS.{NTO,STO}) into the stepper. The stepper is the main interface to the Sail-external harness. This makes it easier to communicate wait-states to the harness, allowing the pausing of Sail execution could be made configurable. The refactor makes interrupt and exception handling more symmetrical: both are now handled in the stepper. The type related to retirement failure is now in its own file. This also removes the model-internal global instbits register into a stepper-local variable. Some stepper-specific retirement codes have been introduced that are unrelated to the execute clause; it should be possible to fix those in a less invasive refactor of the stepper.
…lator. The Wait state is exited on interrupts or if requested by the C emulator. The current implementation requests an immediate exit. This allows a wait loop to be implemented in the Sail-external harness.
This adds an option to configure the maximum steps to remain in the Wait state. This is currently only used for WFI, but the basic mechanism can be re-used for adding WRS.{STO, NTO} in the future.
a866eed
to
a633705
Compare
It is still being used. There are plans to transition it to a runtime option instead of compile time, but we definitely don't want to break compatibility with it. |
What is the recommended way of testing RVFI? I tried using CTSRD-CHERI/TestRig with |
That's a good question and another thing that should be added to CI. Right now we only test building the RVFI model in CI. |
I confirmed with TestRig that there is no RVFI regression in this PR vs master. The command used was: |
@Alasdair I tried out your suggestion to reduce the size of this PR by defining in
But this results in:
i.e. it results in both a warning and a type error. |
You would need to give the constructor a different name. |
This tries to address the issues raised in #398 and implements some ideas discussed in #412.
The first commit refactors the stepper and instruction retirement, and addresses #412.
The second adds a Wait state to the stepper and exposes it to the C emulator.
The third adds a configuration option for the max number of wait states before the Wait (for WFI) expires. This should provide a better foundation for #398.
This is an invasive and backwards-incompatible change, and so mainly submitted for discussion.
I am unsure of the effects on RVFI. Is it still being used?