[ibex/rtl] Fix pmpaddr write enable signal

Updates the write enable for `pmpaddr[i]` CSRs to deny writes if
`pmpcfg[i+1].lock == 1` and `pmpcfg[i+1].mode == TOR`, as per the
spec.
This commit is contained in:
Udi 2020-07-28 17:35:44 -07:00 committed by udinator
parent ac51db259d
commit 7eaf0e4a6e

View file

@ -825,7 +825,7 @@ module ibex_cs_registers #(
// --------------------------
if (i < PMPNumRegions - 1) begin : g_lower
assign pmp_addr_we[i] = csr_we_int & ~pmp_cfg[i].lock &
(pmp_cfg[i+1].mode != PMP_MODE_TOR) &
(~pmp_cfg[i+1].lock | (pmp_cfg[i+1].mode != PMP_MODE_TOR)) &
(csr_addr == (CSR_OFF_PMP_ADDR + i[11:0]));
end else begin : g_upper
assign pmp_addr_we[i] = csr_we_int & ~pmp_cfg[i].lock &