FPGA编译错误: Verilog HDL Conditional Statement error at test.v(43): cannot match operand(s)

关于Error (10200): Verilog HDL Conditional Statement error at test.v(43): cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct问题

代码1如下:
always @(posedge clk or negedge rst )
begin
if(!rst)
Num<=8’d0;
else
begin
if(Num<8’d255)
Num<=Num+8’d1;

	else
	Num<=8'd0;
end	

end

always @(posedge clk or negedge rst )
begin
if(!rst)
cnt<=4’d0;
else
begin
if(cnt==4’d15)begin
Fre<=~Fre;
cnt<=4’d0;
end
else
cnt<=cnt+4’d1;
end
end

always @(posedge Fre or negedge rst)
begin
if(Fre)
DOUT<=Num;
end
编译正常,仿真波形如下:
FPGA编译错误: Verilog HDL Conditional Statement error at test.v(43): cannot match operand(s)
代码2如下:
always @(posedge clk or negedge rst )
begin
if(!rst)
Num<=8’d0;
else
begin
if(Num<8’d255)
Num<=Num+8’d1;

	else
	Num<=8'd0;
end	

end

always @(posedge clk or negedge rst )
begin
if(!rst)
cnt<=4’d0;
else
begin
if(cnt==4’d15)begin
Fre<=~Fre;
cnt<=4’d0;
end
else
cnt<=cnt+4’d1;
end
end

always @(negedge Fre or negedge rst)
begin
if(!Fre)
DOUT<=Num;
end
编译正常,仿真波形如下:
FPGA编译错误: Verilog HDL Conditional Statement error at test.v(43): cannot match operand(s)
代码3如下、
always @(posedge Fre or negedge rst)
begin
if(!Fre)
DOUT<=Num;
end
编译错误;

代码4如下:
always @(negedge Fre or negedge rst)
begin
if(Fre)
DOUT<=Num;
end
编译错误;

触发信号边沿条件需与条件语句对应;

上一篇:iframe中使用模态框提交表单后,iframe加载父页面的解决方法


下一篇:FPGA工程师进阶必学:时序分析的基本步骤和整体设计思路