synthesizable counter with delay

Status
Not open for further replies.

Hallolo

Newbie level 3
Joined
Apr 1, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,307
Hi

what is a synthesizable form of : counter_out <= #12 counter_out + 1;
in verilog HDL, where i intend to replace 12 by generic code that performs a count and hold for some number of clock cycles.

Thanks
 

that probably isn't what you want. synthesis will ignore the time delay.
always@(posedge clk) begin // also add the resets, not shown here.
x <= (x == 12) ? 1 : x+1;
y <= (x == 12) ? y+1 : y;
end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…