Skip to content

Commit cd769ea

Browse files
authored
Merge pull request #1033 from diffblue/followed-by4
SVA: add a test for followed-by
2 parents 680dd8b + 2438a64 commit cd769ea

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
followed-by4.sv
3+
--bound 3
4+
^\[main\.p1\] always \(main\.x == 0 #-# 1\): REFUTED$
5+
^\[main\.p2\] \(1 or \(##2 1\)\) #-# main\.x == 2: PROVED up to bound 3$
6+
^\[main\.p3\] \(1 or \(##2 1\)\) #-# main\.x == 0: PROVED up to bound 3$
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring
11+
--
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module main(input clk);
2+
3+
reg [31:0] x;
4+
5+
initial x=0;
6+
7+
// 0, 1, ...
8+
always @(posedge clk)
9+
x<=x+1;
10+
11+
// fails in the 2nd timeframe since the LHS doesn't match
12+
p1: assert property (x==0 #-# 1);
13+
14+
// the RHS only needs to hold from _any one_ of the LHS matches,
15+
// not all
16+
initial p2: assert property ((1 or ##2 1) #-# x==2);
17+
initial p3: assert property ((1 or ##2 1) #-# x==0);
18+
19+
endmodule

0 commit comments

Comments
 (0)