-
Notifications
You must be signed in to change notification settings - Fork 227
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
RVFI INSTR IF - Heed clicptr
in is_instr_bus_valid
#2565
base: cv32e40x/dev
Are you sure you want to change the base?
RVFI INSTR IF - Heed clicptr
in is_instr_bus_valid
#2565
Conversation
Signed-off-by: Robin Pedersen <[email protected]>
@@ -275,6 +276,10 @@ interface uvma_rvfi_instr_if_t | |||
|
|||
asm_t instr_asm; | |||
|
|||
wire is_exception_cause_instr_acc_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_ACC_FAULT); | |||
wire is_exception_cause_integrity_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_INTEGRITY_FAULT); | |||
wire is_exception_cause_bus_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_BUS_FAULT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Having one single token (instead of 8) makes it easier to reason about the boolean expression (for is_instr_bus_valid) that combines all of these 3 boolean expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Maybe put in a comment to that effect.
!is_exception_cause_integrity_fault && | ||
!is_exception_cause_instr_acc_fault | ||
) || | ||
rvfi_trap.clicptr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is the primary change. rvfi_trap.clicptr
can now "make the instr valid after all".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment.
Nice @silabs-robin. I'll hold off on the Approval until you've removed the "draft" lablel. |
This PR amends
uvma_rvfi_instr_if
, making sureis_instr_bus_valid
considersrvfi_trap.clicptr
.Relevant
clicptr
spec:https://docs.openhwgroup.org/projects/cv32e40x-user-manual/en/latest/rvfi.html#compatibility
"rvfi_trap.clicptr is set for CLIC pointers. CLIC pointers are only reported on RVFI when they get an exception during fetch."
Test status:
ci_check
- Passed ✅Background:
Here is the assert that failed before: a_mintstatus_mil_decrease_intended.
It required an
mret
in a certain situation, but the RVFI instr if claimed that there was nomret
because of an "instruction access fault". (The fault was on the pointer fetch, but the mret itself was fine.)