虚拟机:VMware-workstation-full-14.0.0.24051
环 境:ubuntu 18.04.1
应用工具:VCS(verilog compiled simulator,编译型代码仿真器)
一、学习内容
二、设计的测试与验证
- 一般需要 编 写 测 试 文 件对设计进行仿真测试,称为testbench
- testbench一般采用 行 为 级描述,产生一定的输入激励,得到设计的输出响应,并检查输出结果的正确性
- 在规范的模块设计中,每一个模块都需要编写独立的测试文件对模块进行充分的测试
- 应该选择合适的输入激励,保证测试能够覆盖典型输入和特殊输入
【例】
三、思考和小结
(1)思考
- 搭一个tb
module sample_latch(clk, rstn, din, dout);
input clk, rstn;
input [3:0] din;
output [3:0] dout;
reg [3:0] data;
assign dout = data;
always @(clk or rstn) begin
if(!rstn) begin
data <= 4’b0;
end
else if(clk) begin
data <= din;
end
end
endmodule
(2)小结
作者:xlinxdu
版权:本文版权归作者所有
转载:未经作者允许,禁止转载,转载必须保留此段声明,必须在文章中给出原文连接。