Fix PMP CSR locked behavior (#2015)

This commit is contained in:
Moritz Schneider 2024-04-08 14:01:14 +02:00 committed by GitHub
parent 4f73867fce
commit 90d780eb14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1524,7 +1524,7 @@ module csr_regfile
// index is specified by the last byte in the address
automatic logic [3:0] 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+1].locked && pmpcfg_q[index].addr_mode == riscv::TOR)) begin
if (!pmpcfg_q[index].locked && !(pmpcfg_q[index+1].locked && pmpcfg_q[index+1].addr_mode == riscv::TOR)) begin
pmpaddr_d[index] = csr_wdata[CVA6Cfg.PLEN-3:0];
end
end