ibex icon indicating copy to clipboard operation
ibex copied to clipboard

[dv,pmp] Generating large NAPOT regions

Open marnovandermaas opened this issue 2 years ago • 1 comments

At the moment RISCV-DV generates addresses randomly including when the PMP encoding is set to NAPOT. Since the NAPOT range is encoded in the address, it means that it is unlikely that we will generate larger regions, since these require a series of ones at the end of the address (see Table 3.11 in the RISC-V privileged spec).

We should constrain RISCV-DV full randomization to first randomly select a random range and then randomly generate the top bits of the address to create more coverage.

Coverage points for this should be added to the coverage plan and implemented

estimate 8

marnovandermaas avatar Aug 02 '22 13:08 marnovandermaas

Add a sentence about adding coverage for this, shouldn't be complex given the rest of the PMP stuff is already there so didn't alter the estimate.

GregAC avatar Aug 03 '22 13:08 GregAC

I made a first attempt to adding coverage points for large NAPOT regions: https://github.com/lowRISC/ibex/pull/1818 In the process I removed some impossible to reach PMP coverage: https://github.com/lowRISC/ibex/pull/1817

spent 3

marnovandermaas avatar Sep 28 '22 10:09 marnovandermaas

It took me a while to find out that the Spike version I was using didn't compile because xrun gave a vague error.

Besides that I updated the PR https://github.com/lowRISC/ibex/pull/1818 based on suggestions from @ctopal.

spent 4

marnovandermaas avatar Oct 03 '22 16:10 marnovandermaas

There is a PR for RISCV-DV, which generates these large NAPOT regions now: https://github.com/google/riscv-dv/pull/903

marnovandermaas avatar Oct 13 '22 16:10 marnovandermaas