@@ -2122,17 +2122,22 @@ net_assignment: net_lvalue '=' expression
2122
2122
{ init($$ , ID_equal); mto($$ , $1 ); mto($$ , $3 ); }
2123
2123
;
2124
2124
2125
- variable_assignment : net_assignment ;
2126
-
2127
2125
// System Verilog standard 1800-2017
2128
2126
// A.6.2 Procedural blocks and assignments
2129
2127
2130
- initial_construct : TOK_INITIAL statement
2128
+ initial_construct : TOK_INITIAL statement_or_null
2131
2129
{ init($$ , ID_initial); mto($$ , $2 ); }
2132
2130
;
2133
2131
2134
- always_construct : TOK_ALWAYS statement
2135
- { init($$ , ID_always); mto($$ , $2 ); }
2132
+ always_construct : always_keyword statement
2133
+ { $$ =$1 ; mto($$ , $2 ); }
2134
+ ;
2135
+
2136
+ always_keyword :
2137
+ TOK_ALWAYS { init($$ , ID_always); }
2138
+ | TOK_ALWAYS_COMB { init($$ , ID_always); }
2139
+ | TOK_ALWAYS_LATCH { init($$ , ID_always); }
2140
+ | TOK_ALWAYS_FF { init($$ , ID_always); }
2136
2141
;
2137
2142
2138
2143
blocking_assignment :
@@ -2169,36 +2174,21 @@ nonblocking_assignment:
2169
2174
{ init($$ , ID_non_blocking_assign); mto($$ , $1 ); mto($$ , $4 ); }
2170
2175
;
2171
2176
2172
- // The extra rule to allow block_item_declaration is to avoid an ambiguity
2173
- // caused by the attribute_instance_brace.
2174
- statement :
2175
- /* block_identifier TOK_COLON attribute_instance_brace statement_item
2176
- { $$=$4; }
2177
- | */
2178
- attribute_instance_brace statement_item
2179
- { $$ =$2 ; }
2180
- | block_item_declaration
2181
- ;
2182
-
2183
- statement_item :
2184
- blocking_assignment ' ;' { $$ = $1 ; }
2185
- | nonblocking_assignment ' ;' { $$ = $1 ; }
2186
- | case_statement
2187
- | concurrent_assertion_statement
2188
- | conditional_statement
2189
- | inc_or_dec_expression ' ;'
2190
- | subroutine_call_statement
2191
- | disable_statement
2192
- | event_trigger
2193
- | loop_statement
2194
- | par_block
2195
- | procedural_timing_control_statement
2196
- | procedural_continuous_assignments ' ;'
2197
- | seq_block
2198
- | wait_statement
2199
- | procedural_assertion_statement
2177
+ procedural_continuous_assignment :
2178
+ TOK_ASSIGN variable_assignment
2179
+ { init($$ , ID_continuous_assign); mto($$ , $2 ); }
2180
+ | TOK_DEASSIGN variable_lvalue
2181
+ { init($$ , ID_deassign); mto($$ , $2 ); }
2182
+ | TOK_FORCE variable_assignment
2183
+ { init($$ , ID_force); swapop($$ , $2 ); }
2184
+ /* | TOK_FORCE net_assignment */
2185
+ | TOK_RELEASE variable_lvalue
2186
+ { init($$ , ID_release); mto($$ , $2 ); }
2187
+ /* | TOK_RELEASE net_lvalue */
2200
2188
;
2201
2189
2190
+ variable_assignment : net_assignment ;
2191
+
2202
2192
subroutine_call_statement :
2203
2193
subroutine_call ' ;'
2204
2194
{ $$ =$1 ; }
@@ -2249,13 +2239,48 @@ concurrent_cover_statement: cover_property_statement
2249
2239
// System Verilog standard 1800-2017
2250
2240
// A.6.4 Statements
2251
2241
2242
+ statement_or_null :
2243
+ statement
2244
+ | attribute_instance_brace ' ;' { init($$ , ID_skip); }
2245
+ ;
2246
+
2252
2247
statement_or_null_brace :
2253
2248
/* Optional */
2254
2249
{ init($$ ); }
2255
2250
| statement_or_null_brace statement_or_null
2256
2251
{ $$ =$1 ; mto($$ , $2 ); }
2257
2252
;
2258
2253
2254
+ // The extra rule to allow block_item_declaration is to avoid an ambiguity
2255
+ // caused by the attribute_instance_brace.
2256
+ statement :
2257
+ /* block_identifier TOK_COLON attribute_instance_brace statement_item
2258
+ { $$=$4; }
2259
+ | */
2260
+ attribute_instance_brace statement_item
2261
+ { $$ =$2 ; }
2262
+ | block_item_declaration
2263
+ ;
2264
+
2265
+ statement_item :
2266
+ blocking_assignment ' ;' { $$ = $1 ; }
2267
+ | nonblocking_assignment ' ;' { $$ = $1 ; }
2268
+ | case_statement
2269
+ | concurrent_assertion_statement
2270
+ | conditional_statement
2271
+ | inc_or_dec_expression ' ;'
2272
+ | subroutine_call_statement
2273
+ | disable_statement
2274
+ | event_trigger
2275
+ | loop_statement
2276
+ | par_block
2277
+ | procedural_timing_control_statement
2278
+ | procedural_continuous_assignment ' ;'
2279
+ | seq_block
2280
+ | wait_statement
2281
+ | procedural_assertion_statement
2282
+ ;
2283
+
2259
2284
system_task_name : TOK_SYSIDENT
2260
2285
{ init($$ , ID_symbol);
2261
2286
stack_expr ($$).set(ID_identifier, stack_expr($1 ).id());
@@ -2449,19 +2474,6 @@ wait_statement: TOK_WAIT '(' expression ')' statement_or_null
2449
2474
{ init($$ , ID_wait); mto($$ , $3 ); mto($$ , $5 ); }
2450
2475
;
2451
2476
2452
- procedural_continuous_assignments :
2453
- TOK_ASSIGN variable_assignment
2454
- { init($$ , ID_continuous_assign); mto($$ , $2 ); }
2455
- | TOK_DEASSIGN variable_lvalue
2456
- { init($$ , ID_deassign); mto($$ , $2 ); }
2457
- | TOK_FORCE variable_assignment
2458
- { init($$ , ID_force); swapop($$ , $2 ); }
2459
- /* | TOK_FORCE net_assignment */
2460
- | TOK_RELEASE variable_lvalue
2461
- { init($$ , ID_release); mto($$ , $2 ); }
2462
- /* | TOK_RELEASE net_lvalue */
2463
- ;
2464
-
2465
2477
procedural_timing_control_statement :
2466
2478
procedural_timing_control statement_or_null
2467
2479
{ $$ =$1 ; mto($$ , $2 ); }
@@ -2629,11 +2641,6 @@ system_tf_call:
2629
2641
;
2630
2642
2631
2643
2632
- statement_or_null :
2633
- statement
2634
- | attribute_instance_brace ' ;' { init($$ , ID_skip); }
2635
- ;
2636
-
2637
2644
event_trigger : TOK_MINUSGREATER hierarchical_event_identifier ' ;'
2638
2645
;
2639
2646
0 commit comments