Skip to content

Commit c598ef7

Browse files
authored
Merge pull request #763 from diffblue/sequence_match_item
SVA: add grammar for `first_match` with `sequence_match_item`
2 parents 9b69335 + 7bb9139 commit c598ef7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

regression/verilog/SVA/sequence_first_match1.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ module main(input clk);
77

88
initial p0: assert property (first_match(x == 0));
99

10+
// can come with sequence_match_items
11+
initial p1: assert property (first_match(x == 0, x++));
12+
1013
endmodule

src/verilog/parser.y

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,12 +2271,25 @@ sequence_expr:
22712271
{ init($$, ID_sva_sequence_intersect); mto($$, $1); mto($$, $3); }
22722272
| "first_match" '(' sequence_expr ')'
22732273
{ init($$, ID_sva_sequence_first_match); mto($$, $3); }
2274+
| "first_match" '(' sequence_expr ',' sequence_match_item_brace ')'
2275+
{ init($$, ID_sva_sequence_first_match); mto($$, $3); mto($$, $5); }
22742276
| expression "throughout" sequence_expr
22752277
{ init($$, ID_sva_sequence_throughout); mto($$, $1); mto($$, $3); }
22762278
| expression "within" sequence_expr
22772279
{ init($$, ID_sva_sequence_within); mto($$, $1); mto($$, $3); }
22782280
;
22792281

2282+
sequence_match_item_brace:
2283+
sequence_match_item
2284+
| sequence_match_item_brace ',' sequence_match_item
2285+
;
2286+
2287+
sequence_match_item:
2288+
operator_assignment
2289+
| inc_or_dec_expression
2290+
| subroutine_call
2291+
;
2292+
22802293
boolean_abbrev:
22812294
consecutive_repetition
22822295
| non_consecutive_repetition

0 commit comments

Comments
 (0)