sanjay
Full Member level 1
xilinx fpga timing problems
Hi there,
Just while trying to get outselves familar with the xilinx and spartan, we trying to implement common projects first. Everything is going fine except the timing on the device. Help would be appreciated
To give u an overview first
Project Name : Binary Up/Down counter
Device : Spartan XCS10 4pc84
Frequesncy : 25 Mhz
Tools using : Xilinx ISE Software, Synplify 7.3 ( for synthesis purposes )
Model SIm ( timing simulation )
Code :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Counter is
Generic(Delay: Time := 1000 mS);
Port (CLK: in STD_LOGIC;
RESET: in STD_LOGIC;
CE, LOAD, DIR: in STD_LOGIC;
DIN: in STD_LOGIC_VECTOR(3 downto 0);
COUNT: inout STD_LOGIC_VECTOR(3 downto 0)
);
end Counter;
architecture Behavioral of Counter is
begin
process (CLK,RESET)
begin
if RESET='1' then
COUNT <= "0000";
elsif CLK='1' and CLK'event then
if LOAD='1' then
COUNT <= DIN;
else
if CE='1' then
if DIR='1' then
COUNT <= COUNT + 1 after Delay;
-- Debugging : gives a message
report "Count Value incremented";
else
COUNT <= COUNT - 1 after Delay;
-- Debugging : gives a message
report "Count Value decremented";
end if;
end if;
end if;
end if;
end process;
end Behavioral;
This is the code.
As you might have observed we delaying the leds on the board after every 1 second.
Now everything is going on fine.. No problem
But when we run it on the development board the LEDS stay permanently On ( its counting but counting toooo fast )
We checked for following :
1.Timing Simulation : Runs perfectly the way it should. Increments or Decrements the LED after 1 second.
2.Checked timing reports. there we saw one thing which is as following
Constraint | Requested | Actual | Logic Levels
--------------------------------------------------------------------------------
TS_CLK = PERIOD TIMEGRP
"CLK" 40 nS HI | 40.000ns | 15.050ns | 4
GH 50.000000 %
--------------------------------------------------------------------------------
OFFSET = OUT 40 nS AFTER
COMP "CLK" | 40.000ns | 9.235ns | 1
--------------------------------------------------------------------------------
OFFSET = IN 40 nS BEFORE
COMP "CLK" | 40.000ns | 15.452ns | 4
--------------------------------------------------------------------------------
Seeing this report during the place and route phase it appears that somehow it instead of 40ns which is wht we require its using its own timing.
Help would be appreciated..if someone can suggest toget the ACTUAL also to 40ns
Thanks
Sanjay
Hi there,
Just while trying to get outselves familar with the xilinx and spartan, we trying to implement common projects first. Everything is going fine except the timing on the device. Help would be appreciated
To give u an overview first
Project Name : Binary Up/Down counter
Device : Spartan XCS10 4pc84
Frequesncy : 25 Mhz
Tools using : Xilinx ISE Software, Synplify 7.3 ( for synthesis purposes )
Model SIm ( timing simulation )
Code :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Counter is
Generic(Delay: Time := 1000 mS);
Port (CLK: in STD_LOGIC;
RESET: in STD_LOGIC;
CE, LOAD, DIR: in STD_LOGIC;
DIN: in STD_LOGIC_VECTOR(3 downto 0);
COUNT: inout STD_LOGIC_VECTOR(3 downto 0)
);
end Counter;
architecture Behavioral of Counter is
begin
process (CLK,RESET)
begin
if RESET='1' then
COUNT <= "0000";
elsif CLK='1' and CLK'event then
if LOAD='1' then
COUNT <= DIN;
else
if CE='1' then
if DIR='1' then
COUNT <= COUNT + 1 after Delay;
-- Debugging : gives a message
report "Count Value incremented";
else
COUNT <= COUNT - 1 after Delay;
-- Debugging : gives a message
report "Count Value decremented";
end if;
end if;
end if;
end if;
end process;
end Behavioral;
This is the code.
As you might have observed we delaying the leds on the board after every 1 second.
Now everything is going on fine.. No problem
But when we run it on the development board the LEDS stay permanently On ( its counting but counting toooo fast )
We checked for following :
1.Timing Simulation : Runs perfectly the way it should. Increments or Decrements the LED after 1 second.
2.Checked timing reports. there we saw one thing which is as following
Constraint | Requested | Actual | Logic Levels
--------------------------------------------------------------------------------
TS_CLK = PERIOD TIMEGRP
"CLK" 40 nS HI | 40.000ns | 15.050ns | 4
GH 50.000000 %
--------------------------------------------------------------------------------
OFFSET = OUT 40 nS AFTER
COMP "CLK" | 40.000ns | 9.235ns | 1
--------------------------------------------------------------------------------
OFFSET = IN 40 nS BEFORE
COMP "CLK" | 40.000ns | 15.452ns | 4
--------------------------------------------------------------------------------
Seeing this report during the place and route phase it appears that somehow it instead of 40ns which is wht we require its using its own timing.
Help would be appreciated..if someone can suggest toget the ACTUAL also to 40ns
Thanks
Sanjay