Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemVerilog: type parameter ports #842

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions regression/verilog/modules/parameter_ports4.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
KNOWNBUG
CORE
parameter_ports4.sv
--bound 0
^EXIT=0$
^SIGNAL=0$
--
--
The type parameter port needs to be parsed as a type.
10 changes: 8 additions & 2 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -1763,11 +1763,15 @@ list_of_variable_identifiers:
parameter_port_declaration:
TOK_PARAMETER data_type_or_implicit param_assignment
{ $$ = $3; }
| TOK_PARAMETER TOK_TYPE data_type_or_implicit param_assignment
{ $$ = $4; }
| TOK_LOCALPARAM data_type_or_implicit param_assignment
{ $$ = $3; }
| data_type param_assignment
{ $$ = $2; }
| param_assignment
| TOK_TYPE param_assignment
{ $$ = $2; }
;

list_of_defparam_assignments:
Expand All @@ -1789,13 +1793,15 @@ list_of_param_assignments:
{ $$=$1; mto($$, $3); }
;

param_assignment: param_identifier '=' constant_param_expression
param_assignment:
param_identifier '=' constant_param_expression
{ init($$, ID_parameter);
auto base_name = stack_expr($1).id();
stack_expr($$).set(ID_identifier, base_name);
stack_expr($$).set(ID_base_name, base_name);
addswap($$, ID_value, $3); }
;
| type_assignment
;

list_of_type_assignments:
type_assignment
Expand Down
Loading