Skip to content

Commit

Permalink
Fix index calculation for locked PMP csr logic
Browse files Browse the repository at this point in the history
Fixes #1332
Superseeds #1334

co-authored-by:  Ömer Güzel <[email protected]>
Signed-off-by: Moritz Schneider <[email protected]>
  • Loading branch information
Moschn and omerguzelelectronicguy committed Aug 15, 2023
1 parent 49d1262 commit f0b2dfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/csr_regfile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0b2dfd

Please sign in to comment.