W
woko
Guest
Hi Folks!
I got a real strange problem in my virtex2 FPGA. The hole thing is an
image processing unit and the FPGA does the digital part of the image
capture.
The piece of code I have trouble is a reset of the video-input FIFO,
which is should be activated by the CPU setting the "iCnt_rst" signal.
I want to delay the reset of the FIFO for at least one line which does
the "Dly" signal and end the reset by the falling edge of the Hsync.
I would like to have it all synchron to the "iV_clk".
Most of the time the code works how it should, but sometimes I can see
a falling edge of sMan_rst, far away of any edge on sHsync (sHsync =
1). There is input-FF on sHsync, so I should see it go low for one
clock cycle if I route it to a testpoint, but it stays high!
We had some unexpected behaviour before due to glitches on clocks and
other noises, but how can this behaviour be explained?
Thanks!
Wolfgang Kopp
-------------------------------------------
pHsync_reg: process (iReset, iV_clk)
begin
if (iReset = '1') then
sHsync_reg <= sHsync;
elsif rising_edge (iV_clk) then
sHsync_reg <= sHsync;
end if;
end process;
pMan_rst: process (iReset, iV_clk)
begin
if (iReset = '1') then
sMan_rst <= '1';
Dly <= '0';
elsif rising_edge (iV_clk) then
if (iCnt_rst = '1') then
sMan_rst <= '1';
Dly <= '0';
elsif (sHsync = '0' and sHsync_reg = '1') then
if (Dly = '1') then
sMan_rst <= '0';
end if;
Dly <= '1';
end if;
end if;
end process;
I got a real strange problem in my virtex2 FPGA. The hole thing is an
image processing unit and the FPGA does the digital part of the image
capture.
The piece of code I have trouble is a reset of the video-input FIFO,
which is should be activated by the CPU setting the "iCnt_rst" signal.
I want to delay the reset of the FIFO for at least one line which does
the "Dly" signal and end the reset by the falling edge of the Hsync.
I would like to have it all synchron to the "iV_clk".
Most of the time the code works how it should, but sometimes I can see
a falling edge of sMan_rst, far away of any edge on sHsync (sHsync =
1). There is input-FF on sHsync, so I should see it go low for one
clock cycle if I route it to a testpoint, but it stays high!
We had some unexpected behaviour before due to glitches on clocks and
other noises, but how can this behaviour be explained?
Thanks!
Wolfgang Kopp
-------------------------------------------
pHsync_reg: process (iReset, iV_clk)
begin
if (iReset = '1') then
sHsync_reg <= sHsync;
elsif rising_edge (iV_clk) then
sHsync_reg <= sHsync;
end if;
end process;
pMan_rst: process (iReset, iV_clk)
begin
if (iReset = '1') then
sMan_rst <= '1';
Dly <= '0';
elsif rising_edge (iV_clk) then
if (iCnt_rst = '1') then
sMan_rst <= '1';
Dly <= '0';
elsif (sHsync = '0' and sHsync_reg = '1') then
if (Dly = '1') then
sMan_rst <= '0';
end if;
Dly <= '1';
end if;
end if;
end process;