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

[rtl] set 'mtval' CSR to zero if illegal instruction exception #409

Merged
merged 10 commits into from
Sep 11, 2022

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Sep 10, 2022

This PR modifies the behavior of the mtval CSR (trap value register).

⚠️ In case of an illegal instruction exception mtval is set to zero now. Previously, it was written with the (de-compressed) 32-bit instruction word. However, the faulting instruction word can be retrieved by performing a load operation using the mepc CSR as address. Hence, this PR removes certain redundancies to reduce area requirements.

✔️ This simplification is explicitly allowed by the RISC-V priv. specs.

@stnolting stnolting added HW hardware-related SW software-related labels Sep 10, 2022
@stnolting stnolting self-assigned this Sep 10, 2022
@stnolting stnolting added the optimization Make things faster, smaller and more efficient label Sep 10, 2022
@stnolting stnolting marked this pull request as ready for review September 10, 2022 21:47
@stnolting stnolting merged commit 16cc7b8 into main Sep 11, 2022
@stnolting stnolting deleted the mtval_csr_cleanup branch September 11, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW hardware-related optimization Make things faster, smaller and more efficient SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant