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

Verilog: grammar rules in section A.4.2 generated instantiation #215

Merged
merged 1 commit into from
Dec 1, 2023
Merged
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
46 changes: 23 additions & 23 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,12 @@ port_declaration_brace:
}
;

port_declaration:
attribute_instance_brace inout_declaration { $$=$2; }
| attribute_instance_brace input_declaration { $$=$2; }
| attribute_instance_brace output_declaration { $$=$2; }
;

module_port_declaration:
attribute_instance_brace module_port_inout_declaration { $$=$2; }
| attribute_instance_brace module_port_input_declaration { $$=$2; }
Expand Down Expand Up @@ -1864,32 +1870,18 @@ if_generate_construct:
{ init($$, ID_generate_if); mto($$, $3); mto($$, $5); mto($$, $7); }
;

generate_item:
conditional_generate_construct
| loop_generate_construct
| generate_block
| module_or_generate_item
;

generate_item_or_null:
generate_item
| ';' { init($$, ID_generate_skip); }
;

constant_expression: expression;

case_generate_construct:
TOK_CASE '(' constant_expression ')'
genvar_case_item_brace TOK_ENDCASE
case_generate_item_brace TOK_ENDCASE
{ init($$, ID_generate_case); mto($$, $3); }
;

genvar_case_item_brace:
genvar_case_item
| genvar_case_item_brace genvar_case_item
case_generate_item_brace:
case_generate_item
| case_generate_item_brace case_generate_item
;

genvar_case_item:
case_generate_item:
expression_brace TOK_COLON generate_item_or_null
| TOK_DEFAULT TOK_COLON generate_item_or_null
| TOK_DEFAULT generate_item_or_null
Expand All @@ -1906,12 +1898,20 @@ generate_block:
stack_expr($$).set(ID_identifier, stack_expr($3).id()); }
;

port_declaration:
attribute_instance_brace inout_declaration { $$=$2; }
| attribute_instance_brace input_declaration { $$=$2; }
| attribute_instance_brace output_declaration { $$=$2; }
generate_item:
conditional_generate_construct
| loop_generate_construct
| generate_block
| module_or_generate_item
;

generate_item_or_null:
generate_item
| ';' { init($$, ID_generate_skip); }
;

constant_expression: expression;

package_or_generate_item_declaration:
net_declaration
| data_declaration
Expand Down