In reply to srikanth_6313:
i tried that using the below “code 1” but nothing appeared on the result with no errors and no warnings.
also i tried the below “code 2” using timeunit 1ns; and timeprecision 1ps; but also gave no results, i mean be no results that the $display function not return anything in the transcript
//code 1
`timescale 1ns/1ps
module timing;
initial begin
$timeformat(-9, 3, "ns", 8);
#1.0ns $display("%t", $realtime); // 1.000ns
#2.0ns $display("%t", $realtime); // 3.000ns
#0.1ns $display("%t", $realtime); // 3.100ns
#41ps $display("%t", $realtime); // 3.141ns
end
endmodule
//code 2
module timing;
timeunit 1ns;
timeprecision 1ps;
initial begin
$timeformat(-9, 3, "ns", 8);
#1 $display("%t", $realtime); // 1.000ns
#2ns $display("%t", $realtime); // 3.000ns
#0.1ns $display("%t", $realtime); // 3.100ns
#41ps $display("%t", $realtime); // 3.141ns
end
endmodule