[rtl] Make PMP CSRs illegal in non PMP configurations (#155)

The previous behaviour was also acceptable but this matches spike.

Co-authored-by: Greg Chadwick <gac@lowrisc.org>
This commit is contained in:
Davide Schiavone 2023-09-26 18:23:17 +02:00 committed by GitHub
parent cb3c4a4bf4
commit d2a1be82ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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