pmps working for RVVI in RV32

This commit is contained in:
Jordan Carlin 2024-11-13 22:12:11 -08:00
parent d666a0dd7b
commit 14e9a39523
No known key found for this signature in database

View File

@ -124,11 +124,13 @@ module wallyTracer import cvw::*; #(parameter cvw_t P) (rvviTrace rvvi);
if(valid) begin if(valid) begin
// machine CSRs // machine CSRs
// PMPCFG space is 0-15 3a0 - 3af // PMPCFG space is 0-15 3a0 - 3af
int inc = P.XLEN == 32 ? 4 : 8;
int i, i4, i8, csrid; int i, i4, i8, csrid;
logic [P.XLEN-1:0] pmp; logic [P.XLEN-1:0] pmp;
for (i=0; i<P.PMP_ENTRIES; i+=8) begin
for (i=0; i<P.PMP_ENTRIES; i+=inc) begin
i4 = i / 4; i4 = i / 4;
i8 = (i / 8) * 8; i8 = (i / inc) * inc;
pmp = 0; pmp = 0;
pmp |= testbench.dut.core.priv.priv.csr.csrm.PMPCFG_ARRAY_REGW[i8+0] << 0; pmp |= testbench.dut.core.priv.priv.csr.csrm.PMPCFG_ARRAY_REGW[i8+0] << 0;
pmp |= testbench.dut.core.priv.priv.csr.csrm.PMPCFG_ARRAY_REGW[i8+1] << 8; pmp |= testbench.dut.core.priv.priv.csr.csrm.PMPCFG_ARRAY_REGW[i8+1] << 8;