diff --git a/verilog/parser/verilog.y b/verilog/parser/verilog.y index 49f9b8521..17dd2e68e 100644 --- a/verilog/parser/verilog.y +++ b/verilog/parser/verilog.y @@ -3238,7 +3238,7 @@ tf_port_item { $$ = MakeTaskFunctionPortItem($1, MakeTypeIdDimensionsTuple( MakeTaggedNode(N::kDataType, $2, nullptr), - $3, $4), + $3, MakeUnpackedDimensionsNode($4)), $5); } ; tf_port_item_expr_opt diff --git a/verilog/parser/verilog_parser_unittest.cc b/verilog/parser/verilog_parser_unittest.cc index 143fd8491..e7cd40a65 100644 --- a/verilog/parser/verilog_parser_unittest.cc +++ b/verilog/parser/verilog_parser_unittest.cc @@ -869,6 +869,26 @@ static const char* kTaskTests[] = { "const ref StringType intake;\n" // const ref "ref StringType [7:0] outtake [3:0];\n" // ref "endtask", + "task t(virtual foo_if vif);\n" + "endtask\n", + "task t(virtual foo_if#(12) vif);\n" + "endtask\n", + "task t(virtual foo_if#(.W(12)) vif);\n" + "endtask\n", + "task t(virtual interface foo_if vif);\n" + "endtask\n", + "task t(ref virtual foo_if vif);\n" + "endtask\n", + "task t(ref virtual foo_if vifs[]);\n" + "endtask\n", + "task t(ref virtual foo_if vifs[N]);\n" + "endtask\n", + "task t(ref virtual foo_if vifs[N:M]);\n" + "endtask\n", + "task t(ref virtual foo_if vifs[N:M][X:Y]);\n" + "endtask\n", + "task t(ref virtual interface foo_if#(P,Q,R) vifs[N:M][X:Y]);\n" + "endtask\n", // macro "task stringer;\n" " `uvm_error(`gtn, \"frownie =(\")\n" // string with balance character