# Inout port illegal connection error

**URL:** <https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222>\
**Category:** UVM\
**Tags:** UVM, SystemVerilog, error, inout\
**Created:** [June 25, 2019, 12:20pm UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222 "2019-06-25T12:20:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrllhclb](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@nrllhclb](https://verificationacademy.com/forums/u/nrllhclb)\
**Post date:** [June 25, 2019, 12:20pm UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/1 "2019-06-25T12:20:34Z")

</div>

i have a inout port and i wanna assign it to other varibale at AL and top but it does not work.  
Error : inout port illegal connection for port to reg type.

## At AL.svh

## inout [31:0] DATA;

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

## At top.svh

## AL AL\_0( .DATA(bus\_if.DATA) );

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

## At bus\_if.sv

## logic [31:0] DATA;

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

i tried to fix much more but it does not work, could you help me? Thanks.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 25, 2019, 12:40pm UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/2 "2019-06-25T12:40:49Z")

</div>

_In reply to [nrllhclb](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222):_

The port declaration

```verilog
inout [31:0] DATA;

```

implies this is a nettype (wire). And you want to connect this to a simple variable in your interface. This is not legal.

In your SV interface declare

```verilog
wire [31:0] DATA,

```

This’ll fix your problem.

---

<div class="post-metadata">

**Author:** ![nrllhclb](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@nrllhclb](https://verificationacademy.com/forums/u/nrllhclb)\
**Post date:** [June 25, 2019, 12:58pm UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/3 "2019-06-25T12:58:10Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/2):_

unfortunately, i tried things which written by you, but it did not.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 25, 2019, 3:17pm UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/4 "2019-06-25T15:17:27Z")

</div>

_In reply to [nrllhclb](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/3):_

See here an example:

```verilog
module des(input logic a, output logic b, inout wire c);

endmodule

interface intf();
  logic x;
  logic y;
  wire z;
  //logic z;
endinterface

module top();

intf iface();
des DUT(.a(iface.x), .b(iface.y), .c(iface.z));
endmodule

```

Replacing the wire in the interface with logic results in the error message:  
inout.sv(15): Illegal inout port connection for ‘c’ (3rd connection).

---

<div class="post-metadata">

**Author:** ![haykp](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/0ea827/32.png) [@haykp](https://verificationacademy.com/forums/u/haykp)\
**Post date:** [July 1, 2019, 1:51am UTC](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/5 "2019-07-01T01:51:03Z")

</div>

_In reply to [nrllhclb](https://verificationacademy.com/forums/t/inout-port-illegal-connection-error/36222/4):_

Just remember that logic cannot be connect to inout~
