@@ -755,15 +755,15 @@ module_port_declaration:
755
755
;
756
756
757
757
module_port_input_declaration :
758
- TOK_INPUT port_type port_identifier
758
+ TOK_INPUT net_port_type port_identifier
759
759
{ init($$ , ID_decl);
760
760
stack_expr ($$).set(ID_class, ID_input);
761
761
addswap ($$, ID_type, $2 );
762
762
mto ($$, $3 ); }
763
763
;
764
764
765
765
module_port_output_declaration :
766
- TOK_OUTPUT port_type port_identifier
766
+ TOK_OUTPUT net_port_type port_identifier
767
767
{ init($$ , ID_decl);
768
768
stack_expr ($$).set(ID_class, ID_output);
769
769
addswap ($$, ID_type, $2 );
@@ -867,7 +867,7 @@ specparam_declaration:
867
867
// A.2.1.2 Port declarations
868
868
869
869
module_port_inout_declaration :
870
- TOK_INOUT port_type port_identifier
870
+ TOK_INOUT net_port_type port_identifier
871
871
{ init($$ , ID_decl);
872
872
stack_expr ($$).set(ID_class, ID_inout);
873
873
addswap ($$, ID_type, $2 );
@@ -1100,6 +1100,13 @@ net_type: TOK_SUPPLY0 { init($$, ID_supply0); }
1100
1100
| TOK_WOR { init($$ , ID_wor); }
1101
1101
;
1102
1102
1103
+ variable_port_type : var_data_type ;
1104
+
1105
+ var_data_type :
1106
+ data_type
1107
+ | TOK_VAR data_type_or_implicit { $$ = $2 ; }
1108
+ ;
1109
+
1103
1110
interface_opt :
1104
1111
/* Optional */
1105
1112
{ make_nil($$ ); }
@@ -1225,6 +1232,13 @@ list_of_variable_decl_assignments:
1225
1232
{ $$ =$1 ; mto($$ , $3 ); }
1226
1233
;
1227
1234
1235
+ list_of_variable_identifiers :
1236
+ variable_identifier
1237
+ { init($$ ); mto($$ , $1 ); }
1238
+ | list_of_variable_identifiers ' ,' variable_identifier
1239
+ { $$ =$1 ; mto($$ , $3 ); }
1240
+ ;
1241
+
1228
1242
// This rule is more permissive that the grammar in the standard
1229
1243
// to cover list_of_param_assignments.
1230
1244
parameter_port_declaration :
@@ -1274,35 +1288,40 @@ implicit_data_type:
1274
1288
;
1275
1289
1276
1290
input_declaration :
1277
- TOK_INPUT port_type list_of_port_identifiers
1291
+ TOK_INPUT net_port_type list_of_port_identifiers
1292
+ { init($$ , ID_decl);
1293
+ stack_expr ($$).set(ID_class, ID_input);
1294
+ addswap ($$, ID_type, $2 );
1295
+ swapop ($$, $3 ); }
1296
+ | TOK_INPUT variable_port_type list_of_variable_identifiers
1278
1297
{ init($$ , ID_decl);
1279
1298
stack_expr ($$).set(ID_class, ID_input);
1280
1299
addswap ($$, ID_type, $2 );
1281
1300
swapop ($$, $3 ); }
1282
1301
;
1283
1302
1284
1303
output_declaration :
1285
- TOK_OUTPUT port_type list_of_port_identifiers
1304
+ TOK_OUTPUT net_port_type list_of_port_identifiers
1286
1305
{ init($$ , ID_decl);
1287
1306
stack_expr ($$).set(ID_class, ID_output);
1288
1307
addswap ($$, ID_type, $2 );
1289
1308
swapop ($$, $3 ); }
1290
- | TOK_OUTPUT data_type list_of_port_identifiers
1309
+ | TOK_OUTPUT variable_port_type list_of_port_identifiers
1291
1310
{ init($$ , ID_decl);
1292
1311
stack_expr ($$).set(ID_class, ID_output_register);
1293
1312
addswap ($$, ID_type, $2 );
1294
1313
swapop ($$, $3 ); }
1295
1314
;
1296
1315
1297
1316
inout_declaration :
1298
- TOK_INOUT port_type list_of_port_identifiers
1317
+ TOK_INOUT net_port_type list_of_port_identifiers
1299
1318
{ init($$ , ID_decl);
1300
1319
stack_expr ($$).set(ID_class, ID_inout);
1301
1320
addswap ($$, ID_type, $2 );
1302
1321
swapop ($$, $3 ); }
1303
1322
;
1304
1323
1305
- port_type : net_type_opt signing_opt packed_dimension_brace
1324
+ net_port_type : net_type_opt signing_opt packed_dimension_brace
1306
1325
{
1307
1326
$$ =$3 ;
1308
1327
add_as_subtype (stack_type($$), stack_type($2 ));
0 commit comments