1. 程式人生 > >Verilog常見錯誤集錦

Verilog常見錯誤集錦

說明:本文內容來自網路

1.Error (10028): Can't resolve multiple constant drivers for net ……

解析:不能在兩個以上always內對同一變數賦值,這個細節一般看書看資料會看到,但是程式設計時,就是沒想到。


2.Error (10158): Verilog HDL Module Declaration error at clkseg.v(1): port "XXXX" is not declared as port

解析:大意了,埠型別還沒定義啊!


3.Error (10110): variable "en" has mixed blocking and nonblocking Procedural Assignments -- must be all blocking or all nonblocking assignments

解析:en在程式中有時用非阻塞賦值,有時用阻塞賦值,這是禁止的。在初學的時候,可能分得不是很清楚,所以在檢查時,一定要一步步觀察慢慢來。


4.Error (10161): Verilog HDL error at clkseg.v(36): object "count" is not declared

解析:這個錯誤應該很明顯啦,只要能讀得懂。


5.Error (10170): Verilog HDL syntax error at clkseg.v(37) near text "***"; expecting ";"

解析:意思應該也很簡單,就是檢查的時候要細心點。


6.Error (10171): Verilog HDL syntax error at ir_ctrl.v(149) near end of file ; expecting an identifier, or "endmodule", or a parallel statement

解析:最後上了endmodule。一般程式設計的程式長了,到最後也就容易忘記。


7.Error (10278): Verilog HDL Port Declaration error at ir_ctrl.v(11): input port "ir" cannot be declared with type "<a variable data type, e.g. reg>"


8.Error (10137): Verilog HDL Procedural Assignment error at test.v(24): object "check_9ms" on left-hand side of assignment must have a variable data type


9.Error (10219): Verilog HDL Continuous Assignment error at clk_div.v(26): object "clkdiv_equ" on left-hand side of assignment must have a net type

解析:看得懂英語就懂了。

10.Error (10200): Verilog HDL Conditional Statement error at clk_div.v(22): cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct

11.Error (10231): Verilog HDL error at LCD1602.v(40): value cannot be assigned to input "lcd_en"

解析:埠設定出錯

12.Error (10137): Verilog HDL Procedural Assignment error at LCD1602.v(49): object "lcd_rs" on left-hand side of assignment must have a variable data type

13.Error (10170): Verilog HDL syntax error at test_vga.v(57) near text "<"; expecting "<=", or "="

 即這裡產生的錯誤。

解析:一個空格,不小心分開了,而且有人喜歡把<=分開來寫,這個在QUANRUS是不允許的呃。。。

14.Error: Application nios2-terminal on 127.0.0.1 is using the target device

解析:這種情況出現在JTAG模式下,你在使用NIOS下的JTAG功能(比如利用BLASTER進行線上模擬),同時你又想下載*.sof檔案(就是在JTAG模式下下載程式)。簡單說就是你的JTAG已經被佔用了。解決辦法就是關閉你正在使用的JTAG功能,然後再下載*.sof檔案。初學者經常會犯這樣的錯誤,一定要注意。