Verilog-端口的非法输出或输出端口连接(&Q;) [英] Verilog - "Illegal output or inout port connection for port"
本文介绍了Verilog-端口的非法输出或输出端口连接(&Q;)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我第一次使用Verilog编码,也是我第一次使用StackExchange查询!如果我在这个岗位上没有使用任何礼仪,请提前原谅我。
我艰难地通过了一些已经在这里发布的类似问题,但我不知道如何将这些解决方案应用到我自己的代码中……我不确定为什么在尝试运行模拟时收到上述错误,也不确定如何修复它。请告知?:)
我已经在下面附上了我的源代码,以及测试平台模块和我在尝试运行模拟时收到的错误。
非常感谢您的反馈!
module test1();
reg O, P, W;
wire LowRate, StandardRate, PeakRate;
outputs LowRate,StandardRate,PeakRate
CircuitStructure
testboi(LowRate,StandardRate,PeakRate,O,P,W);
initial
begin
O=0; P=0; W=0;
#10 O=0; P=0; W=0;
#10 O=0; P=0; W=1;
#10 O=0; P=1; W=0;
#10 O=0; P=1; W=1;
#10 O=1; P=0; W=0;
#10 O=1; P=0; W=1;
#10 O=1; P=1; W=0;
#10 O=1; P=1; W=1;
#10
$finish();
end
endmodule
module CircuitStructure(O, P, W, LowRate,
StandardRate, PeakRate);
input O, P, W;
output LowRate, StandardRate, PeakRate;
not
UA1(NotP,P),
UA2(NotO,O),
UA3(NotW,W);
nand
UB1(Nand1,NotP,NotO),
UB2(Nand2,NotW,P),
UB3(PeakRate,Nand1,Nand2);
and
UC1(StandardRate,P,W);
buf
UD1(LowRate,O);
endmodule
模拟错误:
Loading work.test1
# Loading work.CircuitStructure
# ** Error (suppressible): (vsim-3053)
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v(10): Illegal
output or inout port connection for port 'LowRate'.
# Time: 0 ns Iteration: 0 Instance: /test1/testboi File:
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v
# ** Error (suppressible): (vsim-3053)
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v(10): Illegal
output or inout port connection for port 'StandardRate'.
# Time: 0 ns Iteration: 0 Instance: /test1/testboi File:
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v
# ** Error (suppressible): (vsim-3053)
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v(10): Illegal
output or inout port connection for port 'PeakRate'.
# Time: 0 ns Iteration: 0 Instance: /test1/testboi File:
C:/Modeltech_pe_edu_10.4a/ECE171_Project1/TestBench - Copy.v
# Error loading design
推荐答案
您已将模块定义为:
module CircuitStructure(O, P, W, LowRate, StandardRate, PeakRate);
然而,在定义您的单元测试时,您使用不同的信号顺序:
testboi(LowRate,StandardRate,PeakRate,O,P,W);
这就是为什么编译器假设您想要将LowRate
信号发送到O
输入,StandardRate
发送到P
输入,等等。23.3.2)定义以下连接模块实例的方式:
- 按端口顺序排列的位置连接
- 使用完全显式连接的命名端口连接
- 使用隐式连接的命名端口连接(SystemVerilog),
- 使用通配符端口名(SystemVerilog)命名端口连接。
使用第一个命令时,您需要更改信号顺序:
testboi(O,P,W,LowRate,StandardRate,PeakRate);
使用第二个端口时,您需要显式地"告知"编译器哪些信号被分配给特定端口:
testboi(.LowRate(LowRate),.StandardRate(StandardRate),.PeakRate(PeakRate),.O(O),.P(P),.W(W));
这篇关于Verilog-端口的非法输出或输出端口连接(&Q;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文