You're quite right that these statements contradict each other. But that is what the second sentence means!22.2.2.2 says, "ANSI style port declarations can be explicitly named, allowing ... assignment pattern expressions of elements declared in a module, interface, or program to be specified on the port list." I probably did not understand you?The second sentence means that '{...} cannot be used to pick up the (undefined) type of the external port, or its correspondent in the instantiation.Shalom
ansi_port_declaration ::=
[ net_port_header | interface_port_header ] port_identifier { unpacked_dimension }
| [ variable_port_header ] port_identifier { variable_dimension } [ = constant_expression ]
| [ net_port_header | variable_port_header ] . port_identifier ( [ expression ] )
net_port_header ::= [ port_direction ] net_port_type
variable_port_header ::= [ port_direction ] variable_port_type
net_port_type32 ::= // from A.2.2.1
[ net_type ] data_type_or_implicit
variable_port_type ::= var_data_type
var_data_type ::= data_type | var data_type_or_implicit
32) When a net_port_type contains a data_type, it shall only be legal to omit the explicit net_type when declaring an
inout port.
data_type_or_implicit ::=Since providing the data type for an ansi_port_declartion is not optional, only "implicit",
data_type
| [ signing ] { packed_dimension }
For example:The BNF which makes this example legal suggests that P1 and P2 are conventional "implicitly typed" nets
module mymod (
output .P1(r[3:0]),
output .P2(r[7:4]),
ref .Y(x),
input bit R );
logic [7:0] r;
int x;
...
endmodule
The self-determined type of the port expression becomes the type for the port. The port expression shall not
be considered an assignment-like context. The port expression must resolve to a legal expression for type of
module port (see 22.3.3). The port expression is optional because ports can be defined that do not connect to
anything internal to the port.
This archive was generated by hypermail 2.1.8 : Wed Apr 16 2008 - 11:10:17 PDT