|
自己这段时间学习verilog,编写了一段计时模块的程序,但是编译一直有问题。程序如下:
module clock(clks,RESET,scin,mcin,madd,hadd,sout,mout,hout);
input clks,RESET,madd,hadd;
output scin,mcin;
output [5:0]sout,mout,hout;
reg scin,mcin;
reg[5:0]sout,mout,hout;
always @(posedge clks)
if(!RESET) sout<=0;
else
begin
if(sout==59)
begin
sout<=0;
scin<=0;
end
else
begin
sout<=sout+1;
scin<=0;
end
end
always @(posedge scin or posedge madd) (问题主要出在这里,如果敏感源只是posedge scin,编译就没有问题,加上posedge madd以后
编译就不能通过)
if(!RESET) mout<=0;
else
begin
if(mout==59)
begin
mout<=0;
mcin<=0;
end
else
begin
mout<=mout+1;
mcin<=0;
end
end
always @(posedge mcin or posedge hadd) (此处的问题同上面)
if(!RESET) hout<=0;
else
begin
if(hout==23) hout<=0;
else hout<=hout+1;
end
endmodule
引起出现问题的句子我在上面的程序中已经标注出来了,出现的问题为Error (10200): Verilog HDL Conditional Statement error at clock.v(25):
cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct
请大家帮我解决一下这个问题,谢谢了! |
|