Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Always block with non blocking delay assignments, kill statements

Status
Not open for further replies.

anandruban

Newbie level 2
Newbie level 2
Joined
Dec 14, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,296
Hello all,
I wnat to know how to achieve a special case always block with delayed non blocking assignments. Consider the following code
`timescale 1s/1ps
always@(posedge clk)
a<=1'b1;
always@(negedge clk)
a<=#100n 1'b0;
In this code, a<=#100n 1'b0 will be executed and the change is scheduled to happen after 100n. but If the negedge of clk occurs before 100n, say it occurs 70n later than the last negedge of clk, the statement a<=#100n 1'b0 will again be executed while the previous statement is still in place. So after 30n (i.e., 100n from the last negedge of clk) the previous scheduled event will happen.
I don't want that to happen, when the next clk edge comes what ever statement that has been executed and scheduled should be killed. Is there any way to do this?

- - - Updated - - -

Hello all,
I found the solution.
always@(posedge clk)
a<=1'b1;
always@(negedge clk) begin
disable schedule
begin:schedule
a<=#100n 1'b0;
end
end
will do what I wanted.....

Thanks...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top