Mantis 1573

P1800-2008/D4, 22.3.3.1

Clarify input used as output and vice-versa

CHANGE

22.3.3.1 Port coercion

A port that is declared as input (output) but used as an output (input) or inout may be coerced to inout. If not coerced to inout, a warning shall be issued.

 

TO

22.3.3.1 Port coercion

A port that is declared as input (output) but used as an output (input) or inout may be coerced to inout. If not coerced to inout, a warning shall be issued.

 

 

 

CHANGE

22.3.3.7 Port connections with dissimilar net types (net and port collapsing)

 

TO

22.3.3.76 Port connections with dissimilar net types (net and port collapsing)

 

 

ADD NEW

22.3.3.7 Port coercion

 

When both sides of a input or output port are nets and there is an additional assignment to the signal sink of the port connection is from an additional source other than through the port, the port may be coerced to inout. This may be thought of as an input port used as an output and an output port used as an input. If not coerced to inout, a warning shall be issued. If coercion does not occur, the additional assignment to the signal sink occurs, but the port direction is preserved and the assignment does not pass through the port connection to the signal source.

 

Port coercion is not applicable when port collapsing occurs as both sides of the port connection become a single net and the port direction becomes irrelevant. No warning is issued in this case.

 

Example of an input port used as an output and of an output port used as an input:

 

module top ;

wire in1, out1 ;

m m(in1, out1);

assign out1 = 1’b1;

endmodule

 

 

module m (in1, out1) ;

input in1 ;

output out1;        // out1 is driven outside the module and thus used as an input

assign in1 = 1’b0 ; // in1 is driven within the module and thus used as an output

endmodule