Support property declaration with empty parentheses (#4313) (#4317)

This commit is contained in:
Anthony Donlon 2023-07-26 17:18:21 +08:00 committed by GitHub
parent fd0703b8c8
commit 959387b69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -14,6 +14,7 @@ Ameya Vikram Singh
Andreas Kuster
Andrei Kostovski
Andrew Nolte
Anthony Donlon
Arkadiusz Kozdra
Aylon Chaim Porat
Cameron Kirk

View File

@ -5863,6 +5863,7 @@ property_declarationFront<nodeFTaskp>: // IEEE: part of property_declaration
property_port_listE<nodep>: // IEEE: [ ( [ property_port_list ] ) ]
/* empty */ { $$ = nullptr; }
| '(' ')' { $$ = nullptr; }
| '(' property_port_list ')' { $$ = $2; }
;

View File

@ -60,12 +60,19 @@ module t (/*AUTOARG*/
logic out = 1;
property prop_a;
@(posedge clk) disable iff (cyc <= 10) out;
endproperty
@(posedge clk) disable iff (cyc <= 1) out;
endproperty : prop_a
property prop_b();
@(posedge clk) disable iff (cyc <= 1) out;
endproperty : prop_b
assert property(disable iff (cyc < 5) check_if_gt_5(cyc + 1));
assert property(@(posedge clk) pass_assertion(cyc));
assert property (prop_a) else $error($sformatf("property check failed :assert: (False)"));
assert property (prop_a()) else $error($sformatf("property check failed :assert: (False)"));
assert property (prop_b) else $error($sformatf("property check failed :assert: (False)"));
assert property (prop_b()) else $error($sformatf("property check failed :assert: (False)"));
always @(posedge clk) begin
if (expected_fails == 2) begin