-
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
Remove instbits
and extend Retired
enum
#412
Comments
Whilst I agree that the global is ugly, I disagree that your proposal is a better fit for the architectural specification. Architecturally, illegal instruction is just another exception, and so should follow the exact same path as other exceptions. Which I think means what you really want is that all exception cases are RETIRE_FAIL(exception_details), with the top level then being responsible for the exception handling, passing on the extra state needed, including instbits for illegal instructions. |
Good call, that does sound better and I guess would let you treat other exceptions in the same way (I'll have to double check the code though). I don't think |
Sorry I should have been clearer: instbits would be supplied to handle_exception to use in the case that the execute clause returned Exc_Illegal_Inst (names entirely made up, any semblance to real names is coincidental). Or, to put it another way: yes, that's what I meant, I just failed to clearly communicate it. |
I'm also in favour of extending the There is another important case: Sdtrig debug triggers (https://github.com/riscv/riscv-debug-spec). One way to implement is to centralise trigger handling uniformly in Extending |
The eventual goal here is to surface wait-states of the hart (e.g. as caused by WFI and WRS.{NTO,STO}) into the stepper, and handle debug triggers from execution for extensions such as Sdtrig. The refactor makes interrupt and exception handling more symmetrical: both are now handled in the stepper. This also removes the model-internal global instbits register into a stepper-local variable, which fixes riscv#412. This refactor is based on ideas discussed in riscv#398 and riscv#412. Co-authored-by: Tim Hutt <timothy.hutt@codasip.com> Co-authored-by: Jessica Clarke <jrtc27@jrtc27.com> Co-authored-by: Alasdair Armstrong <alasdair.armstrong@cl.cam.ac.uk>
Currently there's a global register:
Which is saved after fetch:
And used in
handle_illegal()
:This use of a global is unnecessary. It would be more elegant to:
instbits
register.RETIRE_ILLEGAL
to theRetire
enum.handle_illegal(); RETIRE_FAIL
to justRETIRE_ILLEGAL
instbits
as a parameter tohandle_illegal()
.handle_illegal(...)
fromstep()
ifretired == RETIRE_ILLEGAL
.The text was updated successfully, but these errors were encountered: