在 VCS 中获取系统时间 [英] Get system time in VCS

查看:39
本文介绍了在 VCS 中获取系统时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 VCS/UVM 中获取系统时间?我正在寻找类似于 Perl 的 localtime(time) 的东西.有没有办法为每个打印的 uvm_info 打印系统时间?

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 ?

推荐答案

一种方法是使用 $system() 来运行任何系统命令,包括 system' date 命令.

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

initial
 begin
    $system("date");
 end

来自 IEEE 1800 LRM:

$system 调用 C 函数 system().C 函数执行传递给它的参数,就像参数被执行一样从终端.$system 可以作为任务或功能.当作为函数调用时,它返回对数据类型为 int 的 system() 的调用.如果 $system 被调用而没有字符串参数,将使用 NULL 调用 C 函数 system()字符串.

$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.

此外,请参阅此处.

这篇关于在 VCS 中获取系统时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆