ibex icon indicating copy to clipboard operation
ibex copied to clipboard

[dv,riscvdv] PMP full random test stopping after first fault

Open marnovandermaas opened this issue 3 years ago • 1 comments

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

marnovandermaas avatar Aug 19 '22 14:08 marnovandermaas

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.

marnovandermaas avatar Sep 02 '22 16:09 marnovandermaas

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.

marnovandermaas avatar Oct 05 '22 14:10 marnovandermaas

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

marnovandermaas avatar Oct 10 '22 16:10 marnovandermaas

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.

marnovandermaas avatar Oct 10 '22 16:10 marnovandermaas

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

marnovandermaas avatar Oct 13 '22 16:10 marnovandermaas

@hcallahan-lowrisc to merge @marnovandermaas's Ibex changes

GregAC avatar Oct 25 '22 09:10 GregAC

With https://github.com/lowRISC/ibex/pull/1876 this test is now behaving reasonably

GregAC avatar Nov 01 '22 08:11 GregAC