Verification Overview
Verification Overview
Digital Verification
Walter Gude
Applications Engineering Consultant
[email protected]
Presented to the IEEE Long Island Section
Agenda
Verification Overview
www.mentor.com
10M
Static Timing &
Equivalence Checking
1M
100K
Schematic Capture
& Logic Simulation
10K
Transistor-Level
Design
1960s
1970s
1980s
1990s
2000s
www.mentor.com
Time
Design
Gap
Ability to Fabricate
Dominated by feature size
Ability to Design
Dominated by interconnect
Ability to Verify
Dominated by behavior over
time and complexity of
concurrency
www.mentor.com
Integrated
test and
testbench
RTL
Pass
Pass
Fail at
Pass
fasil
Waveforms
Log files
Problem: Creation of directed tests does NOT scale with increased complexity
Problem: Code Coverage does not measure how well specifications are covered.
5
Mentor Graphics Corp.
WG - Feb 2013
www.mentor.com
Percent complete
70%
60%
50%
40%
30%
20%
10%
0%
time
www.mentor.com
Advanced Verification
Functional
Specification
Design
Implementation
Verification Plan
Constraint
Solver
Simulation
Testbench
C-R Testbench
Implementation
N
Y
Assertion
Engine
Functional
Coverage
Sufficient
Coverage?
Done
Coverage-Driven
Verification
Debug
Bug
Found?
Y
Assertion Based
Verification
www.mentor.com
SystemVerilog
Massive enhancements
Assertions
Functional
Coverage
Verilog
2001
Object
Oriented
Programming
Constrained
Randomization
Language
Enhancements
8
Mentor Graphics Corp.
www.mentor.com
Verification Plan
Constraint
Solver
Simulation
ModelSim
Kernal
C-R Testbench
N
Y
Assertion
Engine
100%
Standards
based
Functional
Coverage
Sufficient
Coverage?
Done
Debug
Coverage-Driven Verification
Testbench Automation
Functional Coverage
Bug
Found?
Y
Assertion Based
Verification
www.mentor.com
Questa Sim
Questa inFact
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
UVM Connect
UVM Express
Questa Codelink
Questa Verification
Management
11
www.mentor.com
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
Questa Codelink
UVM Connect
UVM Express
Questa
Verification
Management
12
WG - Feb 2013
www.mentor.com
Standards Leadership
13
WG - Feb 2013
www.mentor.com
What is an Assertion?
A concise description of [un]desired behavior
req
ack
Example intended behavior
14
www.mentor.com
SV Assertions
SV Assertion
property req_ack(req,ack);
@(posedge clk) $rose(req) |-> ##[1:3] $rose(ack);
endproperty
as_req_ack: assert property (req_ack(req1,ack1));
sample_inputs : process (clk)
always @(posedge req)
begin
ifbegin
rising_edge(clk) then
STROBE_REQ <= REQ;
repeat
(1) @(posedge clk);
STROBE_ACK
<= ACK;
end if;
fork: pos_pos
end process;
begin
protocol: process
variable CYCLE_CNT : Natural;
@(posedge ack)
begin
loop
$display("Assertion Success",$time);
wait until rising_edge(CLK);
disable
pos_pos;
exit when (STROBE_REQ
= '0')
and (REQ = '1');
end loop; end
CYCLE_CNT := 0;
begin
loop
wait until rising_edge(CLK);
repeat (2) @(posedge clk);
CYCLE_CNT := CYCLE_CNT + 1;
$display("Assertion
Failure",$time);
exit when ((STROBE_ACK
= '0') and (ACK = '1'))
or (CYCLE_CNT = 3);
end loop;
disable pos_pos;
if ((STROBE_ACK = '0') and (ACK = '1')) then
end
report "Assertion
success" severity Note;
else
join
report "Assertion failure" severity Error;
end
if; // always
end
end process protocol;
Verilog
VHDL
req
ack
Example intended behavior
HDL Assertion
15
www.mentor.com
Assertions provide
observability for
higher complexity
designs
Assertions describe
(un)desired behavior
Assertions
dramatically shorten
debug and repair
time
16
Reference Model
Bus
Monitor
Assertion
Checkers
Bus
Monitor
Assertions stay on
during block, chip
and system-level
tests
www.mentor.com
Assertion
Checkers
34%
9%
8%
7%
6%
4%
11%
7%
6%
8%
Assertion Monitors
25%
Register Miscompares
Simulation No Progress
PC Miscompare
Memory State Miscompare
Manual Inspection
Self Checking Test
Cache Coherency Check
SAVES Check
22%
15%
14%
8%
6%
5%
3%
2%
17
www.mentor.com
Formal
EnglishSpecification
Specification
Specification
Spec1: ----------------------------------------------------------------------------------------------------------------------
Spec2: ---------------------------------------------------------------------------------------------------------------------
:
:
18
www.mentor.com
Functional
(specification-based)
Structural
(implementation-based)
19
www.mentor.com
SV Coverage Models
// States for a DRAM controller
enum {IDLE, MEM_ACC, SWITCH, RAS_CAS, OP_ACK, REF1, REF2} fsm_state;
covergroup dram_ctrl_fsm_states @(posedge clk);
// An implicit cover bin for all 7 values of fsm_state
covergroup dram_ctrl_fsm_transitions @(posedge clk);
c1: coverpoint fsm_state;
c1: coverpoint fsm_state {
endgroup
bins idle_bin = (IDLE => {REF1, MEM_ACC}) iff (!rst);
bins ref1_bin = (REF1 => REF2 => IDLE) iff (!rst);
// RAS_CAS can last one or two cycles depending on if
// memory access is a read or a write.
bins mem_acc_bin = (MEM_ACC => SWITCH =>
RAS_CAS[*1:2] => OP_ACK => IDLE)
iff (!rst);
bins rst2idle_bin = ({IDLE:REF2} => IDLE) iff (rst);
bins erroneous = default; // Catch undefined transitions
}
endgroup
Mentor Graphics Corp.
20
www.mentor.com
Verification is effectively
metric-less
Few designers know if
their strategy is
adequate or efficient
Sign-off criteria are ad
hoc and vary by
company
Code coverage is not a
functional verification
metric
21
www.mentor.com
Percent complete
70%
60%
50%
40%
30%
20%
10%
0%
time
22
www.mentor.com
Verification Plan
Simulation
C-R Testbench
N
Y
Sufficient
Coverage?
Done
Coverage-Driven
Verification
Debug
Bug
Found?
Y
Assertion Based
Verification
23
www.mentor.com
Directed Tests
Specification
Spec1:------------------------------------------------------------------------Spec1:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Design
Spec2:------------------------------------------------------------------------Spec2:
----------------------------------------------------------------------------------------------------------------------------------------------------------------Spec3:------------------------------------------------------------------------Spec3:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:
:
Spec10,000: ---------------------------------------------------------------------------------------------------------------------------
24
www.mentor.com
Test
CR
Test
25
www.mentor.com
src
dest
// Ethernet
bit[47:0]
bit[15:0]
bit [7:0]
len
payld[ ]
methods
Transmit
Checksum
Display
Clone
Verify
Build
Copy
Debug
Packet Fields
dest, src;
len;
payld [ ];
// onboard methods
function new(int i);
payld = new[i]; len = i;
endfunction : new
function void display;
$displayh("\t
src: ", src);
. . .
foreach (payld[i])
$display(payld[i] = %d",i,payld[i]);
endfunction : display
task transmit_frame();
. . .
function clone();
. . .
endclass : ether_packet
26
Mentor Graphics Corp.
26
www.mentor.com
27
www.mentor.com
UVM
VIP and Verification
Environment
Documentation,
(examples, code snippets
Class Library
SystemVerilog Language
28
www.mentor.com
M
Testbench
D
D
Transactions
Drivers - translate
transaction into signals
Signals
Sequencers - generates
sequences of transactions
29
www.mentor.com
VIP
Verification Engineer
Project Manager
VIP
Coverage
T1
T2
...
T(n)
System
Testbench
Functional
Assertion
Coverage Files
Functional coverage
enables intelligent
verification
Increases quality
Constrained Random
doubles productivity of
verification engineers
Greatly reduces the need
for directed tests
Assertion
Library
Code/FSM
Run Data
30
Formal
Verification
www.mentor.com
30
0-in
Formal
User
Coverage
Test
Specific
Plan
RD / WR API
UCDB Browser
RD / WR API
Test Ranking
Unified
Coverage
Database
31
www.mentor.com
UCDB
Rank/Manage
results
32
www.mentor.com
Percent complete
70%
60%
50%
40%
30%
20%
10%
0%
time
33
www.mentor.com
Agenda
Verification Overview
34
www.mentor.com
INTEGRATION
Company
Standards
Requirements
Management
TRACEABILITY
DOCUMENT
XML
ASCII
Dynamic Tracing
Automated
Documentation
35
www.mentor.com
Capture
Tag
XML
REQ_001
REQ_002
ASCII
REQ_003
Trace
Requirements design
REQ_004
REQ_005
implementation verification
Monitor/Analyze
Validate
REQ_001
REQ_002
REQ_003
REQ_004
Report
REQ_005
XML
ASCII
36
www.mentor.com
Capture
Projects
Bugzilla
User
Requirements
Acceptance Tests
Design
Spec
Integration Tests
Design RTL
Testbench RTL
Verification
Results
37
www.mentor.com
Tag
Configure ReqTracer to
capture existing
requirements
38
www.mentor.com
Trace
COVERS
COVERS
Hardware
Design
Requirements
Specification
40%
Certification
Authority
RTL
60%
Design
What shall I
work on
next?
Hardware
Designers
What is this
code for?
System
Architect
39
www.mentor.com
Monitor/Analyze
IMPACT
CHANGE
COVERS
IMPACT
IMPACT
IMPACT
IMPACT
COVERS
Hardware
Design
Requirements
Specification
20%
40%
Design
Project
Manager
Quality
Manager
40
60%
Which tests
need updating
now the design
has changed?
Can we make
a change and
still release
on time?
How risky
would it be if I
changed this?
System
Architect
RTL
www.mentor.com
Validate
Ensure links
Requirements RTL
source
Requirements test plan
Test plan testbench
Test plan verification
results
41
www.mentor.com
Summary
Requirements tracing is best as an active
process throughout the project
development
XML
REQ_001
REQ_002
ReqTracer
ASCII
REQ_003
REQ_004
REQ_005
REQ_001
REQ_002
REQ_003
REQ_004
REQ_005
XML
ASCII
42
www.mentor.com
Agenda
Verification Overview
Rule Checking
Precision
43
www.mentor.com
Directed Tests
10X
10X
Higher
Coverage
Faster
Coverage
Quality - Redundant
Intelligent Tests
Quantity - High
Quality - High
Directed Tests
1,000s
Random Tests
1,000,000s
44
www.mentor.com
Intelligent Tests
100,000s
Coverage (%)
70
60
inFact
50
51%
40
30
20
CRT
10
10%
45
www.mentor.com
9800
9500
9200
8900
8600
8300
8000
7700
7400
7100
6800
6500
6200
5900
5600
5300
5000
4700
4400
4100
3800
3500
3200
2900
2600
2300
2100
1800
1500
1200
900
600
300
Applying iTBA
Incremental Changes
Test
Gen
Verification IP Block
Test
Driver
Gen
Verification
IP Block
Test
Score
Driver
Monitor
Gen
Verification
board IP Block
Test
Score
Gen
board
Score
board
Driver
Monitor
Monitor
46
www.mentor.com
DUT
Simplicity of iTBA
Simplicity of Graphs
Start
init
wait_rdy
Rw_opts setup_wr
setup_rd
rw_2
Rw_size
rw_4
Origin of Graphs
rw_1
ack
Stop
47
www.mentor.com
Power of iTBA
Power of Algorithms
init
wait_rdy
Rw_opts setup_wr
setup_rd
rw_2
Rw_size
rw_4
ack
Stop
Mentor Graphics Corp.
48
www.mentor.com
rw_1
Creating Graphs
Easy to Use
49
Compile Testbenches
Unmatched Debugging
www.mentor.com
Collapsed
View
==
50
www.mentor.com
iTBA
CRT
DT
Less Time
More Coverage
Functional Coverage
Project TImeline
51
www.mentor.com
Agenda
Verification Overview
52
www.mentor.com
Questa Sim
Questa inFact
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
UVM Connect
UVM Express
Questa Codelink
Questa Verification
Management
53
www.mentor.com
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
Questa Codelink
UVM Connect
UVM Express
Questa
Verification
Management
54
WG - Feb 2013
www.mentor.com
Standards Leadership
55
WG - Feb 2013
www.mentor.com
Simulation algorithms,
no matter how good,
have inherent
limitations
0-In formal
verification directly
addresses these
limitations
56
www.mentor.com
Simulation
Formal
Simulation
Formal
57
www.mentor.com
Static Formal
0in_prove
Provides
counterexamples
0in_confirm
=
FIFO
Bus Arbiter
Overflow error
58
www.mentor.com
Static Formal
Verification
Dynamic
Formal
Verification
59
www.mentor.com
0-in
Formal
User
Coverage
Test
Specific
Plan
Database
RD / WR API
UCDB Browser
RD / WR API
Test Ranking
60
www.mentor.com
Agenda
Verification Overview
Questa Codelink
Questa VIP
61
www.mentor.com
Tx
Logic
A
Rx
Clock domain A
Clock domain B
Clock A
Tx
Clock B
Setup/hold window
62
www.mentor.com
MTBF
Domain A
Domain B
CLK
CLK
Q
1
fclk fin td
63
www.mentor.com
Clock A
Clock B
Metastability window
Rx
Tx
i -1
i +1
i +2
i -1
ii
i +1
i +1
i +2
i +2
i +3
64
www.mentor.com
Complete Anatomy of
CDC Bugs
65
www.mentor.com
66
www.mentor.com
Block A
test_clk
a_clk
/
config A
Mode control
b_clk
config B
67
www.mentor.com
Assertion
68
www.mentor.com
69
Automatically
identifies potential
reconvergence
problems in logic
Generates
metastability
injection assertions
to be used in
simulation
Supports both
combinational and
sequential
reconvergence
Synchronizer 1
Potential
Reconvergence Problem
Synchronizer 2
www.mentor.com
70
www.mentor.com
RTL
Protocol
Assertions
Protocol Verification
Simulation
Formal
Verification Simulate assertions using
existing testbench
0-In Formal verification
Measure coverage
Create regression tests
71
www.mentor.com
72
www.mentor.com
Coverage metrics:
73
www.mentor.com
Step 3. Reconvergence
Verification
Static CDC Analysis
RTL
CDC
Analysis
Simulation
Metastability
Assertions
Reconvergence Verification
74
www.mentor.com
i -1
i +1
i +2
i +3
75
www.mentor.com
76
www.mentor.com
Coverage metrics:
77
www.mentor.com
Protocol verification
Reconvergence verification
78
www.mentor.com
Agenda
Verification Overview
79
www.mentor.com
No source-level debug
Slow, ~ 1 to 10 instructions/sec
Integrated
Debug
Environment
CoverageDriven
Verification
software
Developer
Verification
Engineer
Testbench
Automation
80
www.mentor.com
Standards:
VHDL, Verilog,
SystemVerilog,
PSL, SystemC
System-Level
Design
AssertionBased
Verification
Integrated
Debug
Environment
CoverageDriven
Verification
Codelink
software
Developer
Testbench
Automation
81
www.mentor.com
Standards:
VHDL, Verilog,
SystemVerilog,
PSL, SystemC
System-Level
Design
AssertionBased
Verification
Agenda
Verification Overview
82
www.mentor.com
Verification IP
83
www.mentor.com
Questa Verification IP
Comprehensive verification IP
84
www.mentor.com
SCORE
BOARD
Coverage
AXI Agent
AXI SLAVE
VIP Component
DUT
User component
User design
Mentor Graphics Corp.
85
www.mentor.com
User adds DUT specific Test Plan, Test Sequences and Coverage
86
www.mentor.com
87
www.mentor.com
Highlighting shows
when signals are valid
88
www.mentor.com
Host
interface
Agent
PCIe IP
DUT
Test
Sequence
Sequence
item
Host IF
PIPE
Virtual
Sequencer
89
www.mentor.com
PCIe
PIPE
Agent
Protocol support
PCI Express
USB
Ethernet
SPI 4.2
DDR2, DDR3
OCP 2.2
HDMI
I2C, I2S
SPI, UART
90
www.mentor.com
Questa Sim
Questa inFact
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
UVM Connect
UVM Express
Questa Codelink
Questa Verification
Management
91
www.mentor.com
Questa Formal
Questa PA
Questa CDC
Questa VIP
Functional
Static
Verification
Verification
Verification
Management
Verification
Methodology
Dynamic
HW/ SW
UVM
Questa Codelink
UVM Connect
UVM Express
Questa
Verification
Management
92
WG - Feb 2013
www.mentor.com
Standards Leadership
93
WG - Feb 2013
www.mentor.com
Agenda
Verification Overview
Rule Checking
Precision
94
www.mentor.com
Reused
RTL
Step 1
Design
Integrity
Step 2
Quality
Assessment
Automate Analysis
of RTL Integrity
Assess RTL to
Design Standards
Step 3
Design
Visualization
Visualize Behavior
and Structure
New
Functionality
Quality Quantified
Fully Understood
Reused
RTL
New
Functionality
Share Knowledge
95
Ready to Reuse
www.mentor.com
Verilog
VHDL
C & C++
Memory Content
Constraint Files
Tool Scripts
Design Documents
Netlists
Reports
Projects
96
www.mentor.com
97
www.mentor.com
Reused
RTL
Step 1
Design
Integrity
Automate Analysis
of RTL Integrity
Step 2
Quality
Assessment
Ready to Reuse
Quality Quantified
Fully Understood
Reused
RTL
Assess RTL to
Design Standards
New
Functionality
New
Functionality
98
www.mentor.com
How do you
tell people
their baby is
ugly?
99
www.mentor.com
Code
Quality
Automated
RTL Quality Assessment
HDL Files
RMM 3.0
Rules
Xilinx
Rules
Altera
Rules
Essential
Rules
User
Definable
100
www.mentor.com
0%
Code Scoring
101
www.mentor.com
View Errors
in Context
View
Summary
Mentor Graphics Corp.
102
www.mentor.com
103
www.mentor.com
Create ruleset(s)
Change rule
parameters
Create policies
that link to
rulesets
No multiply-driven signals
104
www.mentor.com
Downstream Checks
No combinational feedback loops
Avoid latches & inferred registers
Register outputs
Avoid or isolate gate-level logic
Ensure naming compatibility with downstream tools
Avoid delay times
Avoid default initialization
Establish a subset of allowed constructs
Use complete sensitivity lists
105
www.mentor.com
Document Quality
106
www.mentor.com
Reused
RTL
Step 1
Design
Integrity
Step 2
Quality
Assessment
Automate Analysis
of RTL Integrity
Assess RTL to
Design Standards
Step 3
Design
Visualization
Visualize Behavior
and Structure
New
Functionality
Quality Quantified
Fully Understood
Reused
RTL
New
Functionality
Share Knowledge
107
Ready to Reuse
www.mentor.com
read
Existing
RTL Code
108
www.mentor.com
Navigate ports
Navigate declarations
View as graphics
Collapse, open up/down,
& split windows to aid
navigation
Diff similar files
109
www.mentor.com
110
www.mentor.com
111
www.mentor.com
HTML Export
Automatically create an interactive
website with HTML Export:
112
www.mentor.com
The Results
113
www.mentor.com
Agenda
Verification Overview
Rule Checking
Precision
114
www.mentor.com
FPGA P&R
115
www.mentor.com
Estimates location
Estimates routing resources
More accurately estimates net
delays
Identifies Critical Paths
Physical Synthesis
Generic Placer &
Delay Estimator
Physical
Library
Physical
Optimizations
Replication
Netlist Optimization
Retiming, Replication, Resynthesis
Retiming
Re-Synthesis
Optimized Netlist
116
www.mentor.com
design change
Incremental
Compile
Compile
Synthesize
FPGA Vendor
P&R
FPGA
Vendor
P&R
117
Incremental
Synthesis
www.mentor.com
PRECISE-EXPLORE
118
www.mentor.com
119
www.mentor.com
Precise-Explore
Exploration Goals
Meet Constraints
Max Frequency
Min Area
Exploration Options
Runtime Limits
120
www.mentor.com
Precise-Explore
Benefits
Precise-Explore automates
the process
Explore implementation
options for different design
structures in both synthesis
and P&R
Detailed reporting
121
www.mentor.com
Precise-Explore
Product Configuration
2012b
Controlled feature
Requires special license
License available upon customer request
2012c
Production feature
Included in Precision RTL Plus license
122
www.mentor.com
123
www.mentor.com
Mentor Graphics
THANK YOU
124
www.mentor.com