我试图制作一个测试平台来模拟一个工作的顶级模块(和子模块),但是我无法让iverilog正确地处理top的输出(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确实如此,不仅合成,而且在实际硬件上的行为与预期完全相同。
发布于 2016-03-02 18:08:44
事实证明,尽管我的顶级设计能够输出到一条电线上,但是iverilog并不乐意这样做,
添加
reg [7:0] leds;
assign LEDS=leds;允许我的顶级设计在硬件上工作(和以前一样),但是iverilog (icarus)现在似乎能够处理它.
https://stackoverflow.com/questions/35728987
复制相似问题