关于verilog仿真“$finish”的问题
如下测试代码:`timescale1ns/1nsmoduletestbench();reg[1:0]wr,rd;reg[7:0]w_date;wire[7:0]r_dat...
如下测试代码:
`timescale 1ns/1ns
module testbench();
reg [1:0] wr,rd;
reg [7:0] w_date;
wire [7:0] r_date;
parameter DELAY = 50;
RAM RAM_0(.w_add(wr),.r_add(rd),.w_date(w_date),.r_date(r_date));
initial
begin
#DELAY wr = 2'b00; w_date = 8'b01001011;
#DELAY wr = 2'b01; w_date = 8'b01001000;
#DELAY wr = 2'b11; w_date = 8'b01011001;
#DELAY wr = 2'b10; w_date = 8'b01011011;
#DELAY rd = 2'b00;
#DELAY rd = 2'b01;
#DELAY rd = 2'b11;
#DELAY rd = 2'b01;
#DELAY rd = 2'b10;
#DELAY rd = 2'b00;
#DELAY $finish;
end
endmodule
仿真会提示“Are you sure you want to finish”选no的话仿真正常,但选yes会跳出仿真。是什么原因? 展开
`timescale 1ns/1ns
module testbench();
reg [1:0] wr,rd;
reg [7:0] w_date;
wire [7:0] r_date;
parameter DELAY = 50;
RAM RAM_0(.w_add(wr),.r_add(rd),.w_date(w_date),.r_date(r_date));
initial
begin
#DELAY wr = 2'b00; w_date = 8'b01001011;
#DELAY wr = 2'b01; w_date = 8'b01001000;
#DELAY wr = 2'b11; w_date = 8'b01011001;
#DELAY wr = 2'b10; w_date = 8'b01011011;
#DELAY rd = 2'b00;
#DELAY rd = 2'b01;
#DELAY rd = 2'b11;
#DELAY rd = 2'b01;
#DELAY rd = 2'b10;
#DELAY rd = 2'b00;
#DELAY $finish;
end
endmodule
仿真会提示“Are you sure you want to finish”选no的话仿真正常,但选yes会跳出仿真。是什么原因? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询