簡體   English   中英

帶有輸出的 iverilog 測試台模塊

[英]iverilog testbench module with outputs

我正在嘗試制作一個測試平台來模擬工作的頂級模塊(和子模塊),但是我無法讓 iverilog 正確處理頂部的輸出(LEDS、RS232Rx 和 RS232Tx 是物理引腳)

這是我在測試平台上的嘗試

module test();
initial begin
    $dumpfile("test.vcd");
    $dumpvars(0,test);
    # 1024 $stop;
end 
reg clk = 0; always #1 clk = !clk;
//reg rx,tx;
reg [7:0] opl;
top top1 ( .clk(clk), .RS232Rx(rx), .RS232Tx(tx), .LEDS(opl) );
endmodule 

我看到這樣的錯誤

iverilog -o test-design testbench.v top.v
top.v:47: error: LEDS is not a valid l-value in test.top1.
top.v:8:      : LEDS is declared here as wire.
testbench.v:10: error: reg opl; cannot be driven by primitives or continuous assignment.
testbench.v:10: error: Output port expression must support continuous assignment.
testbench.v:10:      : Port 4 (LEDS) of top is connected to opl
3 error(s) during elaboration.

我也嘗試過很多事情,但沒有太多啟發性或不同的錯誤消息,最好的 LEDS 作為測試台輸出,只顯示 top.v 中的一個錯誤,它正在工作......我看到了非常相似的錯誤rx,tx 但將它們注釋掉以制作更短的輸出...

只是重申 top.v 確實如此,不僅可以合成,而且在實際硬件上的行為與預期完全一樣

事實證明,盡管我的頂級設計能夠輸出到電線,但 iverilog 並不樂意這樣做,

添加

reg [7:0] leds;
assign LEDS=leds;

允許我的頂級設計在硬件上工作(和以前一樣),而且 iverilog (icarus) 現在似乎能夠處理它......

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM