Skip to content

Commit

Permalink
[rtl] Make PMP CSRs illegal in non PMP configurations (#155)
Browse files Browse the repository at this point in the history
The previous behaviour was also acceptable but this matches spike.

Co-authored-by: Greg Chadwick <[email protected]>
  • Loading branch information
davideschiavone and GregAC authored Sep 26, 2023
1 parent cb3c4a4 commit d2a1be8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rtl/cve2_cs_registers.sv
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,16 @@ module cve2_cs_registers #(
illegal_csr = 1'b1;
end
endcase

if (!PMPEnable) begin
if (csr_addr inside {CSR_PMPCFG0, CSR_PMPCFG1, CSR_PMPCFG2, CSR_PMPCFG3,
CSR_PMPADDR0, CSR_PMPADDR1, CSR_PMPADDR2, CSR_PMPADDR3,
CSR_PMPADDR4, CSR_PMPADDR5, CSR_PMPADDR6, CSR_PMPADDR7,
CSR_PMPADDR8, CSR_PMPADDR9, CSR_PMPADDR10, CSR_PMPADDR11,
CSR_PMPADDR12, CSR_PMPADDR13, CSR_PMPADDR14, CSR_PMPADDR15}) begin
illegal_csr = 1'b1;
end
end
end

// write logic
Expand Down

0 comments on commit d2a1be8

Please sign in to comment.