Hello to all of you,
I'm new to VHDL and I'm trying to understand how it works but I get to have a little problem. I'm trying to make the data memory for a processor. The ADDRESS consists of 32 bits but only 12 of them are used. When I write this code:
addr := ADDRESS(11 downto 0) ;
MEMORY(TO_INTEGER(UNSIGNED(addr))) <= DATA_W(7 downto 0);
everything is all right. But when I try to align the address and write:
addr := ADDRESS(11 downto 2) & "00" ;
MEMORY( TO_INTEGER(UNSIGNED(addr))) <= DATA_W(7 downto 0);
I keep getting this warning:
Warning: 790: Index value does not match array range, simulation mismatch
Can anyone explain what happens and it doesn't work?
Thank you in advance
I'm new to VHDL and I'm trying to understand how it works but I get to have a little problem. I'm trying to make the data memory for a processor. The ADDRESS consists of 32 bits but only 12 of them are used. When I write this code:
addr := ADDRESS(11 downto 0) ;
MEMORY(TO_INTEGER(UNSIGNED(addr))) <= DATA_W(7 downto 0);
everything is all right. But when I try to align the address and write:
addr := ADDRESS(11 downto 2) & "00" ;
MEMORY( TO_INTEGER(UNSIGNED(addr))) <= DATA_W(7 downto 0);
I keep getting this warning:
Warning: 790: Index value does not match array range, simulation mismatch
Can anyone explain what happens and it doesn't work?
Thank you in advance