马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
学习写测试向量过程中遇到个问题,请各位高手指点下。
module moore_detector(
x,rst,clk,z);
input x,rst,clk;
output z;
parameter [1:0] st0=0,st1=1,st2=2,st3=3;
reg [1:0] current;
always@(posedge clk)
if (rst) current=st0;
else case(current)
st0:current<=x?st1:st0;
st1:current<=x?st1:st2;
st2:current<=x?st3:st0;
st3:current<=x?st1:st2;
default:current<=st0;
endcase
assign z=(current==st3)?1'b1:1'b0;
endmodule
module tb_moore_detector;
reg x,reset,clock;
wire z;
moore_detector MUT(x,reset,clock,z);
initial begin
clock=1'b0; x=1'b0; reset=1'b1;
end
initial #24 reset=1'b0;
initial repeat(100) #5 clock=~clock;
initial forever@(posedge clock) #3 x=$random;
initial $monitor("New state is %d and occurs at %t",MUT.cuurent,$time);
always@(z) $display("Output changes at %t to %b",$time,z);
endmodule
对tb_moore_detector.v进行仿真时,总出现这个错误:
Error: (vsim-3043) D:/Verilog/ex2/tb_moore_detector.v(19): Unresolved reference to 'cuurent' in MUT.cuurent.
也在网上搜了很多,但是没找到如何解决这个错误。
谢谢! |