错误:[VRFC 10-1145]非网络端口d_x不能在Verilog中出现模式错误
我正在编写一条代码,以通过NOC的North Last Routing在NOC中找到一条路径。我尚未将任何输入声明为INOUT,但仍显示下面给出的错误。从字面上看我编写的所有代码,此错误正在弹出。问题在哪里?
我在这里提供我的代码和测试台。
代码:
timescale 1ns / 1ps
module mesh (
input [15:0] a,
input [1:0] c_x,
input [1:0] c_y ,
output [3:0] port
);
reg d_x=0,d_y=0,s_x=0,s_y=0;
always @ (a or c_x or c_y)//when cx or cy changes, this loop happens
begin
d_x=a[1:0];// x coordinate of destination address
d_y=a[3:2];//y coordinate of destination address
s_x=a[5:4];// x coordinate of source addres
s_y=a[7:6];// y coordinate of source addres
comp u1(
.a(a),
.c_x(c_x),
.c_y(c_y),
.port(port)
);
end
endmodule
TestBench:
`timescale 1ns / 1ps
module north_tb(
reg [15:0] a,
reg [1:0] c_x,
reg [1:0] c_y ,
wire [3:0] port
);
mesh u1(
.a(a),
.c_x(c_x),
.c_y(c_y),
.port(port)
);
initial
begin
a[15:0] = 16'b100110101001010;//
c_x=2'b01;
c_y =2'b00;
#5
c_x=2'b01;
c_y =2'b01;
#5
c_x=2'b01;
c_y =2'b10;
#5
c_x=2'b10;
c_y =2'b10;
#5
$finish;
end
endmodule
以下是错误消息:
ERROR: [VRFC 10-1145] non-net port d_x cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:4]
ERROR: [VRFC 10-1145] non-net port d_y cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:5]
ERROR: [VRFC 10-1145] non-net port c_x cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:6]
ERROR: [VRFC 10-1145] non-net port c_y cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:7]
ERROR: [VRFC 10-1040] module comp_tb ignored due to previous errors [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:3]
I am writing a code for finding a path by north last routing in NOC. I have not declared any of the inputs as inout but still the error given below is shown. This error is popping up for literally all of the codes I write. Where is the problem?
I am providing my code and testbench here.
code:
timescale 1ns / 1ps
module mesh (
input [15:0] a,
input [1:0] c_x,
input [1:0] c_y ,
output [3:0] port
);
reg d_x=0,d_y=0,s_x=0,s_y=0;
always @ (a or c_x or c_y)//when cx or cy changes, this loop happens
begin
d_x=a[1:0];// x coordinate of destination address
d_y=a[3:2];//y coordinate of destination address
s_x=a[5:4];// x coordinate of source addres
s_y=a[7:6];// y coordinate of source addres
comp u1(
.a(a),
.c_x(c_x),
.c_y(c_y),
.port(port)
);
end
endmodule
testbench:
`timescale 1ns / 1ps
module north_tb(
reg [15:0] a,
reg [1:0] c_x,
reg [1:0] c_y ,
wire [3:0] port
);
mesh u1(
.a(a),
.c_x(c_x),
.c_y(c_y),
.port(port)
);
initial
begin
a[15:0] = 16'b100110101001010;//
c_x=2'b01;
c_y =2'b00;
#5
c_x=2'b01;
c_y =2'b01;
#5
c_x=2'b01;
c_y =2'b10;
#5
c_x=2'b10;
c_y =2'b10;
#5
$finish;
end
endmodule
following is the error message:
ERROR: [VRFC 10-1145] non-net port d_x cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:4]
ERROR: [VRFC 10-1145] non-net port d_y cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:5]
ERROR: [VRFC 10-1145] non-net port c_x cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:6]
ERROR: [VRFC 10-1145] non-net port c_y cannot be of mode inout [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:7]
ERROR: [VRFC 10-1040] module comp_tb ignored due to previous errors [D:/Vivado/northlast/northlast.srcs/sim_1/new/comp_tb.v:3]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TestBench的通常没有端口。
模拟器不喜欢发布的TestBench使用端口访问测试设计的方式(DUT)。
测试台访问DUT的方法是使用在测试台中本地声明的信号。
这样:
该帖子在网格模块中存在问题。它实例化了一个称为Comp的模块,该模块在帖子中未提供。我认为这不是触发帖子的问题。
我认为问题是试图在测试台模块上拥有端口,并期望它们充当本地信号。
可以是,您编写的所有代码都在测试板上都有端口吗?
在网格模块中,此陈述是有害的,原因有两个。
建议是用
Testbench's generally do not have ports.
The simulator does not like the way the posted testbench is using ports for access to design under test (DUT).
The way for the testbench to access the DUT is by using signals declared locally in the testbench.
Like this:
The post has a problem in the mesh module. It instantiates a module called comp which is not provided in the post. I don't think this is the problem that triggered post though.
I think the problem is trying to have ports on the testbench module, and expecting them to function as local signals.
Could in be that all the code you write have ports on the testbenches?
In the mesh module this statement is bad for a couple of reasons.
A recommendation is to replace it with