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 on ebreak instructions #289

Merged
merged 5 commits into from
Mar 18, 2022

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Mar 14, 2022

This PR modifies the CPU's exception logic.

Whenever a software breakpoint exception is raised (ebreak or c.ebreak instruction), the CPU now clears mtval CSR. The pre-PR hardware copied the address of the according instruction from PC into mtval, which is redundant (the address is also available in mepc) and also no longer required to comply with the spec:

RISC-V Machine ISA version 1.12:

Software breakpoint exceptions are permitted to write either 0 or the PC to xtval.


Since we are using the default riscv-arch-test repo we now need to modify the "golden reference" for the according ISA tests. This is unpretty, but inevitable right now.

In the far future the isa-test RISC-V architecture tests might be removed and superseded by the new RISCOF-based verification framework.

@stnolting stnolting added risc-v compliance Modification to comply with official RISC-V specs. HW hardware-related labels Mar 14, 2022
@stnolting stnolting self-assigned this Mar 14, 2022
@stnolting stnolting marked this pull request as ready for review March 15, 2022 05:02
@stnolting stnolting merged commit 0b45074 into main Mar 18, 2022
@stnolting stnolting deleted the zero_mtval_on_ebreak branch March 18, 2022 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW hardware-related risc-v compliance Modification to comply with official RISC-V specs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant