请问我下面的语句老是编译不通过:
always @(posedeg clk or negedge rest or posedge rest)
begin
if(clk)
c<=0;
else
c<=1;
end
编译的时候,他说什么if-else dont match any list edge
请问这是为什么啊?还有就是
我改成:always@(edge rest)
begin
.......
end
她同样报错,还请多多执教,谢谢!!!
我主要是想在实现:clk的上升沿c=0
rest的边沿c=1
在另一个always中对c进行判断处理
还情指教!!
rest信号和clk信号的到来都是不定的。只知道clk只有当rest为高的时候才会有。到rest为低的时候就没有了。至于clk在rest为高的时候什么来clk也是不定的,但知道大约150us左右,clk=1m。
我现在想在rest来上升沿的时候,currentstate<=idle,在rest为高的阶段,clk上升沿来的时候,currentstate<=nextstate;我是这样实现的:
always @(posedge rfclk or posedge startrx)
begin
if(rfclk)
currentstate<=nextstate;
else
currentstate<=idle;
end
可是编译的时候出现如下的错误提示:
if-else statement does not match any sensitivity list edge.
我改成如下
always @(posedge rfclk or posedge startrx)
if(rfclk)
currentstate<=nextstate;
else
currentstate<=idle;
也报同样的错误,还请多多执教,帮帮忙!!!