Altera_Forum
Honored Contributor
12 years agoOne Register of an array will not reset
I've created a register array (8x9) in VHDL and I'm resetting registers 6-0 in one process and register 7 in another. The problem is register 7 is not being recognized as getting reset and this causes the compiler to optimize all the registers out. ModelSim shows the problem so I'm sure the problem is controlling the contents of register 7 but I can't see the problem in the code. I've reduced the code to the absolute minimum below. Any thoughts would be appreciated.
Thanks
library IEEE;use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
Entity FIFO_TEMP is port(
DATA_IN: in STD_LOGIC_VECTOR(8 downto 0);
DATA_OUT: out STD_LOGIC_VECTOR(8 downto 0);
-- WORD_RDY: out STD_LOGIC;
-- FIFO_FULL: out STD_LOGIC;
-- WORD_RD: in STD_LOGIC;
-- WORD_WR: in STD_LOGIC;
RESET_N: in STD_LOGIC;
SYS_CLK: in STD_LOGIC);
end FIFO_TEMP;
Architecture FIFOXN of FIFO_TEMP is
type Register_Array is array(7 downto 0) of STD_LOGIC_VECTOR(8 downto 0);
signal Fifo: Register_Array;
signal New_Word: STD_LOGIC_VECTOR(2 downto 0);
signal Wd_Latch: STD_LOGIC;
Begin
process(SYS_CLK, Fifo, RESET_N)
begin
if RESET_N ='0' then
for i in 6 downto 0 loop
Fifo(i) <= (others =>'0');
end loop;
New_Word <= "111";
end if;
end process;
process (SYS_CLK, RESET_N, Fifo)
begin
if RESET_N ='0' then
Fifo(7) <="000000000";
Wd_Latch <= '0';
end if;
end process;
end FIFOXN;