From 627d83e80764ab7f962aaeac3e1567e08c7b256a Mon Sep 17 00:00:00 2001 From: Peter Monsson Date: Thu, 3 Sep 2020 18:38:48 +0200 Subject: [PATCH] Add support for assume property (#2531) --- Changes | 2 ++ src/verilog.y | 1 + test_regress/t/t_assert_property.v | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/Changes b/Changes index a091c1f48..e8ae99aa1 100644 --- a/Changes +++ b/Changes @@ -25,6 +25,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix queues as class members (#2525). [nanduraj1] +**** Add support for assume property. [Peter Monsson] + * Verilator 4.040 2020-08-15 diff --git a/src/verilog.y b/src/verilog.y index 1e7fe37aa..c9b2e8648 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -5056,6 +5056,7 @@ concurrent_assertion_statement: // ==IEEE: concurrent_assertion_statement yASSERT yPROPERTY '(' property_spec ')' elseStmtBlock { $$ = new AstAssert($1, $4, nullptr, $6, false); } //UNSUP yASSERT yPROPERTY '(' property_spec ')' action_block { } // // IEEE: assume_property_statement + | yASSUME yPROPERTY '(' property_spec ')' elseStmtBlock { $$ = new AstAssert($1, $4, nullptr, $6, false); } //UNSUP yASSUME yPROPERTY '(' property_spec ')' action_block { } // // IEEE: cover_property_statement | yCOVER yPROPERTY '(' property_spec ')' stmtBlock { $$ = new AstCover($1, $4, $6, false); } diff --git a/test_regress/t/t_assert_property.v b/test_regress/t/t_assert_property.v index 797a48b52..f530048b2 100644 --- a/test_regress/t/t_assert_property.v +++ b/test_regress/t/t_assert_property.v @@ -38,13 +38,17 @@ module Test `ifdef FAIL_ASSERT_1 assert property (@(posedge clk) cyc==3) else $display("cyc != 3, cyc == %0d", cyc); + assume property (@(posedge clk) cyc==3) + else $display("cyc != 3, cyc == %0d", cyc); `endif `ifdef FAIL_ASSERT_2 assert property (@(posedge clk) cyc!=3); + assume property (@(posedge clk) cyc!=3); `endif assert property (@(posedge clk) cyc < 100); + assume property (@(posedge clk) cyc < 100); restrict property (@(posedge clk) cyc==1); // Ignored in simulators