G
Gerry
Guest
Hi
I have a strange bug in my simulation and cant figure out the error.
I have a simple ram that contains data that should be read as described
in the following process:
PROC_ram : process (clk)
begin
if (clk'event and clk = '1') then
-- memory write:
if (ew_cp0 = '1') then
ram(conv_integer(unsigned(rw_addr_cp0))) <= data_in_cp0;
end if;
if (rst = '0') then -- optional reset
data_out_cp0 <= (others => '0');
else
data_out_cp0 <= ram(conv_integer(unsigned(rw_addr_cp0)));
end if;
end if;
end process PROC_ram;
The problem that I have is, that the data is output with a delay of one
cycle. So when I check the waveforms I see that on a rising edge of the
clock the address changes to one for instance, but the data is still
read from memory position zero...
Anyone an idea what could be wrong here?
Many thanks!
I have a strange bug in my simulation and cant figure out the error.
I have a simple ram that contains data that should be read as described
in the following process:
PROC_ram : process (clk)
begin
if (clk'event and clk = '1') then
-- memory write:
if (ew_cp0 = '1') then
ram(conv_integer(unsigned(rw_addr_cp0))) <= data_in_cp0;
end if;
if (rst = '0') then -- optional reset
data_out_cp0 <= (others => '0');
else
data_out_cp0 <= ram(conv_integer(unsigned(rw_addr_cp0)));
end if;
end if;
end process PROC_ram;
The problem that I have is, that the data is output with a delay of one
cycle. So when I check the waveforms I see that on a rising edge of the
clock the address changes to one for instance, but the data is still
read from memory position zero...
Anyone an idea what could be wrong here?
Many thanks!