ibex
ibex copied to clipboard
[dv,riscvdv] PMP full random test stopping after first fault
In the PMP full random test, I would like to exercise the random PMP configuration with multiple stores and load. However, the current RISCV-DV exception handler simply exits the test if the PMP entry is locked at all, which is quite likely with MML mode. Instead I would like the trap handler to continue after seeing a load/store fault to the next instruction. Only on an instruction fault do I think it is reasonable to exit the test.
estimate 16
A related issue that also has to do with the PMP trap handler is that when a PMP region is set to be non-executable. The trap handler just tries to continue with the next instruction, which makes for very slow execution (the trap handler is called for every instruction). This inevitably leads to time-outs. I think in case there is an instruction access fault due to the PMP, we should just stop the test.
The main issue with the proposed solution is that it is not clear whether the instruction at mepc is compressed or not. Both default increments of 2 and 4 bytes will have issues because Ibex supports misaligned instruction addresses.
I made the MML code entry execute and read by default to be able to continue after a store/load. In the load trap handler I check whether mepc was before main, as a way to check whether there was a load access fault inside the trap handler.
I have have a branch for RISCV-DV that has these changes, but I want to rope in https://github.com/lowRISC/ibex/issues/1742 before creating a PR
spent 8
My changes need some more testing so I am going to up the estimate from 16 to 24 so that I have an extra 8 to work on this.
There is a PR for this now: https://github.com/google/riscv-dv/pull/903 After that RISCV-DV is merged, as well as this PR: https://github.com/lowRISC/ibex/pull/1848, I need to add the changes that are currently drafted on this branch: https://github.com/marnovandermaas/ibex/tree/epmp-trap-fixes
@hcallahan-lowrisc to merge @marnovandermaas's Ibex changes
With https://github.com/lowRISC/ibex/pull/1876 this test is now behaving reasonably