I am having hard time working with systemverilog data type time.
Lets say there are two packages coming from third party.
package p1;
import p2:*;
class d;
time c;
function print();
$display("t1 is %t, t2 is %t\n", c.t1, c.t2);
c = t2 - t1;
$display("c is %t\n", c);
endfunction
endpackage : p1
package p2;
class c;
time t1;
time t2;
endclass : c
endpackage : p2
If t2 is 100ns, t1 is 10ns, c prints out 900000. Can someone tell me what might have happened with the code above? Is there a way to check the time granularity in both the packages?