VHDL error “Process clocking is too complex.”

OP (Company: none) #4967758
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;
Moderator (Company: Titel) #4967933
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?
Guest #4968378
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?
Moderator (Company: Titel) #4969271
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.

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.