I faced an issue where the simulation hangs because of the following scenario (Note the real variable called var1 is not initialized anywhere)
module m1;
real var1;
bit clk =0;
always begin
#(1e5/var);
clk = ~clk;
end
endmodule
After a quick investigation, I found out that the #(value/0) is evaluated as zero in the # context and is evaluated as 0 or x regarding 2-state or 4-state context it exists. so the clk is toggling too slow (I believe with delay equals the precision which is the smallest simulation time). This causes the simulation to propagate with extremely small time so it takes too long to reach the next evaluation which is scheduled after a large time compared to the delay inside the mentioned always block.
Please correct my interpretation of the described scenario or confirm it. Also, I need to know if the division on zero behavior is defined in the SystemVerilog standard or depends on the simulator implementation.
Thanks in advance,
Hennawy