Skip to content

SystemVerilog: grammar for expect property #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions regression/verilog/SVA/expect1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
expect1.sv

^file expect1.sv line \d+: synthesis of expect property not supported$
^EXIT=2$
^SIGNAL=0$
--
^warning: ignoring
--
8 changes: 8 additions & 0 deletions regression/verilog/SVA/expect1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module main;

reg [31:0] x;
wire clk;

initial expect (x==0);

endmodule
1 change: 1 addition & 0 deletions src/hw_cbmc_irep_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ IREP_ID_ONE(verilog_assert_property)
IREP_ID_ONE(verilog_assume_property)
IREP_ID_ONE(verilog_cover_property)
IREP_ID_ONE(verilog_covergroup)
IREP_ID_ONE(verilog_expect_property)
IREP_ID_ONE(verilog_smv_assert)
IREP_ID_ONE(verilog_smv_assume)
IREP_ID_ONE(verilog_always)
Expand Down
5 changes: 5 additions & 0 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,10 @@ cover_property_statement: TOK_COVER TOK_PROPERTY '(' property_spec ')' action_bl
{ init($$, ID_verilog_cover_property); mto($$, $4); mto($$, $6); }
;

expect_property_statement: TOK_EXPECT '(' property_spec ')' action_block
{ init($$, ID_verilog_expect_property); mto($$, $3); mto($$, $5); }
;

assertion_item_declaration:
property_declaration
;
Expand Down Expand Up @@ -2876,6 +2880,7 @@ statement_item:
| seq_block
| wait_statement
| procedural_assertion_statement
| expect_property_statement
;

function_statement: statement
Expand Down
3 changes: 2 additions & 1 deletion src/verilog/verilog_elaborate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ void verilog_typecheckt::collect_symbols(const verilog_statementt &statement)
else if(
statement.id() == ID_verilog_assert_property ||
statement.id() == ID_verilog_assume_property ||
statement.id() == ID_verilog_cover_property)
statement.id() == ID_verilog_cover_property ||
statement.id() == ID_verilog_expect_property)
{
}
else if(
Expand Down
5 changes: 5 additions & 0 deletions src/verilog/verilog_synthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,11 @@ void verilog_synthesist::synth_statement(
synth_assert_assume_cover(
to_verilog_assert_assume_cover_statement(statement));
}
else if(statement.id() == ID_verilog_expect_property)
{
throw errort().with_location(statement.source_location())
<< "synthesis of expect property not supported";
}
else if(statement.id()==ID_non_blocking_assign)
synth_assign(statement, false);
else if(statement.id()==ID_force)
Expand Down
3 changes: 3 additions & 0 deletions src/verilog/verilog_typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,9 @@ void verilog_typecheckt::convert_statement(
convert_assert_assume_cover(
to_verilog_assert_assume_cover_statement(statement));
}
else if(statement.id() == ID_verilog_expect_property)
{
}
else if(
statement.id() == ID_verilog_immediate_assume ||
statement.id() == ID_verilog_assume_property ||
Expand Down