Skip to content

Commit

Permalink
Merge pull request #215 from diffblue/verilog-A-4-2
Browse files Browse the repository at this point in the history
Verilog: grammar rules in section A.4.2 generated instantiation
  • Loading branch information
tautschnig authored Dec 1, 2023
2 parents 1237b41 + 0a8d993 commit a4dab52
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,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 @@ -1961,32 +1967,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 @@ -2003,12 +1995,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

0 comments on commit a4dab52

Please sign in to comment.