mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-23 21:57:33 -04:00
[pmp] constrain ADDR read-back for available modes
This commit is contained in:
parent
769799f1be
commit
b66d510dcd
1 changed files with 8 additions and 4 deletions
|
@ -224,14 +224,18 @@ begin
|
|||
begin
|
||||
addr_rd(i) <= (others => '0');
|
||||
addr_rd(i)(XLEN-1 downto pmp_lsb_c-2) <= csr.addr(i)(XLEN-1 downto pmp_lsb_c-2);
|
||||
if (granularity_c = 8) then -- bit G-1 reads as zero in TOR or OFF mode
|
||||
if (granularity_c = 8) and TOR_EN then -- bit G-1 reads as zero in TOR or OFF mode
|
||||
if (csr.cfg(i)(cfg_ah_c) = '0') then -- TOR/OFF mode
|
||||
addr_rd(i)(pmp_lsb_c) <= '0';
|
||||
end if;
|
||||
elsif (granularity_c > 8) then
|
||||
addr_rd(i)(pmp_lsb_c-2 downto 0) <= (others => '1'); -- in NAPOT mode bits G-2:0 must read as one
|
||||
if (csr.cfg(i)(cfg_ah_c) = '0') then -- TOR/OFF mode
|
||||
addr_rd(i)(pmp_lsb_c-1 downto 0) <= (others => '0'); -- in TOR or OFF mode bits G-1:0 must read as zero
|
||||
if NAP_EN then
|
||||
addr_rd(i)(pmp_lsb_c-2 downto 0) <= (others => '1'); -- in NAPOT mode bits G-2:0 must read as one
|
||||
end if;
|
||||
if TOR_EN then
|
||||
if (csr.cfg(i)(cfg_ah_c) = '0') then -- TOR/OFF mode
|
||||
addr_rd(i)(pmp_lsb_c-1 downto 0) <= (others => '0'); -- in TOR or OFF mode bits G-1:0 must read as zero
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end process address_read_back;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue