lint warning: Detected unload(unconected) net
lint warning: Detected unload(unconected) net
当某个变量定义赋值后,未被使用时,lint会报这个warning;但有时我们使用了该变量,依然可能报这个warning;如下所示:
always@(posedge clk or negedge rst_n)
if(!rst_n)
a <= ‘d0;
else if(clr)
a <= ‘d0;
else if(cur_state== 15)
a <= ‘d1;
assign o_b = cur_state== 3 & !a;
若 cur_state在代码中的取值范围是(0,12)即从代码角度分析,cur_state== 15不成立;则A == 0恒成立;lint软件可能会将assign o_b = cur_state== 3 & !a
优化为assign o_b = cur_state== 3
;
从而报warning: Detected unload(unconected) net a, a在代码里虽然连接到了输出端口o_b,但被优化掉了,因此依然会报这个warning