Altera_Forum
Honored Contributor
13 years agoInferring FIFO in VHDL
I'm trying to write a synchronous FIFO in VHDL, and I get the following message :
Info (276007): RAM logic "sRAM" is uninferred due to asynchronous read logic I already asked google, and did some modification to my code, but without success. Here is the code :architecture arch of fifo is
type ram_t is array (0 to depth) of std_logic_vector(data_in'range);
signal sRAM : ram_t;
signal sRead_ptr : unsigned(unsigned_num_bits(depth-1)-1 downto 0) := (others => '0');
signal sWrite_ptr : unsigned(unsigned_num_bits(depth-1)-1 downto 0) := (others => '0');
begin
pRam : process(clk) is
begin
if rising_edge(clk) and EN = '1'then
if W = '1' then
sRam(to_integer(sWrite_ptr)) <= data_in;
if sWrite_ptr > to_unsigned(depth, sWrite_ptr'length) then
sWrite_ptr <= (others => '0');
else
sWrite_ptr <= sWrite_ptr + 1;
end if;
end if;
if R = '1' then
if sRead_ptr > to_unsigned(depth, sRead_ptr'length) then
sRead_ptr <= (others => '0');
else
sRead_ptr <= sRead_ptr + 1;
end if;
end if;
end if;
end process pRam;
data_out <= sRam(to_integer(sRead_ptr));
end architecture arch;How can I modify my code for quartus to infer my RAM ?