Skip to content

Commit 6dde22a

Browse files
authored
Merge pull request #1068 from diffblue/cover_sequence1
bugfix for SVA cover
2 parents d28c28c + b871008 commit 6dde22a

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
cover_sequence1.sv
3+
--bound 10 --numbered-trace
4+
^\[main\.p0\] cover \(main\.x == 2 ##1 main\.x == 3 ##1 main\.x == 4\): PROVED$
5+
^Trace with 5 states:$
6+
^\[main\.p1\] cover \(main\.x == 2 ##1 main\.x == 3 ##1 main\.x == 5\): REFUTED up to bound 10$
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring
11+
--
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module main(input clk);
2+
3+
// count up
4+
reg [7:0] x = 0;
5+
6+
always @(posedge clk)
7+
x++;
8+
9+
// expected to pass
10+
p0: cover property (x==2 ##1 x==3 ##1 x==4);
11+
12+
// expected to fail
13+
p1: cover property (x==2 ##1 x==3 ##1 x==5);
14+
15+
endmodule

src/temporal-logic/normalize_property.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ exprt normalize_property(exprt expr)
119119
{
120120
// top-level only
121121
if(expr.id() == ID_sva_cover)
122-
expr = G_exprt{not_exprt{to_sva_cover_expr(expr).op()}};
122+
expr = sva_always_exprt{not_exprt{to_sva_cover_expr(expr).op()}};
123123

124124
expr = trivial_sva(expr);
125125

src/temporal-logic/normalize_property.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Author: Daniel Kroening, [email protected]
3434
/// weak(φ) --> φ
3535
/// ¬ sva_s_eventually φ --> sva_always ¬φ
3636
/// ¬ sva_always φ --> sva_s_eventually ¬φ
37+
/// cover φ --> sva_always_exprt ¬φ
3738
///
3839
/// ----LTL-----
3940
/// ¬Xφ --> X¬φ

0 commit comments

Comments
 (0)