Verilog:Cannot matchオペランド(s)条件下の閉じたイベントコントロールの対応するエッジは常にエラー解決を構築します.

1089 ワード

always @(negedge rstn or posedge sec_clk) begin
    if(~rstn)
        led1 = ~led1;
    else
        led1 = 1;
end
データテーブルから分かるように、CycloneIVFPGAにはクロックが多すぎるので、テストのために作成されたLEDシンチレーションコードであることを大体理解してみましょう.
"Cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct"
エラーとともにQuartusでは合成されていません.
無言で検索した結果です.
https://stackoverflow.com/questions/52232515/cannot-match-operands-in-the-condition-to-the-corresponding-edges-in-the-enclo
前述したように、Coding Conventionを守らないと、Verilogコンパイラは誤った論理と誤解する可能性があります.
慣例に従って、
Combinational Logicは=を使用します.
Synchronous Logicの場合、ブロックする必要はありません.<=を使用することをお勧めします.
always @(negedge rstn or posedge sec_clk) begin
    if(~rstn)
        led1 <= ~led1;
    else
        led1 <= 1;
end
代わりに、解決しました.