繁体   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