程序中有一个错误,我确定它是由negedge iChangalways 块引起的。错误是:
节点中的零时振荡......检查组合环的设计或矢量源文件。
我的部分程序如下:
input clk, rst,iChang;
always@(posedge clk or negedge rst or negedge iChang)
begin
if(!iChang)//auto mode,serious problems!!!!!!!!!!!!!!!!!!
begin
if(!rst)
begin
s1<=state1;
A<=3'b0;
B<=3'b0;
count1<=3'd4;
count2<=3'd2;
count3<=3'd3;
count4<=3'd2;
temp<=1'b1;
end
else
begin
if(temp==1)
begin
temp<=1'b0;
case(s1)
state1:
begin
times<=count1;
A<=3'b001;
B<=3'b100;
s1<=state2;
end
state2:
begin
times<=count2;
A<=3'b010;
B<=3'b100;
s1<=state3;
end
state3:
begin
times<=count3;
A<=3'b100;
B<=3'b001;
s1<=state4;
end
state4:
begin
times<=count4;
A<=3'b100;
B<=3'b010;
s1<=state1;
end
default:
begin
A<=3'b000;
B<=3'b000;
end
endcase
end
如果我negedge iChang在always块和if(!iChang)块中删除,将不会有错误。我不明白 thenegedge iChang和组合循环之间的关系。似乎没有反馈会导致组合循环。