设计文件与testbench区别
设计文件属于硬件描述,即采用verilog语言描述器件完整功能,testbench为模拟器件运行状态,对器件进行仿真。
器件描述/设计文件
module
接口定义:input
output
定义寄存器位数
always
endmodule
testbench:
timescale **ns/**ns
module
接口定义:reg or wire
例化端口与接口
initial
endmodule
一、重点
1,在always连续赋值语句中,被赋值的变量必须定义为reg型。
2,被例化的模块要设置名字。
3,Nativelink Error
Error: Can't launch the ModelSim-Altera software -- the path to the location of the executables for the ModelSim-Altera software were not specified or the executables were not found at specified path.
Error: You can specify the path inthe EDA Tool Options page of the Options dialog box or using the Tcl command set_user_option.
Error: NativeLink simulation flow was NOT successful
解决办法:是因为quartusII不知道你安装的modelSim软件的具体路径,所以需要设置ModelSim的具体路径即可。步骤如下(以ModelSim为例,不是ModelSim Altere):Tools -> Options -> General -> EDA Tool Options:将选项中的ModelSim设为你安装ModelSim的具体路径即可。如下图:
4,tb文件中需定义时间精度,系统时间延时,代码中引用时间延时时,需加“`”(键盘左上角)