ibex
ibex copied to clipboard
[dv] Consider explicit PMP fail/pass checking
Our currently co-simulation setup checks all memory accesses, ensuring both Spike and the RTL do the same byte accesses in the same order.
When a load or store generates a PMP failure no memory access occurs, thus nothing is checked.
It is implicitly checked because both RTL and Spike need to enter the exception handler so if the RTL fails to generate the PMP error for instance a co-simulation mismatch will occur.
However bus errors (an access returns an error response) trigger the same exception handler (same mcause). If the RTL let an access occur that should see a PMP failure and that access sees a bus error we'll still get a mismatch because that access will be cross checked against Spike (which won't have generated the mismatch).
So I don't think we'd miss PMP bugs with our current setup but some may prove tricky to debug.
Some explicit check that captures PMP failures and ensures spike sees the same PMP failure may be prudent. How simple would it be to implement? What changes (if any) would be required from Spike?
@ctopal @marnovandermaas @hcallahan-lowrisc FYI. I don't think we need to worry about this for now, but a future enhancement we should consider later.