1
0
SEm-Labos/Libs/AhbLite/hdl/ahbDecoder_RTL.vhd

20 lines
486 B
VHDL
Raw Permalink Normal View History

2024-02-23 13:01:05 +00:00
LIBRARY AhbLite;
USE AhbLite.ahbLite.all;
ARCHITECTURE RTL OF ahbDecoder IS
BEGIN
decodeAddress: process(hAddr)
variable mask: unsigned(hAddr'range);
begin
hSel <= (others => '0');
for index in hSel'range loop
mask := to_unsigned(ahbMemoryLocation(index).addressMask, mask'length);
if (hAddr and mask) = ahbMemoryLocation(index).baseAddress then
hSel(index) <= '1';
end if;
end loop;
end process decodeAddress;
END ARCHITECTURE RTL;