Skip to content

Commit

Permalink
Fix pmpaddr read logic considering G=2 (#2469)
Browse files Browse the repository at this point in the history
fixes #2465
  • Loading branch information
Moschn authored Oct 23, 2024
1 parent 53472eb commit 21dc824
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 21dc824

Please sign in to comment.