Skip to content

Conversation

@jerryz123
Copy link
Collaborator

@jerryz123 jerryz123 commented Dec 12, 2020

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 with GEMMINI_XCPT_DEBUG is tolerant to page faults, but slower, and as such is meant to be used to debug page faults on gemmini.

@jerryz123 jerryz123 requested a review from alonamid December 12, 2020 06:01
@jerryz123
Copy link
Collaborator Author

This appears to be a larger change than reality because my editor removed trailing whitespace from gemmini.h.

@jerryz123 jerryz123 changed the title [WIP] Handle gemmini exceptions through gemmini instruction return values Support handling gemmini exceptions through gemmini instruction return values Dec 17, 2020
@jerryz123 jerryz123 requested a review from hngenc December 17, 2020 18:41
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.

1 participant