Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get system time in VCS

Is there way to get system time in VCS/UVM ? I am looking for something similar to Perl's localtime(time). Is there way to print system time for every uvm_info printed ?

like image 517
Jean Avatar asked Jan 10 '23 17:01

Jean


1 Answers

One way is to use $system() to run any system command, including system' date command.

initial
 begin
    $system("date");
 end

From IEEE 1800 LRM:

$system makes a call to the C function system(). The C function executes the argument passed to it as if the argument was executed from the terminal. $system can be called as either a task or a function. When called as a function, it returns the return value of the call to system() with data type int. If $system is called with no string argument, the C function system() will be called with the NULL string.

Also, see here.

like image 86
Ari Avatar answered Jan 31 '23 17:01

Ari