From 306973a386ae36418262c963f716e8a7d26e9e6a Mon Sep 17 00:00:00 2001 From: Moritz Schneider Date: Tue, 15 Aug 2023 11:29:31 +0200 Subject: [PATCH] Fix index calculation for locked PMP csr logic (#1335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1332 Superseeds #1334 Signed-off-by: Moritz Schneider Co-authored-by: Ömer Güzel --- core/csr_regfile.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/csr_regfile.sv b/core/csr_regfile.sv index c28af66226..71e217fccb 100644 --- a/core/csr_regfile.sv +++ b/core/csr_regfile.sv @@ -872,7 +872,7 @@ module csr_regfile import ariane_pkg::*; #( // index is specified by the last byte in the address automatic int index = csr_addr.csr_decode.address[3:0]; // check if the entry or the entry above is locked - if (!pmpcfg_q[index].locked && !(pmpcfg_q[index].locked && pmpcfg_q[index].addr_mode == riscv::TOR)) begin + if (!pmpcfg_q[index].locked && !(pmpcfg_q[index+1].locked && pmpcfg_q[index].addr_mode == riscv::TOR)) begin pmpaddr_d[index] = csr_wdata[riscv::PLEN-3:0]; end end