A
ALuPin
Hi,
I have generated a FIFO with output registers and one without
output registers. (Altera QuartusII MegaWizardManager)
And yet when simulating both in Modelsim(functional simulation)I get
the same result: The data appear on the output of the FIFO immediately
after asserting the rdreq.
Any ideas what could be wrong ?
Here is my testbench code:
ibrary ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity tb_fifo_test_unregistered is
end tb_fifo_test_unregistered;
architecture testbench of tb_fifo_test_unregistered is
component fifo_test_unregistered
port ( Data : in std_logic_vector(8 downto 0);
Wrreq : in std_logic;
Rdreq : in std_logic;
Clock : in std_logic;
Aclr : in std_logic;
Q : out std_logic_vector(8 downto 0)
);
end component;
signal t_data : std_logic_vector(8 downto 0);
signal t_wrreq : std_logic;
signal t_rdreq : std_logic;
signal t_clock : std_logic;
signal t_clock2 : std_logic;
signal t_aclr : std_logic;
signal t_q : std_logic_vector(8 downto 0);
begin
uut : fifo_test_unregistered
port map ( Data => t_data,
Wrreq => t_wrreq,
Rdreq => t_rdreq,
Clock => t_clock2,
Aclr => t_aclr,
Q => t_q
);
process
begin
t_clock <= '1'; wait for 5.5 ns;
t_clock <= '0'; wait for 5.5 ns;
end process;
process
begin
t_clock2 <= '0'; wait for 5.5 ns;
t_clock2 <= '1'; wait for 5.5 ns;
end process;
process
begin
t_aclr <= '1', '0' after 103 ns;
wait;
end process;
process
begin
t_data <= (others => '0');
t_wrreq <= '0';
t_rdreq <= '0';
for i in 0 to 40 loop
wait until rising_edge(t_clock);
end loop;
for i in 0 to 31 loop
wait until rising_edge(t_clock);
t_wrreq <= '1';
t_data <= conv_std_logic_vector(i+1, 9);
end loop;
t_wrreq <= '0';
for i in 0 to 10 loop
wait until rising_edge(t_clock);
end loop;
for i in 0 to 31 loop
wait until rising_edge(t_clock);
t_rdreq <= '1';
wait until rising_edge(t_clock);
t_rdreq <= '0';
wait until rising_edge(t_clock);
end loop;
t_rdreq <= '0';
wait;
end process;
end testbench;
I have generated a FIFO with output registers and one without
output registers. (Altera QuartusII MegaWizardManager)
And yet when simulating both in Modelsim(functional simulation)I get
the same result: The data appear on the output of the FIFO immediately
after asserting the rdreq.
Any ideas what could be wrong ?
Here is my testbench code:
ibrary ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity tb_fifo_test_unregistered is
end tb_fifo_test_unregistered;
architecture testbench of tb_fifo_test_unregistered is
component fifo_test_unregistered
port ( Data : in std_logic_vector(8 downto 0);
Wrreq : in std_logic;
Rdreq : in std_logic;
Clock : in std_logic;
Aclr : in std_logic;
Q : out std_logic_vector(8 downto 0)
);
end component;
signal t_data : std_logic_vector(8 downto 0);
signal t_wrreq : std_logic;
signal t_rdreq : std_logic;
signal t_clock : std_logic;
signal t_clock2 : std_logic;
signal t_aclr : std_logic;
signal t_q : std_logic_vector(8 downto 0);
begin
uut : fifo_test_unregistered
port map ( Data => t_data,
Wrreq => t_wrreq,
Rdreq => t_rdreq,
Clock => t_clock2,
Aclr => t_aclr,
Q => t_q
);
process
begin
t_clock <= '1'; wait for 5.5 ns;
t_clock <= '0'; wait for 5.5 ns;
end process;
process
begin
t_clock2 <= '0'; wait for 5.5 ns;
t_clock2 <= '1'; wait for 5.5 ns;
end process;
process
begin
t_aclr <= '1', '0' after 103 ns;
wait;
end process;
process
begin
t_data <= (others => '0');
t_wrreq <= '0';
t_rdreq <= '0';
for i in 0 to 40 loop
wait until rising_edge(t_clock);
end loop;
for i in 0 to 31 loop
wait until rising_edge(t_clock);
t_wrreq <= '1';
t_data <= conv_std_logic_vector(i+1, 9);
end loop;
t_wrreq <= '0';
for i in 0 to 10 loop
wait until rising_edge(t_clock);
end loop;
for i in 0 to 31 loop
wait until rising_edge(t_clock);
t_rdreq <= '1';
wait until rising_edge(t_clock);
t_rdreq <= '0';
wait until rising_edge(t_clock);
end loop;
t_rdreq <= '0';
wait;
end process;
end testbench;