Support handling gemmini exceptions through gemmini instruction return values #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All gemmini instruction (except for flush) now have a return value, which indicates the status of gemmini at the time the instruction is issued. This allows the software to support handling gemmini exceptions at the user-level.
If wdata == 0, everything is going fine, there are no pending exceptions.
If wdata != 0, gemmini has a pending exception. While gemmini has a pending instructions, any issued instruction to gemmini returns wdata, without actually issuing into the accelerator. LSB of wdata indicates type of the exception, while the rest of the bits indicates the bad address.
Upon issuing any gemmini instruction, check wdata for the error case. If error, jump into the gemmini exception "handler", handle the exception, then attempt to reissue the instruction which just reported an error. This provides the illusion of precise exceptions.
gemmini_fence
now also checks for pending exceptions, and handles them.These changes should have no effect on software which is compiled without the flag
GEMMINI_XCPT_DEBUG
, as that flag disables all checks of the status value. Software withGEMMINI_XCPT_DEBUG
is tolerant to page faults, but slower, and as such is meant to be used to debug page faults on gemmini.