Simple clock counter says it cant be synthesized (vhdl)

Guest #4859759
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;
Guest #4859786
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
Moderator (Company: Titel) #4859811
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.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.