EmbDev.net

Forum: FPGA, VHDL & Verilog VHDL error “Process clocking is too complex.”


von Rocking S. (Company: none) (suanhaas)


Rate this post
useful
not useful
Hello everyone I recently started coding in VHDL(code here is of T flip 
flop) and I'm having an error which says "Process clocking is too 
complex", and this is with the first code attached below and 
surprisingly I the solution too. But I don't know how it worked, code 
without error is Second code. I googled about the error for half hour 
but couldn't find the satisfying reason. Please help.

First code:
1
LIBRARY ieee;
2
USE ieee.std_logic_1164.all;
3
4
ENTITY t_ff IS
5
    PORT(t,clk,rst:IN STD_LOGIC;
6
         q,q_bar:OUT STD_LOGIC);
7
END t_ff;
8
9
ARCHITECTURE t_ff OF t_ff IS
10
SIGNAL temp: STD_LOGIC;
11
BEGIN
12
    PROCESS(clk,rst)
13
    BEGIN
14
        IF(clk='1' AND clk'event)THEN
15
            IF(t='1')THEN temp<= NOT temp;
16
            END IF;
17
        ELSIF(rst='1')THEN temp<='0';
18
        END IF;
19
        q<= temp;
20
        q_bar<= NOT temp;
21
    END PROCESS;
22
END t_ff;

Second code:
1
LIBRARY ieee;
2
USE ieee.std_logic_1164.all;
3
4
ENTITY t_ff IS
5
    PORT(t,clk,rst:IN STD_LOGIC;
6
         q,q_bar:OUT STD_LOGIC);
7
END t_ff;
8
9
ARCHITECTURE t_ff OF t_ff IS
10
SIGNAL temp: STD_LOGIC;
11
BEGIN
12
    PROCESS(clk,rst)
13
    BEGIN
14
        IF(rst='1')THEN temp<='0';
15
        ELSIF(clk='1' AND clk'event)THEN
16
            IF(t='1')THEN temp<= NOT temp;
17
            END IF;
18
        END IF;
19
        q<= temp;
20
        q_bar<= NOT temp;
21
    END PROCESS;
22
END t_ff;

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


Rate this post
useful
not useful
Rocking S. wrote:
> I'm having an error which says "Process clocking is too complex"
What part of the toolchain reports that error?

Rocking S. wrote:
> code without error is Second code
So the problem is in the order of clock and reset in the first one. And 
with a closer look it's easy to see: you want a flipflop where the clock 
is dominant against the reset. There is no such component inside a FPGA. 
To get synthesizable code you must write it in a way the synthesizer is 
able to transform to hardware.

BTW: do you know a flipflop with such a behavior at all?

: Edited by Moderator
von Rocking sharma (Guest)


Rate this post
useful
not useful
> BTW: do you know a flipflop with such a behavior at all?

No, but as I wrote earlier I just started learning VHDL so I was trying 
out few things. Yes I know I'm trying stupid things. But hey can you 
tell me how should I start learning this language?

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


Rate this post
useful
not useful
The best way is to look how others did it. And to look for the 
synthesizers manual. Because out of the 100% VHDL running well on a 
simulator only about 5% will be synthesizable.
So, VHDL for FPGA is much different than VHDL for simulation. The first 
one is about 5% of the second one.

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.