刚学编写testbench ,用的是ISE。程序如下:
`timescale 1ns / 1ps
module counter_tb;
// Inputs
reg clk;
reg rst_n;
reg inEn;
// Outputs
wire [7:0] counter;
// Instantiate the Unit Under Test (UUT)
counter uut (
.clk(clk),
.rst_n(rst_n),
.inEn(inEn),
.counter(counter)
);
initial begin
// Initialize Inputs
clk = 1;
rst_n = 1;
inEn = 0;
// Wait 100 ns for global reset to finish
#100;
forever
#50 clk=~clk;
// Add stimulus here
end
endmodule
就是一个简单的计数器仿真验证。testbench程序大部分是系统生成的,我自己写的也就是initial begin到end那一小段。可是无论是调用modelsim还是ISE自己的仿真器,clk都是一点变化没有,一直是初始值。这个是什么原因呢?