assertion-based verificationjaa/verification/lectures/9-2.pdf · bus traffic controller dma...
TRANSCRIPT
Presentation Title
Your Initials, Presentation Title, Month Year1
© Mentor Graphics Corporation
Harry D. Foster
Assertion-Based Verification
Chief Scientist Verification
IC Verification Solutions Division
February 2020
© Mentor Graphics Corporation
Outline
Industry Pulse
How Verification is Done Today
What Makes Verification Difficult
Observability and Controllability Challenge
Assertion-Based Verification
Industry Case Studies
Summary
H Foster, EE 382M-11, Verification of Digital Systems, Spring 2018 2
2 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Worldwide IC Market Growth
-9%
19%
35%
-33%
2%
16%
28%
8% 9%
4%
-6%
-10%
33%
1%
-4%
5%7%
-2%
3%
25%
14%
-15%
8% 10%12%
16%
-40%
-30%
-20%
-10%
0%
10%
20%
30%
40%
50%
98 99 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20F 21F 22F 23F
IC M
ark
et
Ch
an
ge
Year
Source: IC Insight, The McClean Report 2020 (January), A Complete Analysis and Forecast of the Integrated Circuit Industry
HF, UT Austin, May 20203
© Mentor Graphics Corporation
Largest IC Product CategoriesDecline in the DRAM an NAND flash memory markets for 2019
HF, UT Austin, May 20204
$99.4
$53.8
$59.4
$27.3 $23.6
$62.0
$52.5
$40.6
$25.4$22.2
$-
$20.0
$40.0
$60.0
$80.0
$100.0
DRAM PC/Server MPUs NAND Flash Special Purpose Logic Cellular MPUs
IC R
eve
nue (
$M
)
2018
2019
Source: IC Insight, The McClean Report 2020 (January), A Complete Analysis and Forecast of the Integrated Circuit Industry
Presentation Title
Your Initials, Presentation Title, Month Year2
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Overall World Wide Semiconductor Market
$364.00
$444.70
$504.10
$442.30
$0
$100
$200
$300
$400
$500
2016 2017 2018 2019
Sem
iconduct
or M
ark
et
($B)
HF, UT Austin, May 20205
Source: IC Insight, The McClean Report 2020 (January), A Complete Analysis and Forecast of the Integrated Circuit Industry
© Mentor Graphics Corporation
Global FPGA Market
$4.70
$8.80
$0.00
$2.00
$4.00
$6.00
$8.00
$10.00
2017 2027F
FPG
A M
ark
et ($
B)
HF, UT Austin, May 20206
Source: IBS, Semiconductor Market Analysis, 2017 Review, 2018 Projections, February 14, 2018
© Mentor Graphics Corporation
FPGA Applications
HF, UT Austin, May 20207
Telecommunications
Data Processing Automotive Mil/Aero
Consumer Industrial
© Mentor Graphics Corporation
HOW VERIFICATION IS DONE TODAY
Presentation Title
Your Initials, Presentation Title, Month Year3
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Verification is a process of ensuring that a design
implementation meets its specification.
What is Verification?
H Foster, EE 382M, Verification of Digital Systems, Spring 20189
9 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Simulation-Based Techniques
—Fundamental verification technique in use today—Generally scales well—Testing all possible states is generally incomplete
Simulation Testbench
DesignModel
GenerateStimulus
CheckResults
Measure Coverage
Assertions can be used to check results and measure coverage
H Foster, EE 382M, Verification of Digital Systems, Spring 201810
10 HF, UT Austin, May 2020
© Mentor Graphics Corporation
initial state
Simulation Traversal Through the State Space
// SystemVerilog Assertion
property p_comp;
@(posedge clk)
E |-> (A==B);
endproperty
assert property (p_comp);
H Foster, EE 382M, Verification of Digital Systems, Spring 201811
11 HF, UT Austin, May 2020
© Mentor Graphics Corporation
1000000011101011011011110111
101010001000110101110100101
264 vectors X 1 vector every micro-second = 584,941 years
Time Explosion Problem
How long would it take to exhaustively simulate this example?
E
An extremely fast simulator by today’s standards!
B [31:0]
A [31:0]// SystemVerilog Assertion
property p_comp;
@(posedge clk)
E |-> (A==B);
endproperty
assert property (p_comp);
H Foster, EE 382M, Verification of Digital Systems, Spring 201812
12 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year4
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Simulation and the Time Explosion Problem
H Foster, EE 382M, Verification of Digital Systems, Spring 201813
13 HF, UT Austin, May 2020
264 vectors X 1 vector every micro-second = 584,941 years
© Mentor Graphics Corporation
Formal-Based Techniques
— Does not require a testbench or input stimulus!
— Automatically uses algorithms to verify the functionality
— Verification can be complete
— Complements simulation-based techniques
Pass?
FormalTool
DesignModel
Assertions
DoneYes
No
H Foster, EE 382M, Verification of Digital Systems, Spring 201814
14 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Conceptual Formal Tool
Tx(a,x,y) // next stateax
y
z
Tx
H Foster, EE 382M, Verification of Digital Systems, Spring 201815
15 HF, UT Austin, May 2020
© Mentor Graphics Corporation
initial states
Very fast!
How is formal different than simulation?
// SystemVerilog Assertion
property p_comp;
@(posedge clk)
E |-> (A==B);
endproperty
assert property (p_comp);
H Foster, EE 382M, Verification of Digital Systems, Spring 201816
16 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year5
© Mentor Graphics Corporation
© Mentor Graphics Corporation
State Space Explosion
There are more states in today’s design than there are atoms in the universe!
H Foster, EE 382M, Verification of Digital Systems, Spring 201817
How many states exist in a
typical design today?
17 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Time and State Space Explosion
Simulation suffers from time explosion
Formal suffers from state explosion
Together they complement each other
H Foster, EE 382M, Verification of Digital Systems, Spring 201818
18 HF, UT Austin, May 2020
© Mentor Graphics Corporation
WHAT MAKES VERIFICATION DIFFICULT
© Mentor Graphics Corporation
INDUSTRY DRIVERSRising Design Complexity
Presentation Title
Your Initials, Presentation Title, Month Year6
© Mentor Graphics Corporation
© Mentor Graphics Corporation
ASIC: Mean Peak Number of Engineers on a Project
7.88.1
8.5
10.110.5 10.5
7.6
8.4
11.011.6
11.0
0.0
2.0
4.0
6.0
8.0
10.0
12.0
2007 2010 2012 2014 2016 2018
Desi
gn P
roje
cts
Mean Peak Number of Engineers on ASIC Projects
Design Engineers
HF, UT Austin, May 202021
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study
© Mentor Graphics Corporation
ASIC: Mean Peak Number of Engineers on a Project
7.88.1
8.5
10.110.5 10.5
4.8
7.6
8.4
11.011.6
11.0
0.0
2.0
4.0
6.0
8.0
10.0
12.0
2007 2010 2012 2014 2016 2018
Desi
gn P
roje
cts
Mean Peak Number of Engineers on ASIC Projects
Design Engineers
Verification Engineers
HF, UT Austin, May 202022
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study
© Mentor Graphics Corporation
INDUSTRY DRIVERS
Rising Verification Complexity
© Mentor Graphics Corporation
The Emergence of New Layers of Verification
HF, UT Austin, May 202024
H Foster, Honeywell, Sept 201624
Re
qu
ire
me
nts
Functionality
Clocking
Power
Security & Safety
Performance
Software
Presentation Title
Your Initials, Presentation Title, Month Year7
© Mentor Graphics Corporation
© Mentor Graphics Corporation
What Makes Verification Difficult?
Single, sequential data streams
— Floating point unit
— Graphics shading unit
— DSP convolution unit
— MPEG decode
— . . .
Multiple, concurrent data streams
— Cross bar
— Bus traffic controller
— DMA controller
— Standard I/F (e.g., PCIe)
— . . .
Channel
Compressed
Audio
Data Link LayerTX
RX
PHY
Sequential data streams1x number of bugs
Concurrent data streams5x number of bugs
Encoder Decoder
-Ted Scardamalia, internal IBM study
H Foster, EE 382M, Verification of Digital Systems, Spring 201825
25 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Imagine verifying a car using a directed-test approach
—Requirement: Fuse will not blow under any normal operation
—Scenario 1: accelerate to 37 mph, pop in the new
Billie Eilish CD, and turn on the windshield wipers
Directed-Test Approach
H Foster, EE 382M, Verification of Digital Systems, Spring 201826
26 HF, UT Austin, May 2020
© Mentor Graphics Corporation
A FEW WEEKS LATER…
© Mentor Graphics Corporation
Imagine verifying a car using a directed-test approach—Requirement: Fuse will not blow under any normal operation
—Scenario 714: accelerate to 48 mph, roll down the window,
and turn on the left-turn signal
Directed-Test Approach
H Foster, EE 382M, Verification of Digital Systems, Spring 201828
28 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year8
© Mentor Graphics Corporation
© Mentor Graphics Corporation
A purely directed-test methodology does not scale
— Imagine writing a directed test for this scenario!
— Truly heroic effort—but not practical
The Concurrency Challenge
H Foster, EE 382M, Verification of Digital Systems, Spring 201829
29 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Finding Corner Case Bugs Due to Concurrency
Constrained-random simulation finds the bugs you never anticipated!
Directed-test-based simulation finds the bugs you can think of…
H Foster, EE 382M, Verification of Digital Systems, Spring 201830
30 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Packet-Based Design
Transaction
Layer Packet
Reformater
Data Link
Layer Packet
Reformater
Retry BufferArbiter
Tx
Rx
FromFabric
ToPHY
From Rx Channel
Concurrency is Complicated to Verify
H Foster, EE 382M, Verification of Digital Systems, Spring 201831
31 HF, UT Austin, May 2020
© Mentor Graphics Corporation
A Maturing Industry to Address Growing Complexity
HF, UT Austin, May 202032
0% 10% 20% 30% 40% 50% 60% 70% 80%
Code coverage
Functional coverage
Assertions
Constrained-Random
Design Projects
2007
2012
2018
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study
Presentation Title
Your Initials, Presentation Title, Month Year9
© Mentor Graphics Corporation
© Mentor Graphics Corporation
OBSERVABILITY & CONTROLLABILITY
© Mentor Graphics Corporation
0010100101010001110101001110101010100000000011101011011011110111
DUT
2. Propagate
1. Activate
Stimulus
3. Detect
Checkers
A
A
A
A
A = Assertions
Fundamental Challenge of Verification
H Foster, EE 382M, Verification of Digital Systems, Spring 201834
34 HF, UT Austin, May 2020
© Mentor Graphics Corporation
0
1
0
1
1
bug
0
Assertions improve observability and reduce the need to propagate bugs
A
Observability vs. Controllability
HF, UT Austin, May 202035
Test didn’t set up the condition to propagate the bug
H Foster, EE 382M, Verification of Digital Systems, Spring 201835 © Mentor Graphics Corporation
Controllability and ObservabilityIn Context of Code Coverage
HF, UT Austin, May 202036
Presentation Title
Your Initials, Presentation Title, Month Year10
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Poor Observability Misses Bugs
HF, UT Austin, May 202037
Code coverage measures controllability
100% code coverage does not mean all bugs are
detected [S. Devadas, A. Ghosh, and K. Keutzer. DAC 1996]
DAC paper study found cases where:
Code Coverage
Achieved
% of covered lines
observable
90% Covered Only 54% Observable
100% Covered Only 70% Observable
H Foster, EE 382M, Verification of Digital Systems, Spring 201837 © Mentor Graphics Corporation
Testbench
Reduce debugging up to 50% [CAV 2000, IBM FoCs paper]
Bugs detected closer to their source due to improved observability
==== Bugs missed due to poor observability
Assertions Improve Observability
H Foster, EE 382M, Verification of Digital Systems, Spring 201838
38 HF, UT Austin, May 2020
© Mentor Graphics Corporation
13%
19%
21%
44%
3%
Test Planning
Testbench Development
Creating Test and Running Simulation
Debug
Other
Where Verification Engineers Spend Their Time
HF, UT Austin, May 202039
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study
© Mentor Graphics Corporation
Mean % Time Design Engineer is Doing Design vs Verification
HF, UT Austin, May 202040
47%53% 54%
53%47% 46%
0%
20%
40%
60%
80%
100%
2014 2016 2018
Desi
gn P
roje
cts
Mean Percentage Time ASIC Design Engineer is Doing Design vs Verification
Doing Design
Doing Verification
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study
Presentation Title
Your Initials, Presentation Title, Month Year11
© Mentor Graphics Corporation
© Mentor Graphics Corporation
ASSERTION-BASED VERIFICATION
© Mentor Graphics Corporation
Assertion-Based Verification
“How can one check a large routine in the
sense of making sure that it’s right? In
order that the man who checks may not
have too difficult a task, the programmer
should make a number of definite
assertions which can be checked
individually, and from which the
correctness of the whole program easily
flows.”Alan Turing, 1949
H Foster, EE 382M, Verification of Digital Systems, Spring 201842
42 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Testbench
test
env
DUT
Property
Property
— a statement of design intent
— used to specify behavior
H Foster, EE 382M, Verification of Digital Systems, Spring 201843
43 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Trace from simulation
Testbench
test
env
DUT
A
Assertion
Property
— a statement of design intent
— used to specify behavior
Assertion
— A verification directive
H Foster, EE 382M, Verification of Digital Systems, Spring 201844
44 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year12
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Trace from simulation
Testbench
test
env
DUT
A
High-Level Assertion
Property
— a statement of design intent
— used to specify behavior
Assertion
— A verification directive
High-level
— Architectural focused
— Can be part of testbench
H Foster, EE 382M, Verification of Digital Systems, Spring 201845
45 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Low-Level Assertion
Property
— a statement of design intent
— used to specify behavior
Assertion
— A verification directive
High-level
— Architectural focused
— Can be part of testbench
Low-level
— Implementation focused
— Embedded in or bind to the RTL // Assert that the FIFO controller
// cannot overflow nor underflow
RTL
A
A
H Foster, EE 382M, Verification of Digital Systems, Spring 201846
46 HF, UT Austin, May 2020
© Mentor Graphics Corporation
[Foster, Larsen, Turpin - DVCon 2006]
How Assertions Are Used Today
H Foster, EE 382M, Verification of Digital Systems, Spring 201847
SimulationFormal Verification
FormalProp’s
passing tests
O/S Trials
Testbench
RTL
FPGA or
Emulation
improved bug rate
Assertions
State Search
47 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Who should create the assertions?
High-Level Assertions
Requirement focused
Black-box assertions
Accounted for in testplan
Compliance traceability
Create reusable ABV IP
Low-Level Assertions
Implementation focused
White-box assertions
Not accounted for in
testplan
Improve observability
Reduce debugging time
Verification Engineer Design Engineer
H Foster, EE 382M, Verification of Digital Systems, Spring 201848
48 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year13
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Who should create high-level assertions?
High-Level Assertions
Requirement focused
Black-box assertions
Accounted for in testplan
Compliance traceability
Create reusable ABV IP
Low-Level Assertions
Implementation focused
White-box assertions
Not accounted for in
testplan
Improve observability
Reduce debugging time
Verification Engineer Design Engineer
H Foster, EE 382M, Verification of Digital Systems, Spring 201849
49 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Who should create low-level assertions?
High-Level Assertions
Requirement focused
Black-box assertions
Accounted for in testplan
Compliance traceability
Create reusable ABV IP
Low-Level Assertions
Implementation focused
White-box assertions
Not accounted for in
testplan
Improve observability
Reduce debugging time
Verification Engineer Design Engineer
H Foster, EE 382M, Verification of Digital Systems, Spring 201850
50 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Specifying Design Intent
Assertions allow us to specify design intent
in a way that lends itself to automation
// Assert that the grants for our simple arbiter are mutually exclusive
Arbiter
req0
req1
clk
reset_ngrant0
grant1
H Foster, EE 382M, Verification of Digital Systems, Spring 201851
51 HF, UT Austin, May 2020
© Mentor Graphics Corporation
(grant0 & grant1) // error condition
Arbiter
req0
req1
clk
reset_ngrant0
grant1
For our arbiter example, we can write a Boolean expression for the error condition, as follows:
Identifying the Error Condition
H Foster, EE 382M, Verification of Digital Systems, Spring 201852
52 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year14
© Mentor Graphics Corporation
© Mentor Graphics Corporation
Checking the Error Condition before Assertions
HF, UT Austin, May 202053
Doesn’t lend itself to automation.
module arbiter (clk, rst_n, req0, req1, grant0, grant1);
. . .
always @(posedge clk or negedge rst_n) begin
if (rst_n != 1’b0) // active low reset
if (grant0 & grant1)
$display (“ERROR: Grants not mutex”);
. . .
endmodule
ErrorConditionBoolean
Expression
H Foster, EE 382M, Verification of Digital Systems, Spring 201853 © Mentor Graphics Corporation
ASIC: Assertion Language Adoption
HF, UT Austin, May 202054
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
Accellera Open VerificationLibrary (OVL)
SystemVerilog Assertions(SVA)
PSL Other
Desi
gn P
roje
cts
ASIC Assertion Language Adoption
2014
2016
2018
Next Year
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study * Multiple answers possible
© Mentor Graphics Corporation
FPGA: Assertion Language Adoption
HF, UT Austin, May 202055
0%
10%
20%
30%
40%
50%
60%
Accellera Open VerificationLibrary (OVL)
SystemVerilog Assertions(SVA)
PSL Other
FPGA Assertion Language Adoption
2014
2016
2016
Next Year
Source: Wilson Research Group and Mentor, A Siemens Business, 2018 Functional Verification Study * Multiple answers possible
© Mentor Graphics Corporation
error
assert property ( @(posedge clk) disable iff (~rst_n) !(grant0 & grant1));
grant0 and grant1 must be mutually exclusive
IEEE 1800 SystemVerilog Mutex Example
grant0
clk
grant1
H Foster, EE 382M, Verification of Digital Systems, Spring 201856
56 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year15
© Mentor Graphics Corporation
© Mentor Graphics Corporation
IEEE 1850 PSL Mutex Example
error
assert always (!(grant0 & grant1) abort ~rst_n) @(posedge clk);
grant0 and grant1 must be mutually exclusive
grant0
clk
grant1
H Foster, EE 382M, Verification of Digital Systems, Spring 201857
57 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Accellera OVL Mutex Example
error
ovl_never a_mutex (clk, rst_n, (grant0 & grant1));
grant0 and grant1 must be mutually exclusive
grant0
clk
grant1
H Foster, EE 382M, Verification of Digital Systems, Spring 201858
58 HF, UT Austin, May 2020
© Mentor Graphics Corporation
INDUSTRY CASE STUDIES
© Mentor Graphics Corporation
Kantrowitz and Noack [DAC 1996]
Taylor et al. [DAC 1998]
Assertion Monitors 34%Cache Coherency Checkers 9%Register File Trace Compare 8%Memory State Compare 7%End-of-Run State Compare 6%PC Trace Compare 4%Self-Checking Test 11%Simulation Output Inspection 7%Simulation Hang 6%Other 8%
Assertion Monitors 25%Register Miscompare 22%Simulation "No Progress” 15%PC Miscompare 14%Memory State Miscompare 8%Manual Inspection 6%Self-Checking Test 5%Cache Coherency Check 3%SAVES Check 2%
Published Data on Assertions Use
17% of bugs found by assertions on Cyrix M3(p1) project
[Krolnik '98]
50% of bugs found by assertions on Cyrix M3(p2) project
[Krolnik ‘98]
85% of bugs found using over 4000 assertions on an HP server
chipset project
[Foster and Coelho HDLCon 2001]
Thousands of assertions in Intel Pentium project
[Bentley 2001]
10,000 OVL assertion in Cisco project
[Sean Smith 2002]
Percentage bugs found by various techniques
H Foster, EE 382M, Verification of Digital Systems, Spring 201860
60 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year16
© Mentor Graphics Corporation
© Mentor Graphics Corporation
DAC 2008 Sun paper with lots of metrics
Category Unique Instantiated
Low-Level 3912 132773
Interface 5004 44756
High-Level 1930 18618
Bugs Found by Type of Assertion
Low-level
Interface
High-level
Assertion-Based Verification of a 32 thread SPARC™ CMT Processor[Turumella, Sharma, DAC 2008]
H Foster, EE 382M, Verification of Digital Systems, Spring 201861
61 HF, UT Austin, May 2020
© Mentor Graphics Corporation
Significant reduction in debugging time
0
2
4
6
8
10
12
14
16
Formal Sim + Assert Sim + None
Ho
urs
Average Debug Time
Formal
Sim + Assert
Sim + None
>50%85%
Category Unique Instantiated
Low-Level 3912 132773
Interface 5004 44756
High-Level 1930 18618
H Foster, EE 382M, Verification of Digital Systems, Spring 201862
62 HF, UT Austin, May 2020
Assertion-Based Verification of a 32 thread SPARC™ CMT Processor[Turumella, Sharma, DAC 2008]
© Mentor Graphics Corporation
SUMMARY
© Mentor Graphics Corporation
Assertion-Based Verification
The process of creating assertions forces the engineer to think. . . and in this incredible world of automation, there is no substitute for thinking.
H Foster, EE 382M, Verification of Digital Systems, Spring 201864
64 HF, UT Austin, May 2020
Presentation Title
Your Initials, Presentation Title, Month Year17
© Mentor Graphics Corporation
© Mentor Graphics Corporation
For Additional Info on Industry Trends
HF, UT Austin, May 202065
Latest Wilson Research Group Functional Verification Study
— Verification Horizon Blog
— http://go.mentor.com/558dr
© Mentor Graphics Corporation
www.mentor.com