Should i use wire type under inout port?

Status
Not open for further replies.

u24c02

Advanced Member level 1
Joined
May 8, 2012
Messages
404
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,101
Hi

I trying to connent with instance module in my top module in verilog.
Thier's instance have inout port. Then i use "reg" type connent to that port.
So ncverilog's result is port connections to inout ports must be collapsible, they must be nets.
But i can understand why it's error?

Should i use net type to connect with inout port?
 

You can't connect 'reg' with inout port in verilog. This is done because 'reg' can't be driven any way except procedural assignment.

If you really need connect this 'reg' to inout (ex., inout will be always in 'input' mode), you can use something like this:
Code:
...
reg in_reg;
wire in_wire;
assign in_wire = in_reg;
...
.inout_port(in_wire),
...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…