mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-22 12:57:13 -04:00
[rtl] Fix PMP NAPOT matching for 0 PMPGranularity
This commit is contained in:
parent
d315c38527
commit
6a61e0ec0c
1 changed files with 7 additions and 2 deletions
|
@ -64,8 +64,13 @@ module ibex_pmp #(
|
|||
// ^
|
||||
// | This bit pos is the top of the mask, all lower bits set
|
||||
// thus mask = 1111 0000
|
||||
assign region_addr_mask[r][b] = (csr_pmp_cfg_i[r].mode != PMP_MODE_NAPOT) |
|
||||
~&csr_pmp_addr_i[r][b-1:PMPGranularity+1];
|
||||
if (PMPGranularity == 0) begin : g_region_addr_mask_zero_granularity
|
||||
assign region_addr_mask[r][b] = (csr_pmp_cfg_i[r].mode != PMP_MODE_NAPOT) |
|
||||
~&csr_pmp_addr_i[r][b-1:2];
|
||||
end else begin : g_region_addr_mask_other_granularity
|
||||
assign region_addr_mask[r][b] = (csr_pmp_cfg_i[r].mode != PMP_MODE_NAPOT) |
|
||||
~&csr_pmp_addr_i[r][b-1:PMPGranularity+1];
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue