发表于
2008-5-9 20:34:54
`timescale是Verilog HDL 中的一种时间尺度预编译指令,它用来定义模块的仿真时的时间单位和时间精度。格式如下:
`timescale 仿真时间单位/时间精度
注意:用于说明仿真时间单位和时间精度的数字只能是1、10、100,不能为其它的数字。而且,时间精度不能比时间单位还要大。最多两则一样大。比如:下面定义都是对的:
`timescale 1ns/1ps
`timescale 100ns/100ns
下面的定义是错的:
`timescale 1ps/1ns
时间精度就是模块仿真时间和延时的精确程序,比如:定义时间精度为10ns,那么时序中所有的延时至多能精确到10ns,而8ns或者18ns是不可能做到的。
下面举个简单的例子说明一下:
`timescale 100ns / 10ns
module muti_delay(
din,
dout1
);
input din;
output dout1;
wire din;
reg dout1;
always @(din)
#3.14 dout1 = din;