|
|
|
|
|
|
|
|
|
|
|
|
Time Literals
|
|
|
Time is written in integer or fixed point format, followed without a space by a time unit. The time literal is interpreted as a realtime value scaled to the current time unit and rounded to the current time precision. Following are time literals examples. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example - Time Literals
|
|
|
|
|
|
1 `timescale 100ps/10ps
2 module time_literals ();
3
4 time a;
5 initial begin
6 $monitor ("@ %g a = %t", $time, a);
7 #1 a = 1ns;
8 #1 a = 0.2ns;
9 #1 a = 300ps;
10 #1 $finish;
11 end
12
13 endmodule
You could download file time_literals.sv here
|
|
|
|
|
|
Simulator Output
|
|
|
|
|
|
@ 0 a = 0
@ 1 a = 100
@ 2 a = 20
@ 3 a = 30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|