日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

$time $stime $realtime

發(fā)布時間:2023/12/15 综合教程 27 生活家
生活随笔 收集整理的這篇文章主要介紹了 $time $stime $realtime 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

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

結(jié)果:

                   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

假如將精度設(shè)置為

`timescale 10 ns / 1ps 那么,結(jié)果將是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之后,結(jié)果如下所示:

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

其他運行結(jié)果相同

總結(jié)

以上是生活随笔為你收集整理的$time $stime $realtime的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。