程序中有错误,我确定它是由始终模块中的negedge iChang
引起的。错误是:程序中的组合循环
节点零时钟振荡.......检查组合环路的设计或矢量源文件。
我的部分程序如下:
input clk, rst,iChang;
[email protected](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
如果我在always
块取出negedge iChang
和if(!iChang)
块,不会有任何错误。我不明白negedge iChang
和组合循环之间的关系。似乎没有反馈会导致组合循环。
'iChang'从哪里来? – Unn 2014-12-02 16:39:07
这是一个输入(按钮),用于触发始终阻止 – 2014-12-02 16:47:56