This is a small program I found on the web for timescale
`timescale 1ns/100ps
module tscale();
time a;
initial
begin
a = 0;
#1 a = 1ns;
#1 a = 5ns;
#1 a = 20;
#5 a = 100;
end
initial
begin
$monitor("%t a=%t",$time,a);
end
endmodule
This is the output I am getting
0 a= 0
10 a= 10
20 a= 50
30 a= 200
80 a= 1000
I was expecting the %t to be printed as 0,1,2,3 and 8 since time unit is 1ns but not sure why I am getting 0,10,20,30 and 80
also when assigning a=1ns why does the simulator print the value as 10? can someone clarify? Thanks