0

The code is as follows:

module abc(a,b,c...);
  inout [15:0] a;
endmodule

module top;
   wire [15:0] data_a;
endmodule

How to make connection between wire signal data_a of top module and inout signal a of other module so that any change in data_a is reflected in inout port?

Morgan
  • 18,407
  • 6
  • 54
  • 78
Mrugesh Thaker
  • 3,545
  • 6
  • 30
  • 68
  • @Morgran the link does not show how to instantiate modules with inout ports. My answer does, and the question refers specifically to such case. – ygoncho Feb 24 '15 at 13:37
  • @ygoncho, Your answer only directly addresses the inout port by saying they "are not different". The main problem the OP seems to face was knowing how instantiate the module. – Morgan Feb 24 '15 at 13:50

2 Answers2

0

Inout ports in this essence are not different from output ports or input ports. You can connect the inout port directly to the wire when you instantiate the module.

in the top module, after declaring your data_a wire, write:

abc abc_inst (
...
.a(data_a)
);
ygoncho
  • 367
  • 1
  • 2
  • 11
0

There is quite a detailed answer on how to instantiate module, which shows how to make connections between modules.

Inouts are no different, instantiate the module and connect the wire inside top.

module abc(a,b,c...);
  inout [15:0] a;
endmodule

module top;
   wire [15:0] data_a;
   abc u_abs(            //module instance
     .a( data_a )        //port connections
   );
endmodule
Community
  • 1
  • 1
Morgan
  • 18,407
  • 6
  • 54
  • 78