@@ -803,10 +803,8 @@ module_or_generate_item:
803
803
| attribute_instance_brace gate_instantiation { $$ =$2 ; }
804
804
// | attribute_instance_brace udp_instantiation { $$ =$2 ; }
805
805
| attribute_instance_brace module_instantiation { $$ =$2 ; }
806
- | attribute_instance_brace concurrent_assert_statement { $$ =$2 ; }
807
- | attribute_instance_brace concurrent_assume_statement { $$ =$2 ; }
808
- | attribute_instance_brace concurrent_cover_statement { $$ =$2 ; }
809
- | attribute_instance_brace concurrent_assertion_item_declaration { $$ =$2 ; }
806
+ | attribute_instance_brace concurrent_assertion_item { $$ =$2 ; }
807
+ | attribute_instance_brace assertion_item_declaration { $$ =$2 ; }
810
808
| attribute_instance_brace module_common_item { $$ =$2 ; }
811
809
;
812
810
@@ -1535,8 +1533,19 @@ block_item_declaration:
1535
1533
// System Verilog standard 1800-2017
1536
1534
// A.2.10 Assertion declarations
1537
1535
1538
- concurrent_assertion_item_declaration :
1539
- property_declaration
1536
+ concurrent_assertion_item :
1537
+ concurrent_assertion_statement
1538
+ | block_identifier TOK_COLON concurrent_assertion_statement
1539
+ {
1540
+ $$ =$3 ;
1541
+ stack_expr ($$).set(ID_identifier, stack_expr($1 ).id());
1542
+ }
1543
+ ;
1544
+
1545
+ concurrent_assertion_statement :
1546
+ assert_property_statement
1547
+ | assume_property_statement
1548
+ | cover_property_statement
1540
1549
;
1541
1550
1542
1551
assert_property_statement :
@@ -1567,6 +1576,10 @@ cover_property_statement: TOK_COVER TOK_PROPERTY '(' expression ')' action_block
1567
1576
{ init($$ , ID_cover); mto($$ , $4 ); mto($$ , $6 ); }
1568
1577
;
1569
1578
1579
+ assertion_item_declaration :
1580
+ property_declaration
1581
+ ;
1582
+
1570
1583
property_declaration :
1571
1584
TOK_PROPERTY property_identifier TOK_ENDPROPERTY
1572
1585
;
@@ -2074,6 +2087,40 @@ always_construct: TOK_ALWAYS statement
2074
2087
{ init($$ , ID_always); mto($$ , $2 ); }
2075
2088
;
2076
2089
2090
+ blocking_assignment :
2091
+ variable_lvalue ' =' delay_or_event_control expression
2092
+ { init($$ , ID_blocking_assign); mto($$ , $1 ); mto($$ , $4 ); }
2093
+ | operator_assignment
2094
+ ;
2095
+
2096
+ operator_assignment :
2097
+ variable_lvalue assignment_operator expression
2098
+ { init($$ , ID_blocking_assign); mto($$ , $1 ); mto($$ , $3 ); }
2099
+ ;
2100
+
2101
+ assignment_operator :
2102
+ ' ='
2103
+ | TOK_PLUSEQUAL
2104
+ | TOK_MINUSEQUAL
2105
+ | TOK_ASTERICEQUAL
2106
+ | TOK_SLASHEQUAL
2107
+ | TOK_PERCENTEQUAL
2108
+ | TOK_AMPEREQUAL
2109
+ | TOK_VERTBAREQUAL
2110
+ | TOK_CARETEQUAL
2111
+ | TOK_LESSLESSEQUAL
2112
+ | TOK_GREATERGREATEREQUAL
2113
+ | TOK_LESSLESSLESSEQUAL
2114
+ | TOK_GREATERGREATERGREATEREQUAL
2115
+ ;
2116
+
2117
+ nonblocking_assignment :
2118
+ variable_lvalue TOK_LESSEQUAL expression
2119
+ { init($$ , ID_non_blocking_assign); mto($$ , $1 ); mto($$ , $3 ); }
2120
+ | variable_lvalue TOK_LESSEQUAL delay_or_event_control expression
2121
+ { init($$ , ID_non_blocking_assign); mto($$ , $1 ); mto($$ , $4 ); }
2122
+ ;
2123
+
2077
2124
// The extra rule to allow block_item_declaration is to avoid an ambiguity
2078
2125
// caused by the attribute_instance_brace.
2079
2126
statement :
@@ -2086,12 +2133,10 @@ statement:
2086
2133
;
2087
2134
2088
2135
statement_item :
2089
- assert_property_statement
2090
- | assume_property_statement
2091
- | blocking_assignment ' ;' { $$ = $1 ; }
2136
+ blocking_assignment ' ;' { $$ = $1 ; }
2092
2137
| nonblocking_assignment ' ;' { $$ = $1 ; }
2093
2138
| case_statement
2094
- | cover_property_statement
2139
+ | concurrent_assertion_statement
2095
2140
| conditional_statement
2096
2141
| inc_or_dec_expression ' ;'
2097
2142
| subroutine_call_statement
@@ -2103,7 +2148,7 @@ statement_item:
2103
2148
| procedural_continuous_assignments ' ;'
2104
2149
| seq_block
2105
2150
| wait_statement
2106
- | immediate_assert_statement
2151
+ | procedural_assertion_statement
2107
2152
;
2108
2153
2109
2154
subroutine_call_statement :
@@ -2333,7 +2378,19 @@ statement_brace:
2333
2378
// System Verilog standard 1800-2017
2334
2379
// A.6.10 Assertion statements
2335
2380
2336
- immediate_assert_statement : TOK_ASSERT ' (' expression ' )' action_block
2381
+ procedural_assertion_statement :
2382
+ immediate_assertion_statement
2383
+ ;
2384
+
2385
+ immediate_assertion_statement :
2386
+ simple_immediate_assertion_statement
2387
+ ;
2388
+
2389
+ simple_immediate_assertion_statement :
2390
+ simple_immediate_assert_statement
2391
+ ;
2392
+
2393
+ simple_immediate_assert_statement : TOK_ASSERT ' (' expression ' )' action_block
2337
2394
{ init($$ , ID_assert); mto($$ , $3 ); mto($$ , $5 ); }
2338
2395
;
2339
2396
@@ -2354,40 +2411,6 @@ procedural_continuous_assignments:
2354
2411
/* | TOK_RELEASE net_lvalue */
2355
2412
;
2356
2413
2357
- blocking_assignment :
2358
- variable_lvalue ' =' delay_or_event_control expression
2359
- { init($$ , ID_blocking_assign); mto($$ , $1 ); mto($$ , $4 ); }
2360
- | operator_assignment
2361
- ;
2362
-
2363
- operator_assignment :
2364
- variable_lvalue assignment_operator expression
2365
- { init($$ , ID_blocking_assign); mto($$ , $1 ); mto($$ , $3 ); }
2366
- ;
2367
-
2368
- assignment_operator :
2369
- ' ='
2370
- | TOK_PLUSEQUAL
2371
- | TOK_MINUSEQUAL
2372
- | TOK_ASTERICEQUAL
2373
- | TOK_SLASHEQUAL
2374
- | TOK_PERCENTEQUAL
2375
- | TOK_AMPEREQUAL
2376
- | TOK_VERTBAREQUAL
2377
- | TOK_CARETEQUAL
2378
- | TOK_LESSLESSEQUAL
2379
- | TOK_GREATERGREATEREQUAL
2380
- | TOK_LESSLESSLESSEQUAL
2381
- | TOK_GREATERGREATERGREATEREQUAL
2382
- ;
2383
-
2384
- nonblocking_assignment :
2385
- variable_lvalue TOK_LESSEQUAL expression
2386
- { init($$ , ID_non_blocking_assign); mto($$ , $1 ); mto($$ , $3 ); }
2387
- | variable_lvalue TOK_LESSEQUAL delay_or_event_control expression
2388
- { init($$ , ID_non_blocking_assign); mto($$ , $1 ); mto($$ , $4 ); }
2389
- ;
2390
-
2391
2414
procedural_timing_control_statement :
2392
2415
procedural_timing_control statement_or_null
2393
2416
{ $$ =$1 ; mto($$ , $2 ); }
0 commit comments