Verilog Combinational Loop - Help Required

Status
Not open for further replies.

davidgrm

Full Member level 4
Joined
Apr 8, 2006
Messages
233
Helped
31
Reputation
62
Reaction score
10
Trophy points
1,298
Activity points
2,727
combinational loop

Hi

Why would this code cause a combinational loop on Delay?

always @(clk)
begin
if(!CPU_WR || !FPGA_WR)
begin
Delay <= 2'b10;
end
else
begin
Delay <= Delay - 1'b1;
end
end
 

combinational loop in verilog

It's not clocked on an edge. So a register is not created. Choose a positive or negative edge for the clock.

Without a clock edge, the following is a combinational loop:

Delay <= Delay - 1'b1;
 
Reactions: brxue

    brxue

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…