刚入门的朋友编写了一个简单的程序,出现如下问题:
module blocking( din, //数据输入信号 dout //数据输出信号 ); input din; output dout; wire din; reg dout; //数据缓冲 reg [1:0] temp; always @(din) begin dout=temp[1]; temp[0]=din; temp[1]=temp[0]; endmodule Warning (10235): Verilog HDL Always Construct warning at blocking.v(15): variable "temp" is read inside the Always Construct but isn't in the Always Construct's Event Control
程序编译完全通过,出现警告。
警告的意思:变量temp 在always 语句中总是读,但是没有在always的敏感变量中。
解决方案:always @(din,temp)
always模块要求所有的敏感变量都要出现在@后面,避免锁存器出现!
|