Observed Behavior
With mseccfg.MML=1 and mseccfg.RLB=0, Ibex suppresses pmpcfg writes that set L=1 and X=1 even when the resulting entry does not create a valid executable PMP rule.
The default test writes pmpcfg0=0x84, which requests L=1, A=OFF, and X=1. The write is ignored and the test reads back:
observed: 0x00008c00
expected: 0x00008c84
The G=1 variant writes L=1, X=1, and A=NA4. Ibex first converts NA4 to OFF, then suppresses the write in the same way.
The invalid-TOR variant writes an entry with A=TOR, L=1, and X=1, but with pmpaddr[i-1] >= pmpaddr[i]. The test reads back:
observed: 0x000e009c
expected: 0x000e8c9c
Expected Behavior
Ibex should accept these writes because A=OFF does not create a PMP rule, and a TOR entry with pmpaddr[i-1] >= pmpaddr[i] matches no addresses.
The MML restriction should suppress only a write that adds a valid M-mode-only or locked Shared-Region rule with executable privileges. The L bit should remain writable for an OFF entry.
Steps to Reproduce
- Run
./evidence/run_ibex_core_pmp_mml_off_entry.sh.
- The assembly enables
mseccfg.MML, writes pmpcfg0, reads it back, and stores the result.
- Repeat with
./evidence/run_ibex_core_pmp_mml_off_entry.sh program_g1_invalid_na4.S.
- Repeat with
./evidence/run_ibex_core_pmp_mml_off_entry.sh program_invalid_tor.S.
- Observe that all three writes are suppressed and the readback differs from the requested configuration.
The test intentionally exits through $fatal when the observed readback does not match the expected value.
program.zip
Testbench
evidence/ibex_core_pmp_mml_off_entry_tb.sv
Environment
Ibex source revision: 57d37bf9008640415532d23ad59018b795c642aa.
The test uses Verilator and the real ibex_core with PMPEnable=1. The default case uses PMPGranularity=0; the NA4 variant uses PMPGranularity=1.
The expected rule definition follows the RISC-V Smepmp specification.
Observed Behavior
With
mseccfg.MML=1andmseccfg.RLB=0, Ibex suppressespmpcfgwrites that setL=1andX=1even when the resulting entry does not create a valid executable PMP rule.The default test writes
pmpcfg0=0x84, which requestsL=1,A=OFF, andX=1. The write is ignored and the test reads back:The G=1 variant writes
L=1,X=1, andA=NA4. Ibex first converts NA4 to OFF, then suppresses the write in the same way.The invalid-TOR variant writes an entry with
A=TOR,L=1, andX=1, but withpmpaddr[i-1] >= pmpaddr[i]. The test reads back:Expected Behavior
Ibex should accept these writes because
A=OFFdoes not create a PMP rule, and a TOR entry withpmpaddr[i-1] >= pmpaddr[i]matches no addresses.The MML restriction should suppress only a write that adds a valid M-mode-only or locked Shared-Region rule with executable privileges. The
Lbit should remain writable for an OFF entry.Steps to Reproduce
./evidence/run_ibex_core_pmp_mml_off_entry.sh.mseccfg.MML, writespmpcfg0, reads it back, and stores the result../evidence/run_ibex_core_pmp_mml_off_entry.sh program_g1_invalid_na4.S../evidence/run_ibex_core_pmp_mml_off_entry.sh program_invalid_tor.S.The test intentionally exits through
$fatalwhen the observed readback does not match the expected value.program.zip
Testbench
Environment
Ibex source revision:
57d37bf9008640415532d23ad59018b795c642aa.The test uses Verilator and the real
ibex_corewithPMPEnable=1. The default case usesPMPGranularity=0; the NA4 variant usesPMPGranularity=1.The expected rule definition follows the RISC-V Smepmp specification.