Skip to content

Commit 1bcee1a

Browse files
committed
Tests for ##[*] and ##[+] with LHS
This adds a test for SVA's ##[*] and ##[+] with an LHS.
1 parent 897cb8c commit 1bcee1a

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
^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;
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+
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
endmodule

0 commit comments

Comments
 (0)