Skip to content

Commit aa87b44

Browse files
authored
Merge pull request #558 from diffblue/verilog_expect_property
SystemVerilog: grammar for expect property
2 parents 32c465a + 4c0507d commit aa87b44

File tree

7 files changed

+33
-1
lines changed

7 files changed

+33
-1
lines changed

regression/verilog/SVA/expect1.desc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
expect1.sv
3+
4+
^file expect1.sv line \d+: synthesis of expect property not supported$
5+
^EXIT=2$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
9+
--

regression/verilog/SVA/expect1.sv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module main;
2+
3+
reg [31:0] x;
4+
wire clk;
5+
6+
initial expect (x==0);
7+
8+
endmodule

src/hw_cbmc_irep_ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ IREP_ID_ONE(verilog_assert_property)
101101
IREP_ID_ONE(verilog_assume_property)
102102
IREP_ID_ONE(verilog_cover_property)
103103
IREP_ID_ONE(verilog_covergroup)
104+
IREP_ID_ONE(verilog_expect_property)
104105
IREP_ID_ONE(verilog_smv_assert)
105106
IREP_ID_ONE(verilog_smv_assume)
106107
IREP_ID_ONE(verilog_always)

src/verilog/parser.y

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,10 @@ cover_property_statement: TOK_COVER TOK_PROPERTY '(' property_spec ')' action_bl
20302030
{ init($$, ID_verilog_cover_property); mto($$, $4); mto($$, $6); }
20312031
;
20322032

2033+
expect_property_statement: TOK_EXPECT '(' property_spec ')' action_block
2034+
{ init($$, ID_verilog_expect_property); mto($$, $3); mto($$, $5); }
2035+
;
2036+
20332037
assertion_item_declaration:
20342038
property_declaration
20352039
;
@@ -2876,6 +2880,7 @@ statement_item:
28762880
| seq_block
28772881
| wait_statement
28782882
| procedural_assertion_statement
2883+
| expect_property_statement
28792884
;
28802885

28812886
function_statement: statement

src/verilog/verilog_elaborate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ void verilog_typecheckt::collect_symbols(const verilog_statementt &statement)
620620
else if(
621621
statement.id() == ID_verilog_assert_property ||
622622
statement.id() == ID_verilog_assume_property ||
623-
statement.id() == ID_verilog_cover_property)
623+
statement.id() == ID_verilog_cover_property ||
624+
statement.id() == ID_verilog_expect_property)
624625
{
625626
}
626627
else if(

src/verilog/verilog_synthesis.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,6 +2952,11 @@ void verilog_synthesist::synth_statement(
29522952
synth_assert_assume_cover(
29532953
to_verilog_assert_assume_cover_statement(statement));
29542954
}
2955+
else if(statement.id() == ID_verilog_expect_property)
2956+
{
2957+
throw errort().with_location(statement.source_location())
2958+
<< "synthesis of expect property not supported";
2959+
}
29552960
else if(statement.id()==ID_non_blocking_assign)
29562961
synth_assign(statement, false);
29572962
else if(statement.id()==ID_force)

src/verilog/verilog_typecheck.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,9 @@ void verilog_typecheckt::convert_statement(
14391439
convert_assert_assume_cover(
14401440
to_verilog_assert_assume_cover_statement(statement));
14411441
}
1442+
else if(statement.id() == ID_verilog_expect_property)
1443+
{
1444+
}
14421445
else if(
14431446
statement.id() == ID_verilog_immediate_assume ||
14441447
statement.id() == ID_verilog_assume_property ||

0 commit comments

Comments
 (0)