1.

What Is The Difference Between Initial Block And Final Block?

Answer»

There are many difference between initial and final block. I am listing the few differences that is coming to MIND now.

  1. The most obvious ONE : Initial blocks get executed at the beginning of the simulation, final block at the end of simulation
  2. Final block has to be executed in zero time, which implies it can't have any delay, WAIT, or non-blocking ASSIGNMENTS. Initial block doesn't have any such restrictions of execution in zero time (and can have delay, wait and non-blocking statements)

Final block can be used to display statistical/genaral INFORMATION regarding the status of the execution like this:-

1.final begin
2.$display("Simulation Passed");
3.$display("Final value of xyz = %h",xyz);
4.$display("Bye :: So long, and Thanks for all the fishes");
5.end

There are many difference between initial and final block. I am listing the few differences that is coming to mind now.

Final block can be used to display statistical/genaral information regarding the status of the execution like this:-

1.final begin
2.$display("Simulation Passed");
3.$display("Final value of xyz = %h",xyz);
4.$display("Bye :: So long, and Thanks for all the fishes");
5.end



Discussion

No Comment Found