Regd. time unit in the set_timeout() call

Need some clarification on the time value passed to uvm_top.set_timeout() call.
I want to use this feature to terminate the sim when it fails to finish before 1ms, and when I add the line,
initial uvm_top.set_timeout(1ms); in the top module and run the sim, it terminates at 1000ns instead of 1ms with the fatal error,

UVM_FATAL @1000.000ns: reporter.*Explicit timeout of 1000.000ns hit, indicating a probable testbench issue.

If I set the time value in ps unit as in set_timeout(1.0e9), it works. Any idea?

In reply to my_mgva:
Use set_timeout(1ms/1ps);
See set_global_timeout() doesn't obey time units | Verification Academy

In reply to dave_59:

In reply to my_mgva:
Use set_timeout(1ms/1ps);
See Set_global_timeout() doesn't obey time units - OVM - Verification Academy

Hi Dave,

One query.

set_timeout() should be sensitive to the time unit provided because it takes the argument as data type “time”.

*function void set_timeout(time timeout, bit overridable = 1)
*

My expectation is if input is provided with a unit(4ms), it should run for that much time irrespective of timescale set in testbench. Am I missing something?

In my test, set_timeout(4ms) is present. Test bench has timescale of 1fs/1fs. Because of this, 4ms is working as 4us. If I change this to set_timeout(4ms/1ps) as you have suggested, it might work. But, if any other test bench has other timescales, then it needs to be changed again. In this way, it will be test bench timescale dependent. How to make this independent of timescale?

Thanks,
Prasad

In reply to psubudhi:

There is nothing special about the time data type; it is just a 64-bit unsigned integer. Please read the link to the other question.