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
76
ADD NEW
22.3.3.7 Port coercion
When both sides of an input or
output port are nets and there is an additional assignment to the port connection
signal sink other than through the port connection (i.e., input port used as an
output or output port used as an input), the port may be coerced to inout. 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.
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