版主: 51FPGA |
dreamjsc
![]()
最后登陆时间:2012-06-04 16:42:28 |
timescale
在Verilog HDL 模型中,所有时延都用单位时间表述。使用`timescale编译器指令将时间单位与实际时间相关联。该指令用于定义时延的单位和时延精度。`timescale编译器指令格式为: `timescale time_unit / time_precision 表示时延单位为1ns, 时延精度为100ps。`timescale 编译器指令在模块说明外部出现, 并且影响后面所有的时延值。例如: `timescale 1ns/ 100ps and # (5.22, 6.17 ) Al (Z, A, B); 编译器指令定义时延以ns为单位,并且时延精度为1/10 ns(100 ps)。因此,时延值5.22对应5.2 ns, 时延6.17对应6.2 ns。如果用如下的`timescale程序指令代替上例中的编译器指令, `timescale 10ns/1ns 那么5.22对应52ns, 6.17对应62ns。 `timescale 1ns/ 100ps and # (5.22, 6.17 ) Al (Z, A, B); `timescale 10ns/ 1ns initial 在这个例子中,每个模块都有自身的`timescale编译器指令。`timescale编译器指令第一次应用于时延。因此,在第一个模块中,5.22对应5.2 ns, 6.17对应6.2 ns; 在第二个模块中5.21对应52 ns, 10.4对应104 ns, 15对应150 ns。如果仿真模块TB,设计中的所有模块最小时间精度为100 ps。因此,所有延迟(特别是模块TB中的延迟)将换算成精度为100 ps。延迟52 ns现在对应520*100 ps,104对应1040*100 ps,150对应1500*100 ps。更重要的是,仿真使用100 ps为时间精度。如果仿真模块AndFunc,由于模块TB不是模块AddFunc的子模块,模块TB中的`timescale程序指令将不再有效。 关键词:分享 verilog 系统 函数 timescal |
![]() 大山里的娃儿。
此贴由dreamjsc于2011-03-30 12:33:26最后编辑
|
|
共1条 1/1 1 |