看板 Electronics 關於我們 聯絡資訊
: → ksmrt0123:剛用quartus試, 合成兩種assignment都有的always電路 01/01 21:12 : → ksmrt0123:沒什麼問題 01/01 21:12 : → ksmrt0123:其實應該不會合不出來 只是合出來的電路常與預期的不同 01/01 21:15 : → ksmrt0123:只要保持良好的coding style, 就不需去煩惱這些問題了 01/01 21:16 抱歉,我記錯了。 正確來說應該是,對同一reg不能一下用nonblocking、一下用blocking assignments, 大多數synthesizer不能合成。例如以下code在Xilinx ISE 8.2i會出現error Cannot mix blocking and non blocking assignments on signal <o>. module Test(o, a, b); output reg o; input a, b; always@(*) begin if(a & b) o = 0; else o <= 1; end endmodule 但這樣則沒問題: module Test(o, o2, a, b); output reg o, o2; input a, b; always@(*) begin if(a & b) begin o = 0; o2 <= 0; end else begin o = 1; o2 <= 1; end end endmodule -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.139.204.14 ※ 編輯: zxvc 來自: 220.139.204.14 (01/01 21:50)
appendixisu:推~~~ 01/03 08:32
ksmrt0123:有趣的是 上面那段code在Quartus2還是ok 01/03 22:12
ksmrt0123:個人覺得altera的作法比較好: coding style的事讓 01/03 22:13
ksmrt0123:linter或是user自己楚理就好 compiler無須涉入太深 01/03 22:14