"Illegal output or inout port connection for "端口"
"Illegal output or inout port connection for "port"
我已经为两点 FFT 编写了一个小代码,其中我的输入(64 位复数)采用 IEEE-754 格式(双精度)。这是我的代码(蝴蝶模块、adder/subtractor 模块、测试平台)的 link:
当我尝试模拟测试台时,我遇到了以下错误列表:
P.S : 我是初学者,所以,我的文笔可能不好。请帮我解决这个问题。
参考 OP 评论中提供的 this link。您的代码适用于所有 SystemVerilog 模拟器。模块 的 输出 必须连接 到 wire
。参考下图:
模块内部的输出端口可以是reg
或wire
。但是,当该模块 实例化 时,它 必须 连接到 net 或 wire
.
参考IEEE 1800-2012,第23.3.3节:
Each port connection shall be a continuous assignment of source to
sink, where one connected item shall be a signal source and the other
shall be a signal sink. The assignment shall be a continuous
assignment from source to sink for input or output ports.
当端口在实例化中连接时,到任何其他端口,它是一个常量赋值,因此它总是需要目标端口为网络。
因此,在这段代码中,将 电线 连接到输出模块 add_sub
并将电线的值分配给 reg
outr1
,outr2
等
// Draw wires to be connected as output
wire [63:0] t1,t2,ti1,ti2;
// Drive all regs from values of wires
always @*
begin
outr1 = t1;
outr2 = t2;
outi1 = ti1;
outi2 = ti2;
end
// Change : Wires connection
add_sub adder1(en,clk,inr1[63],inr2[63],inr1[62:52],inr2[62:52],inr1[51:0],inr2[51:0],1'b0,t1[63],t1[62:52],t1[51:0]);
//...
我已经用所有模拟器模拟了你的代码 EDAPlayground here and it works fine. Refer to and this 类似问题。
我已经为两点 FFT 编写了一个小代码,其中我的输入(64 位复数)采用 IEEE-754 格式(双精度)。这是我的代码(蝴蝶模块、adder/subtractor 模块、测试平台)的 link:
当我尝试模拟测试台时,我遇到了以下错误列表:
P.S : 我是初学者,所以,我的文笔可能不好。请帮我解决这个问题。
参考 OP 评论中提供的 this link。您的代码适用于所有 SystemVerilog 模拟器。模块 的 输出 必须连接 到 wire
。参考下图:
模块内部的输出端口可以是reg
或wire
。但是,当该模块 实例化 时,它 必须 连接到 net 或 wire
.
参考IEEE 1800-2012,第23.3.3节:
Each port connection shall be a continuous assignment of source to sink, where one connected item shall be a signal source and the other shall be a signal sink. The assignment shall be a continuous assignment from source to sink for input or output ports.
当端口在实例化中连接时,到任何其他端口,它是一个常量赋值,因此它总是需要目标端口为网络。
因此,在这段代码中,将 电线 连接到输出模块 add_sub
并将电线的值分配给 reg
outr1
,outr2
等
// Draw wires to be connected as output
wire [63:0] t1,t2,ti1,ti2;
// Drive all regs from values of wires
always @*
begin
outr1 = t1;
outr2 = t2;
outi1 = ti1;
outi2 = ti2;
end
// Change : Wires connection
add_sub adder1(en,clk,inr1[63],inr2[63],inr1[62:52],inr2[62:52],inr1[51:0],inr2[51:0],1'b0,t1[63],t1[62:52],t1[51:0]);
//...
我已经用所有模拟器模拟了你的代码 EDAPlayground here and it works fine. Refer to