EmbDev.net

Forum: FPGA, VHDL & Verilog Simple clock counter says it cant be synthesized (vhdl)


von Crim (Guest)


Rate this post
useful
not useful
Hello there, when trying to synthesize that code i get the following 
error from ise
 ERROR:Xst:827 -  line 18: Signal count cannot be synthesized, bad 
synchronous description. The description style you are using to describe 
a synchronous element (register, memory, etc.) is not supported in the 
current software release.

do you have any idea why that happens ?
here is the code
1
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
5
entity alt_clock is
6
  generic (time1 : integer:=3);
7
  port(clk,rst: in std_logic;
8
       
9
       
10
       done: out std_logic);
11
end alt_clock;
12
13
architecture aarch of alt_clock is
14
15
16
17
begin
18
P0:process(clk) -- this is the line 18
19
  variable count :integer range time1 downto 0;
20
  begin 
21
    if clk'event and clk='1' and rst='1' then
22
      count:=0;
23
      done<='0';
24
    elsif clk'event and clk='1' and rst='0' then
25
      if count<time1 then
26
        count:=count+1;
27
        done<='0';
28
      elsif count=time1 then
29
        done<='1';
30
        count:=0;
31
      else null;
32
      end if;
33
      
34
    end if;
35
36
37
38
39
end process;
40
41
42
end aarch;

von Donni D. (Guest)


Rate this post
useful
not useful
are you sure you want to have a syncron reset? If so, make one clk'event 
and in there a if rst=x then...
Also every signal which you read in a process should be in the process 
sensitivity list.
And why declare an integer from three to zero? I count numbers ascending

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Crim wrote:
> Hello there, when trying to synthesize that code i get the following
> error from ise
Have a look in the Synthesizers User Guide. In it you find how you must 
write your VHDL code to get  your desired components.
If you don't find your specific way of description, then the synthesizer 
cannot translate it to hardware.

If your case the problem is the "double clock". This way of description 
you can find nowhere...

BTW: forget variables fir the first weeks doing VHDL. They usually 
behave different than you expect.

: Edited by Moderator
von Crim (Guest)


Rate this post
useful
not useful
Thanks a lot everyone :)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.