What are the difference between the always
keyword (not the always @
block) and forever
keyword in Verilog HDL?
always #1 a=!a;
forever #1 a=!a;
Here are my findings but I can't still quite draw the line between the two:
From Wikipedia:
The always keyword acts similar to the "C" construct while(1) {..} in the sense that it will execute forever.
From electroSofts:
The forever instruction continuously repeats the statement that follows it. Therefore, it should be used with procedural timing controls (otherwise it hangs the simulation).
Could someone give a clearer explanation on this? Thank you!