Skip to content

Commit 9b69335

Browse files
authored
Merge pull request #764 from diffblue/followed-by3
SVA: add another test for `#-#` and `#=#`
2 parents 2399b56 + c243148 commit 9b69335

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
followed-by3.sv
3+
--bound 20
4+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 10\): PROVED up to bound 20$
5+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #=# \(s_eventually main\.x == 10\): PROVED up to bound 20$
6+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 2\): PROVED up to bound 20$
7+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 11\): REFUTED$
8+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #=# \(s_eventually main\.x == 1\): REFUTED$
9+
^\[.*\] \(main\.x == 0 ##1 main\.x == 2\) #-# 1: REFUTED$
10+
^EXIT=10$
11+
^SIGNAL=0$
12+
--
13+
^warning: ignoring
14+
--
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module main(input clk);
2+
3+
reg [31:0] x;
4+
5+
initial x=0;
6+
7+
// 0, 1, ..., 10
8+
always @(posedge clk)
9+
if(x!=10)
10+
x<=x+1;
11+
12+
// passes
13+
initial p0: assert property (x==0 ##1 x==1 #-# s_eventually x==10);
14+
initial p1: assert property (x==0 ##1 x==1 #=# s_eventually x==10);
15+
initial p2: assert property (x==0 ##1 x==1 #-# s_eventually x==2);
16+
17+
// fails, we don't get to 11
18+
initial p3: assert property (x==0 ##1 x==1 #-# s_eventually x==11);
19+
20+
// fails, we don't go back to 1
21+
initial p4: assert property (x==0 ##1 x==1 #=# s_eventually x==1);
22+
23+
// fails owing to left hand side
24+
initial p5: assert property (x==0 ##1 x==2 #-# 1);
25+
26+
endmodule

0 commit comments

Comments
 (0)