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.

Initial Statement in Verilog: Blocking or Non Blocking

Status
Not open for further replies.

kunal1514

Full Member level 1
Joined
Dec 13, 2006
Messages
98
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,027
Can any body tell me which is better in Initial Statement in Verilog

Blocking or Non Blocking

also in Task which is better.
 

Initial Statement

That depends upon what type of logic u want to impliment.

If u want to use the updated values which r caluculated in side the initial to compute other signals in initial,then u have to use blocking,
the same is true for both.

I think the simulator performence differs for blocking and non blocking....... comments please
 

Re: Initial Statement

If

the testcase/testbench is as such

for Initializing DUT I/P Values
initial begin
a = 0;
b = 0;
c = 0; // Use Blocking Statements
end


for writing a test case

initial begin
@(posedge CLOCK)
begin
a <= 1'b1;
b <= 1'b0; // Use Non-Blocking statements.
c <= 1'b0l;
end
 

Re: Initial Statement

The initial statement is not synthesizable. It is used only in simulation. In the testbench, initial statement is used to force the initial test cases for a simulation,ie, when the simulation starts what values the signals drive is determined by the initial statement.

It is always better to use non-blocking statements in the initial block as we want all the signals in the initial block to get their initial values when simulation starts. You can also use blocking statements to determine the order in which the signals get their initial values.
 

Initial Statement

It all depends on what u want
Sumit
 

Initial Statement

I think non-blocking is better.
All variable is assigned at the same simulation step.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top