9 2
9 2
9 2
Assertion-Based Verification
Harry Foster
Chief Scientist Verification
[email protected] | www.verificationacademy.com
Outline
Assertion-Based Verification
Conclusions
2 H Foster, EE 382M-11, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
What is Verification?
4 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Simulation-Based Techniques
Simulation Testbench
Measure Coverage
// SystemVerilog Assertion
property p_comp;
initial @(posedge clk)
state E |-> (A==B);
endproperty
assert property (p_comp);
6 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
// SystemVerilog Assertion
1000000011101011011011110111
A [31:0]
property p_comp;
@(posedge clk)
E
E |-> (A==B);
endproperty
101010001000110101110100101
B [31:0]
assert property (p_comp);
7 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
8 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Formal-Based Techniques
No
Design
Assertions
Model
9 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Tx x
a
Tx(a,x,y) // next state
y
10 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
initial
states
// SystemVerilog Assertion
property p_comp;
@(posedge clk)
E |-> (A==B);
endproperty
assert property (p_comp);
Very fast!
11 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
12 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
INDUSTRY DRIVERS
Rising Design Complexity
70
60
50
40
30
20
10
0
2007 2008 2009 2010 2011 2012 2013 2014 2015* 2016* 2017* 2018*
Avg. Number of 'Other' SIP Blocks Avg. Number of CPU / DSP / Controllers
15 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
10,000,000,000,000
1,000,000,000,000
100,000,000,000
Quantity
10,000,000,000
1,000,000,000
100,000,000
10,000,000
1,000,000
100,000
10,000
16 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
1.E+03
Growth of Transistor Volume Leads to
1.E+02
Sustained ~ 30% per Year Cost Reduction
Revenue/Transistor ($)
1.E+01
1.E+00
1.E-01
1.E-02
1.E-03
1.E-04
1.E-05
1.E-06
1.E-10
1.0E+04 1.0E+06 1.0E+08 1.0E+10 1.0E+12 1.0E+14 1.0E+16 1.0E+18 1.0E+20
18 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
1.00E-05 1.00E-05
IC Revenue/Transistor ($)
EDA Cost/Transistor ($)
1.00E-06 1.00E-06
1.00E-07 1.00E-07
1.00E-08 1.00E-08
1.00E-09 1.00E-09
1.00E+13 1.00E+14 1.00E+15 1.00E+16 1.00E+17 1.00E+18 1.00E+19 1.00E+20
19 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
10
10.48
10.05
8
8.53
8.10
7.80
Design Engineers
6
0
2007 2010 2012 2014 2016
20 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
10 11.0
10.48
10.05
8
8.4
8.53
8.10
7.80 7.6
Design Engineers
6
Verification Engineers
4 4.8
0
2007 2010 2012 2014 2016
21 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
INDUSTRY DRIVERS
Rising Verification Complexity
Software
Security Domains
Verification Layers
Power Domains
Clock Domains
Functional
23 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Channel
TX Data Link Layer PHY
Encoder Decoder
Compressed RX
Audio
Directed-Test Approach
25 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Directed-Test Approach
27 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
28 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
29 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Packet-Based Design
Transaction
Tx Layer Packet
From
Fabric Reformater
To
Arbiter PHY
Retry Buffer
Data Link
Layer Packet
Reformater
Rx
From Rx
Channel
30 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Code coverage
Assertions 2007
2012
2014
Functional
coverage
Constrained-
Random Simulation
31 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
DUT
A
A
0010100101010001110101001110101010100000000011101011011011110111
1. Activate
A 3. Detect
Stimulus A 2. Propagate
Checkers
A = Assertions
33 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
bug
A
1 0
1
0
35 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Testbench
36 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Test Planning
37%
Testbench Development
3%
Other
22%
Source: Wilson Research Group and Mentor Graphics, 2014 Functional Verification Study
37 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
60%
Mean time design engineer spends in
Doing Design
Doing Verification
design vs. verification
55% 53%
51%
54% 53%
50%
45%
47%
40%
2007 2010 2012 2014
Source: Wilson Research Group and Mentor Graphics, 2014 Functional Verification Study
38 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
ASSERTION-BASED VERIFICATION
Assertion-Based Verification
easily flows.
Alan Turing, 1949
40 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Property
Property Testbench
a statement of design intent test
used to specify behavior
env
DUT
41 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Assertion
Property Testbench
a statement of design intent test
used to specify behavior
env
Assertion
A verification directive
Trace from
simulation
DUT
42 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
High-Level Assertion
Property Testbench
a statement of design intent test
used to specify behavior
env
Assertion
A verification directive
High-level
Architectural focused
Can be part of testbench
Trace from
simulation
DUT
43 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Low-Level Assertion
Property
a statement of design intent
used to specify behavior
Assertion RTL
A verification directive
A
High-level
Architectural focused
Can be part of testbench A
Low-level
Implementation focused // Assert that the FIFO controller
Embedded in or bind to the RTL // cannot overflow nor underflow
44 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
RTL
improved
bug rate
FPGA or
Formal
Emulation
Props
Assertions
passing tests
45 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
46 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
47 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
48 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
clk
grant0
reset_n
Arbiter grant1
req0
req1
// Assert that the grants for our simple arbiter are mutually exclusive
49 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
clk
grant0
reset_n
Arbiter grant1
req0
req1
50 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
51 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
50%
40%
30%
20%
10%
0%
Accellera Open SystemVerilog PSL Other
Verification Library Assertions (SVA)
(OVL)
Assertion Languages and Libraries * Multiple answers possible
Source: Wilson Research Group and Mentor Graphics, 2014 Functional Verification Study
52 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
clk
grant0
grant1
error
assert property ( @(posedge clk) disable iff (~rst_n) !(grant0 & grant1));
53 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
clk
grant0
grant1
error
54 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
clk
grant0
grant1
error
55 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Percentage bugs found by various techniques 17% of bugs found by assertions on Cyrix M3(p1) project
Assertion Monitors 34% [Krolnik '98]
Cache Coherency Checkers 9%
Register File Trace Compare 8%
Memory State Compare 7%
End-of-Run State Compare 6% 50% of bugs found by assertions on Cyrix M3(p2) project
PC Trace Compare 4%
Self-Checking Test 11% [Krolnik 98]
Simulation Output Inspection 7%
Simulation Hang 6%
Other 8%
85% of bugs found using over 4000 assertions on an HP
Kantrowitz and Noack [DAC 1996]
server chipset project
[Foster and Coelho HDLCon 2001]
57 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Low-level
Interface
High-level
58 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
8 Sim + Assert
6 Sim + None
4
2
0
Formal Sim + Assert Sim + None
59 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
SUMMARY
Assertion-Based Verification
61 H Foster, EE 382M, Verification of Digital Systems, Spring 2017 Mentor Graphics Corporation, all rights reserved.
Assertion-Based Verification
Harry Foster
[email protected] | www.verificationacademy.com