$time $stime $realtime
1,$time
The $time system function returns an integer that is a 64-bit time, scaled to the timescale unit of the module that invoked it.
1 `timescale 10 ns / 1 ns
2 module test;
3 reg set;
4 parameter p = 1.55;
5 initial begin
6 $monitor($time,,"set=",set);
7 #p set = 0;
8 #p set = 1;
9 end
10 endmodule
结果:
0 set=x
2 set=0
3 set=1
V C S S i m u l a t i o n R e p o r t
Time: 32 ns
分析:
a) The simulation times 16 ns and 32 ns are scaled to 1.6 and 3.2 because the time unit for the module is 10 ns; therefore, time values reported by this module are multiples of 10 ns.
b) The value 1.6 is rounded to 2, and 3.2 is rounded to 3 because the $time system function returns an integer. The time precision does not cause rounding of these values
因为精度是1ns,1.55*10=15.5ns,四舍五入,取16ns
假如将精度设置为
`timescale 10 ns / 1ps 那么,结果将是15.5和31
2,$stime
The $stime system function returns an unsigned integer that is a 32-bit time, scaled to the timescale unit of the module that invoked it. If the actual simulation time does not fit in 32 bits, the low order 32 bits of the current simulation time are returned.
对于$time的example,$stime和$time是一样的。
3,$realtime
The $realtime system function returns a real number time that, like $time, is scaled to the time unit of the module that invoked it.
将上述example改为$realtime之后,结果如下所示:
0 set=x
1.6 set=0
3.2 set=1
V C S S i m u l a t i o n R e p o r t
Time: 32 ns
其他运行结果相同
随机推荐
- 聊一聊开闭原则(OCP).
目录 简述 最早提出(梅耶开闭原则) 重新定义(多态开闭原则) 深入探讨 OCP的两个特点 对外扩展开放(Open for extension) 对内修改关闭 抽象 关闭修改.对外扩展? 简述 在面向 ...
- Spirit带你彻底了解事件捕获和冒泡机制
Dom标准事件模型 在Dom标准事件模型中,事件是先进行捕获,达到目标阶段时,在进行冒泡的 捕获阶段==>目标阶段==>冒泡阶段 目标元素和非目标元素 在介绍事件捕获和事件冒泡前 我们先要 ...
- Azure 实践(4)- CI/CD .netcore项目Docker构建及部署
上篇已介绍了.netcore项目构建的相关步骤,本篇继续完善 1.什么是CI/CD CI/CD 中的"CI"始终指持续集成,它属于开发人员的自动化流程.成功的 CI 意味着应用代码 ...
- 数据库删除discuz 部分数据操作
如何快速清理discuz 3.2 中等待审核的回复数:pre_forum_post_moderate,点击清空 清空回收站的主题帖:DELETE FROM `pre_forum_thread` WHE ...
- Shell系列(27)- 条件判断之两个整数比较
两个整数之间比较 Liunx中,都是字符型,但是加了数值比较的选项,所以自动将他们转换成了整数型进行比较,不需要对这些参数进行变量转换或者重新声明 测试选项 作用 整数1 -eq 整数2 判断整数1是 ...
- linux帐户安全管理与技巧
实验环境 CentosOS5.6试验台. 任务一:建立与删除普通用户账户,管理组 1)创建一个新用户user1 useradd user1 查看用户是否创建成功 2)创建一个新组group1 grou ...
- ubuntu提示:无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用)
root@uni-virtual-machine:/home/uni# apt install apt-transport-https ca-certificates curl software-pr ...
- 代码扫描利器sonarqube
sonar的作用 1.代码质量和安全扫描和分析平台. 2.多维度分析代码:代码量.安全隐患.编写规范隐患.重复度.复杂度.代码增量.测试覆盖率等. 3.支持25+编程语言的代码扫描口分析,包含java ...
- jquery 设置django全局token
通过JQUEYR中的ajaxSetup,来设置django中的token,即不需要再每次都去引用: 第一步: 先django中的html中设置 {% csrf_token %} 第二步: 新一个js ...
- vm 将宿主机文件夹 映射至 虚拟机
一.关于centos如何安装(自行百度) 二.设置共享文件夹 添加共享文件夹(关闭虚拟机时操作) 虚拟机->设置->选项->共享文件夹 三.安装vm-tools (请用root用户执 ...