Error/Warning 來源:https://hdlbits.01xz.net/wiki/ 題目:
1、Quartus Warning 10235:
Warning (10235): Verilog HDL Always Construct warning at FM_mod.v(23): variable "carry_freq" is read inside the Always Construct but isn't in the Always Construct's Event Control
Warning原因:由於always過程塊敏感列表中未完全包含過程塊中使用的所有變量;
常見來源:常見於組合邏輯的always過程塊中;
解決方法:將always過程塊中的敏感列表改為 ‘ * ’ | 將敏感列表改為邊沿觸發;
2、邏輯表達式中的括號:
正確:
module fadd_correct( input a, b, cin, output cout, sum ); assign sum = a ^ b ^ cin; assign cout = (a & b) | ((a ^ b) & cin); endmodule
錯誤:
module fadd_wrong( input a, b, cin, output cout, sum ); assign sum = a ^ b ^ cin; assign cout = (a & b) | (a ^ b & cin); endmodule