Skip to content

Commit

Permalink
Verilog: allow task invocations without parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
kroening committed Jan 25, 2025
1 parent d4845d1 commit 9598506
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
3 changes: 1 addition & 2 deletions regression/verilog/tasks/task_invocation1.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
KNOWNBUG
CORE
task_invocation1.sv

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
The parser rejects invocations without ().
24 changes: 22 additions & 2 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -4007,7 +4007,7 @@ unsigned_number: TOK_NUMBER
// A.8.2 Subroutine calls

tf_call:
hierarchical_tf_identifier list_of_arguments_paren
hierarchical_identifier list_of_arguments_paren_opt
{ init($$, ID_function_call);
stack_expr($$).operands().reserve(2);
mto($$, $1); mto($$, $2); }
Expand All @@ -4020,6 +4020,7 @@ list_of_arguments_paren:

list_of_arguments_paren_opt:
/* Optional */
{ init($$); }
| list_of_arguments_paren
;

Expand Down Expand Up @@ -4054,7 +4055,26 @@ subroutine_call:
| system_tf_call
;

function_subroutine_call: subroutine_call
function_subroutine_call:
hierarchical_tf_identifier list_of_arguments_paren
{ init($$, ID_function_call);
stack_expr($$).operands().reserve(2);
mto($$, $1); mto($$, $2); }
| system_task_name list_of_arguments_paren
{ init($$, ID_function_call);
stack_expr($$).operands().reserve(2);
mto($$, $1); mto($$, $2); }
| system_task_name '(' data_type ')'
{ init($$, ID_function_call);
stack_expr($$).operands().reserve(2);
mto($$, $1);
unary_exprt arguments(ID_arguments, exprt(ID_type, stack_type($3)));
stack_expr($$).add_to_operands(arguments); }
| system_task_name
{ init($$, ID_function_call);
stack_expr($$).operands().reserve(2);
mto($$, $1);
}
;

event_trigger: TOK_MINUSGREATER hierarchical_event_identifier ';'
Expand Down

0 comments on commit 9598506

Please sign in to comment.