initial begin #d set = 0; $display(“%f set0”,$realtime); #d set = 1; $display(“%f set1”,$realtime);
end
endmodule
But set0 and set1 are printed at 1.600000ns and 3.200000ns respectively. So its not clear how the delay values are computed based on timeunit. Please help me understand this.
Those $display statements do not print the “ns” units, you have added them in your head incorrectly. $time and $realtime return values scaled to the timeunit of the current scope.
Use %t and $timescale to get values printed in a common timeunit.