Skip to content

Commit f302ae3

Browse files
authored
Merge pull request #1237 from diffblue/cycle_delay_star4
Tests for `##[*]` and `##[+]` with LHS
2 parents 897cb8c + a89e5c7 commit f302ae3

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
cycle_delay_plus4.sv
3+
--bound 10
4+
^\[main\.p0\] main\.x == 0 ##\[\+\] main\.x == 1: PROVED up to bound 10$
5+
^\[main\.p1\] main\.x == 0 ##\[\+\] main\.x == 2: PROVED up to bound 10$
6+
^\[main\.p2\] main\.x == 1 ##\[\+\] main\.x == 1: REFUTED$
7+
^\[main\.p3\] main\.x == 0 ##\[\+\] main\.x == 6: PROVED up to bound 10$
8+
^EXIT=10$
9+
^SIGNAL=0$
10+
--
11+
^warning: ignoring
12+
--
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module main;
2+
3+
reg [31:0] x;
4+
wire clk;
5+
6+
initial x=0;
7+
8+
always @(posedge clk)
9+
if(x < 5)
10+
x<=x+1;
11+
12+
// Should pass
13+
initial p0: assert property (x==0 ##[+] x==1);
14+
initial p1: assert property (x==0 ##[+] x==2);
15+
16+
// Should fail
17+
initial p2: assert property (x==1 ##[+] x==1);
18+
19+
// Shoud pass, owing to weak sequence semantics
20+
initial p3: assert property (x==0 ##[+] x==6);
21+
22+
endmodule
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE
2+
cycle_delay_star4.sv
3+
--bound 10
4+
^\[main\.p0\] main\.x == 0 ##\[\*\] main\.x == 0: PROVED up to bound 10$
5+
^\[main\.p1\] main\.x == 0 ##\[\*\] main\.x == 1: PROVED up to bound 10$
6+
^\[main\.p2\] main\.x == 0 ##\[\*\] main\.x == 2: PROVED up to bound 10$
7+
^\[main\.p3\] main\.x == 1 ##\[\*\] main\.x == 1: REFUTED$
8+
^\[main\.p4\] main\.x == 0 ##\[\*\] main\.x == 6: PROVED up to bound 10$
9+
^EXIT=10$
10+
^SIGNAL=0$
11+
--
12+
^warning: ignoring
13+
--
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module main;
2+
3+
reg [31:0] x;
4+
wire clk;
5+
6+
initial x=0;
7+
8+
always @(posedge clk)
9+
if(x < 5)
10+
x<=x+1;
11+
12+
// Should pass
13+
initial p0: assert property (x==0 ##[*] x==0);
14+
initial p1: assert property (x==0 ##[*] x==1);
15+
initial p2: assert property (x==0 ##[*] x==2);
16+
17+
// Should fail
18+
initial p3: assert property (x==1 ##[*] x==1);
19+
20+
// Shoud pass, owing to weak sequence semantics
21+
initial p4: assert property (x==0 ##[*] x==6);
22+
23+
endmodule

0 commit comments

Comments
 (0)