Mantis 1573

P1800-2008/D4, 22.3.3.1

Clarify input used as output and vice-versa

In Section 22.3.3.1

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

An input port is used as an output or inout if it is assigned a value within the module. An output port is used as an input or inout if it is assigned a value outside the module.

 

Example:

 

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

 

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