Professional Documents
Culture Documents
Introduction to SVA
Harry Foster
Chief Scientist Verification
info@verificationacademy.com | www.verificationacademy.com
Session Overview
After completing this session you will. . .
Learn the structure of the SVA language
Lean how to construct sequence
Lean how to construct properties
Arbiter
grant0
grant1
req1
// Assert that the grants for our simple arbiter are mutually exclusive
2014 Mentor Graphics Corporation, all rights reserved.
Arbiter
grant0
grant1
req1
Error
Condition
Boolean
Expression
...
endmodule
2014 Mentor Graphics Corporation, all rights reserved.
assert property ( @(posedge clk) disable iff (rst_n) !(grant0 & grant1));
2014 Mentor Graphics Corporation, all rights reserved.
Checker packaging
Directives
(assert, cover)
Properties
Sequences
(Sequential Expressions)
Boolean Expressions
clk
Directives
(assert, cover)
Properties
rst_n
Sequences
(Sequential Expressions)
Boolean Expressions
error
clk
Directives
(assert, cover)
Properties
rst_n
Sequences
(Sequential Expressions)
Boolean Expressions
error
clk
Directives
(assert, cover)
Properties
rst_n
Sequences
(Sequential Expressions)
Boolean Expressions
error
Assertion
Units
Directives
(assert, cover)
Properties
Sequences
(Sequential Expressions)
Boolean Expressions
[*0:$] represents
zero to infinity
start[=2] !start[*0:$] ##1 start ##1 !start[*0:$] ##1 start ##1 !start[*0:$]
2014 Mentor Graphics Corporation, all rights reserved.
[*0:$] represents
zero to infinity
Directives
(assert, cover)
Properties
Sequences
(Sequential Expressions)
Boolean Expressions
gnt[0]
Arbiter
gnt[1]
clk
req[0]
req[1]
Arbiter
gnt[0]
gnt[1]
req[0]
gnt[0]
gnt[1]
2014 Mentor Graphics Corporation, all rights reserved.
$onehot0 (<expression>)
$isunknown (<expression>)
clk
start
transfer
Introduction to SVA
Some assertions require additional modeling code
In addition to the assertion constructs
clk
rst_n
FIFO
Controller
put
get
clk
rst_n
data_in
data_out
full
empty
Introduction to SVA
// assertion modeling code not part of the design
`ifdef ASSERT_ON
int cnt = 0;
always @(posedge clk)
if (!rst_n)
cnt <= 0;
else
cnt <= cnt + put get;
// assert no overflow
assert property (@posedge clk disable iff (!rst_n) !((cnt + put) < get));
`endif
2014 Mentor Graphics Corporation, all rights reserved.
Session Recap
In this session we discussed. . .
The structure of the SVA language
How to construct sequences
How to construct properties
Other Resources
Assertion-Based Design
Creating Assertion-Based IP
Harry Foster, Adam Krolnik
Springer, 2008
Assertion-Based Verification
Introduction to SVA
Harry Foster
Chief Scientist Verification
info@verificationacademy.com | www.verificationacademy.com