Skip to content

Commit

Permalink
Fix pmpaddr read logic considering G=2
Browse files Browse the repository at this point in the history
fixes #2465
  • Loading branch information
Moschn committed Oct 9, 2024
1 parent fea98c6 commit a82bc6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/csr_regfile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ module csr_regfile
// -> last bit of pmpaddr must be set 0/1 based on the mode:
// NA4, NAPOT: 1
// TOR, OFF: 0
if (pmpcfg_q[index].addr_mode[1] == 1'b1 || pmpcfg_q[index].addr_mode == 'h0)
csr_rdata = pmpaddr_q[index][CVA6Cfg.PLEN-3:0];
if (pmpcfg_q[index].addr_mode[1] == 1'b1)
csr_rdata = {pmpaddr_q[index][CVA6Cfg.PLEN-3:1], 1'b1};
else csr_rdata = {pmpaddr_q[index][CVA6Cfg.PLEN-3:1], 1'b0};
end
default: read_access_exception = 1'b1;
Expand Down

0 comments on commit a82bc6b

Please sign in to comment.