Skip to content

Commit

Permalink
Fix issue when NrPMPEntries=0
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelaGonzalezMarino authored Nov 8, 2024
1 parent 4619a67 commit 59cbe19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/csr_regfile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ module csr_regfile
// TO_BE_COMPLETED - PERF_COUNTERS
output logic perf_we_o,
// PMP configuration containing pmpcfg for max 64 PMPs - ACC_DISPATCHER
output riscv::pmpcfg_t [CVA6Cfg.NrPMPEntries-1:0] pmpcfg_o,
output riscv::pmpcfg_t [(CVA6Cfg.NrPMPEntries > 0 ? CVA6Cfg.NrPMPEntries-1 : 0):0] pmpcfg_o,
// PMP addresses - ACC_DISPATCHER
output logic [CVA6Cfg.NrPMPEntries-1:0][CVA6Cfg.PLEN-3:0] pmpaddr_o,
output logic [(CVA6Cfg.NrPMPEntries > 0 ? CVA6Cfg.NrPMPEntries-1 : 0):0][CVA6Cfg.PLEN-3:0] pmpaddr_o,
// TO_BE_COMPLETED - PERF_COUNTERS
output logic [31:0] mcountinhibit_o,
// RVFI
Expand Down Expand Up @@ -291,8 +291,8 @@ module csr_regfile
| (CVA6Cfg.XLEN'(CVA6Cfg.NSX) << 23) // X - Non-standard extensions present
| ((CVA6Cfg.XLEN == 64 ? 2 : 1) << CVA6Cfg.XLEN - 2); // MXL

assign pmpcfg_o = pmpcfg_q[CVA6Cfg.NrPMPEntries-1:0];
assign pmpaddr_o = pmpaddr_q[CVA6Cfg.NrPMPEntries-1:0];
assign pmpcfg_o = pmpcfg_q[(CVA6Cfg.NrPMPEntries > 0 ? CVA6Cfg.NrPMPEntries-1 : 0):0];
assign pmpaddr_o = pmpaddr_q[(CVA6Cfg.NrPMPEntries > 0 ? CVA6Cfg.NrPMPEntries-1 : 0):0];

riscv::fcsr_t fcsr_q, fcsr_d;
// ----------------
Expand Down

0 comments on commit 59cbe19

Please sign in to comment.