Professional Documents
Culture Documents
證)
M O O R E’ S L A W
Gates / Chip
5
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Introduction
9
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Simulation Technologies
Event-based Simulators
Cycle-based Simulators
Transaction-based Simulators
Code Coverage
HW/SW Co-verification
Emulation Systems
Rapid Prototyping Systems
Hardware Accelerators
AMS Simulation
10
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Static Technologies
Lint Checking
Syntactical correctness
Identifies simple errors
Static Timing Verification
Setup, hold, delay timing requirements
Challenging: multiple sources
11
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Techniques
Theorem Proving Techniques
Proof-based
Not fully automatic
Formal Model Checking
Model-based
Automatic
Formal Equivalence Checking
Reference design modified design
RTL-RTL, RTL-Gate, Gate-Gate implementations
No timing verification
12
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Physical Verification & Analysis
Issues for physical verification:
Timing
Signal Integrity
Crosstalk
IR drop
Electro-migration
Power analysis
14
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Comparing HW/SW Coverificat
ion Options
15
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Which is the fastest option?
Event-based simulation
Best for asynchronous small designs
Cycle-based simulation
Best for medium-sized designs
Formal verification
Best for control-oriented designs
Emulation
Best for large capacity designs
Rapid Prototype
Best for software development
16
Pao-Ann Hsiung, CSIE, National Chung Cheng University
SoC Verification Methodology
System-Level Verification
SoC Hardware RTL Verification
SoC Software Verification
Netlist Verification
Physical Verification
Device Test
17
Pao-Ann Hsiung, CSIE, National Chung Cheng University
SoC Verification Methodology
18
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Verification Approaches
Top-Down Verification
Bottom-Up Verification
Platform-Based Verification
System Interface-Driven Verification
19
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Top-Down SoC Verification
verification
20
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Bottom-Up SoC Verification
Components,
blocks, units
Memory map,
verification
internal interconnect
Basic functionality,
external interconnect
System level
21
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Platform Based SoC Verification
Derivative
Design
Interconnect
Verification be
tween:
SoC Platform
Newly added I
Ps
22
Pao-Ann Hsiung, CSIE, National Chung Cheng University
System Interface-driven
SoC Verification
Besides Design-Under-Test,
all others are interface models
23
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Device Test
To check if devices are manufactured
defect-free
Focus on structure of chip
Wire connections
Gate truth tables
Not functionality
24
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Device Test
Challenges in SoC device test:
Test Vectors: Enormous!
Core Forms: soft, firm, hard, diff tests
Cores: logic, mem, AMS, …
Accessibility: very difficult / expensive!
25
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Device Test Strategies
Logic BIST (Built-In-Self-Test)
Stimulus generators embedded
Response verifiers embedded
Memory BIST
On-chip address generator
Data generator
Read/write controller (mem test algorithm)
Mixed-Signal BIST
For AMS cores: ADC, DAC, PLL
Scan Chain
Timing and Structural compliance
ATPG tools generate manufacturing tests automatically 26
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Verification
What is Formal Verification?
An analytic way of proving a system
correct
no simulation triggers, stimuli, inputs
Formal
no test-benches, test-vectors, test-cases
Verification
Methods
Deductive Reasoning (theorem proving)
Model Checking
Equivalence Checking
28
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Theorem Proving
Uses axioms, rules to prove system corr
ectness
No guarantee that it will terminate
Difficult, time consuming: for critical ap
plications only
29
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking
Automatic technique to prove
correctness of concurrent systems:
Digital circuits
Communication protocols
Real-time systems
Embedded systems
Control-oriented systems
Explicit algorithms for verification
30
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Equivalence Checking
Checks if two circuits are equivalent
Register-Transfer Level (RTL)
Gate Level
Reports differences between the two
Used after:
clock tree synthesis
scan chain insertion
manual modifications
31
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Why Formal Verification?
Simulation and test cannot handle all
possible cases (only some possible ones)
Simulation and test can prove the presence
of bugs, rather than their absence
Formal verification conducts exhaustive
exploration of all possible behaviors
If verified correct, all behaviors are verified
If verified incorrect, a counter-example (proof)
is presented
32
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Why Formal Verification Now?
SoC has a high system complexity
Simulation and test are taking
unacceptable amounts of time
More time and efforts devoted to
verification (40% ~ 70%) than design
Need automated verification methods
for integration into design process
33
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Increased Simulation Loads
34
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Why Formal Verification Now?
Examples of undetected errors
Ariane 5 rocket explosion, 1996
Exception occurred when converting 64-bit
floating number to a 16-bit integer!
Pentium FDIV bug
Multiplier table not fully verified!
35
Pao-Ann Hsiung, CSIE, National Chung Cheng University
36
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Verification Tasks for SoC
37
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Property Checking v/s Equival
ence Checking
38
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model (Property) Checking
Algorithmic method of verifying
correctness
of (finite state) concurrent systems
against temporal logic specifications
A practical approach to formal
verification
39
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking
What is necessary for Model Checking?
A mathematically precise model of the
system
A language to state system properties
A method to check if the system
satisfies the given properties
40
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking
Formal model of the system
Finite State Machine (FSM)
Desired behavior expressed as a set of
properties (specifications)
Computation Tree Logic (CTL)
Method to check properties against
system
Efficient FSM traversals
41
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Models of System
Any mathematically precise model that ca
n be represented as a state transition syst
em
Finite State Machines
Petri Nets
(Timed) Automata
Statecharts
42
Pao-Ann Hsiung, CSIE, National Chung Cheng University
State Transition System
M(S, R, L)
s1
a S = {s1, s2, s3}
R = transition
relation
L = {a, b, c}
b ac
s2 s3
Kripke Structure
43
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Model v/s Verification
表達能力 v/s 驗證複雜度 找平衡點 !
語言的表達能力 表達能力豐富
表
達 Undecidable
能
力 nonelementary
簡 EXPSPACE
單 EXPTIME
PSPACE 驗證問題複雜度
NP
PTIME
44
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Property Specification
Languages
Linear Temporal Logic (LTL)
7 ms
45
Pao-Ann Hsiung, CSIE, National Chung Cheng University
CTL – Computation Tree Logic
Path quantifiers
A (for all computation paths)
E (for some computation path)
Temporal operators
X (next time, next state)
F (eventually, finally)
G (always, globally)
U (until)
R (release, dual of U)
46
Pao-Ann Hsiung, CSIE, National Chung Cheng University
CTL Formulas
Temporal logic formulas are evaluated
with respect to a state in the model
State Formulas
Apply to a specific state
Path Formulas
Apply to all states along a specific path
47
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Basic CTL Formulas
M, s |= E X (f )
Exists a next state of s, for which f holds
s
M, s |= A X (f )
For all next states of s, f is true
s
f f
48
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Basic CTL Formulas
M, s |= E G (f )
Exists a path from s, along which f holds i
n every state s
f
f
M, s |= A G (f )
For all paths from s, f holds in every state,
i.e., globally s
f
f f
49
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Basic CTL Formulas
s M, s |= E F (f )
Exists a path from s, which eventually cont
ains a state in which f holds
f
s
M, s |= A F (f )
For all paths from s, eventually there is a st
f ate in which f holds
f
50
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Basic CTL Formulas
s
f M, s |= f U g
f
Exists a path from s, which contains a state
in which g holds and in all previous states
g f holds
E F (f ) = E (true U f )
A F (f ) = A (true U f )
51
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Basic CTL Formulas
Full set of operators
Boolean: , , ,
Temporal: E, A, X, F, G, U, R
Minimal set of operators
(to express any CTL formula)
Boolean: ,
Temporal: E, X, U
52
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Typical CTL Formulas
E F ( start ready )
Eventually a state is reached where start ho
lds and ready does not hold
A G ( req A F ack )
Any time request occurs, it will be eventuall
y acknowledged
A G ( E F restart )
From any state it is possible to get to the re
start state
53
Pao-Ann Hsiung, CSIE, National Chung Cheng University
TCTL (Timed CTL)
A G ( req A F 7 ack )
Time Constraint:
Subscript “~ c ” is added to CTL formulas
~ {<, , =, , >}
c is an integer
54
Pao-Ann Hsiung, CSIE, National Chung Cheng University
TCTL Example
x:=0; z:=0
監控 x 、 z 是實數值系統時鐘
x 、 z 在系統開 x<500ms 。
始時,被設為 z50ms
零。 命中
z 在每次監控週期,
z=50ms 被設為零。
z:=0; 修正
M, 監控 |= E F<300 ( 命
中) Pao-Ann Hsiung, CSIE, National Chung Cheng University
55
Model Checking – Problem
Given:
a structure M (S, R, L) and
{s S : M, s |= f }
56
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking –
Explicit Algorithm
Label each state s with the set label(s )
= { sub-formulas of f, which hold in s }
i = 0; label(s ) = L (s )
i = i + 1; process formulas with (i -1) n
ested CTL operators. Add processed for
mulas to label(s ).
Continue until closure.
Result: M, s |= f iff f label(s )
57
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Explicit Model Checking
E F (g h)
T1 = states in which g & h are
true
T2 = complement of T1
T3 = predecessor states of T2
58
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Traffic Light Controller
C’ + T’
S T G1 R2
Farm Road C T
T S
R1 Y2 Y1 R2
City Road
C’ + T
S = Sensor
R1 G2
T = Timer Kripke Struc
C T’ ture
59
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Traffic Light Controller
G1 R2
G1 R2 Y1 R2
State Graph
G1 R2 Y1 R2 R1 G2
Y1 R2 R1 G2 R1 Y2 R1 G2
R1 Y2 R1 G2 G1 R2
60
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Traffic Light Controller
Model Checking Tasks
Safety Condition
S(G1 G2) C T
= S(G1) S(G2) 4
= {1} {3} = R1 Y2 Y1 R2
2
S(EF(G1 G2) = C’ + T
S(EF(G1 G2) = R1 G2
3
= {1, 2, 3, 4} Kripke Str
C T’
ucture
Safety condition is true! 62
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Traffic Light Controller –
Checking Fairness Condition
E F (G1 G2)
E(true U (G1 G2))
1 3
S(G1 G2) = S(G1) S(G2)
= {1} {3} = {1, 3} 4 2
S(EF(G1 G2)) = {1, 2, 3, 4}
(going backward from {1, 3}, find 3 1
predecessors)
Fairness condition satisfied!
63
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Symbolic Model Checking
Symbolic
Operates on “sets of states” rather than in
dividual states
Use BDD for efficient representation
Represent Kripke structures
Manipulate Boolean formulas
64
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Binary Decision Diagram
(BDD)
BDD: A canonical form of
representation for Boolean formulas.
Motivation:
Too much space redundancy in traditional
representations
BDD is more compact than truth tables,
conjunctive normal form, disjunctive
normal form, binary decision trees, etc.
Ordered BDD has a canonical form
BDD operations are efficient
65
Pao-Ann Hsiung, CSIE, National Chung Cheng University
BDD v/s Binary Decision Trees
2-bit Comparator
BDD
Binary Decision Tree Order: a1 < b1 < a2 < b2 66
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Ordered BDD (OBDD)
Since OBDDs are canonical, it is easy to:
check equivalence = check BDD isomorphism
check satisfiability = check BDD isomorphism
with OBDD(0)
Size of OBDD depends critically on VARIABLE
ORDERING !!!
2-bit comparator example:
Change variable order to: a1 < a2 < b1 < b2
11 vertices instead of 8 for a1 < b1 < a2 < b2
67
Pao-Ann Hsiung, CSIE, National Chung Cheng University
OBDD (Variable Ordering)
a 1 < a2 < b 1 < b 2
In general, for n-bit
comparator:
68
Pao-Ann Hsiung, CSIE, National Chung Cheng University
BDD: Application to Verification
Equivalence of combinational circuits
Canonicity property of BDDs:
If F and G are equivalent, their BDDs are id
entical (for the same variable ordering)
a
a F=a’bc + abc + ab’c
?
b
b
c
c
G=ac + bc
0 1 69
0 1 Pao-Ann Hsiung, CSIE, National Chung Cheng University
BDD: Application to Verification
Functional Test Generation a
property
Impossible to guarantee that the
of the user
71
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking Issues
Negative Results
Incorrect model
Incorrect specification (false negative)
Failure to complete the check (too
large)
72
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checking Issues
Capacity
State-space explosion occurs for
complex systems
So, what is the use of Model Checking
for SoC?
Use model checking as a
74
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Equivalence Checking
Features:
No vectors or testbench required
Reduce time-to-market
75
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Equivalence Checking
Equivalence Checkers were used in:
RTL-to-RTL
RTL-to-Netlist
Netlist-Netlist: some optimizations in Netlist
like:
CTS-inserted netlist
Scan-chain-inserted netlist
Post-layout netlist
…….
76
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Equivalence Checking
Two circuits are functionally equivalent
if they exhibit the same behavior
Combinational Circuits
CL
For all possible input values
Pi Po
Sequential Circuits
CL
For all possible input
Ps Ns
sequences R
77
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Combinational
Equivalence Checking
Functional Approach
Transform output functions into BDD
2 circuits are equivalent if their BDDs are id
entical
Structural Approach
Identify structurally similar internal points
Prove internal points (cut-points) equivalen
t
78
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Functional Equivalence
BDDs of output functions must be identi
cal (using the same variable ordering) f
or functional equivalence
If BDDs are too large
Cannot construct BDD, memory problem
Use partitioned BDD method
Decompose circuit into smaller pieces
Represent each piece as a BDD
Check equivalence of internal points
79
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Functional Decomposition
Decompose each function into
functional blocks F G
Represent each block as a BDD
Define cut-points (z) f2 g2
Verify equivalence of blocks at z z
cut-points starting at primary f1 g1
inputs
x y x y
80
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Cut-Points Resolution
All pairs of cut-points are equivalent
FG
If intermediate functions f2, g2 are not
equivalent, functions F and G may still
be equivalent (FALSE NEGATIVE)
How to check False Negative?
XOR (F, G)
BDD for F G
81
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Structural Equivalence
Given 2 circuits, each with its own struc
ture
Identify “similar” internal points, cut sets
Exploit internal equivalences
False negative problem may arise
F G, but differ structurally
Verification algorithm declares F, G differ’nt
Implication Techniques
Learning Techniques
82
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Sequential
Equivalence Checking
Represent each sequential circuit as an
FSM
Verify if two FSMs are equivalent
Approaches:
Reduction to combinational circuit
Isomorphism of state graphs
Symbolic FSM traversal of product machine
83
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Verification Tools
Model Checkers
Equivalence Checkers
Academic Research Tools
Commercial Verification Tools
Formal Tools
Semi-Formal Tools
84
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Academic Tools
Tools Institutes
SMV CMU
MOCHA, VIS, HyTech UC Berkeley
STeP Stanford
SGM CCU & Sinica
RED Academia Sinica
UPPAAL Uppsala & Aalborg Univs
KRONOS Verimag
85
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Commercial Tools
Tools Companies
Formal Check Cadence
Formal Model Checker Avant!
Formality Synopsys
Formal Pro Mentor Graphics
Black Tie, Conformal LEC Verplex Systems
86
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Example:
Formal Verification of SoC
Industrial Embedded SoC Product
Korea Samsung Electronics S3C2400X
ARM920T processor
16 function modules (IPs)
Reused IPs: UART, I2S, …
Newly Designed IPs: bus controllers, DMA,...
Newly Bought IPs: USB host controller
87
Pao-Ann Hsiung, CSIE, National Chung Cheng University
S3C2400X SoC
88
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Formal Verification
Methodology for SoC
89
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Model Checker
Cadence SMV (Symbolic Model Verifier)
Many success stories!!!
91
Pao-Ann Hsiung, CSIE, National Chung Cheng University
General Strategy for
Module Verification
1) Define what to verify for a module.
2) Construct the environment required
for verifying each property.
3) Transform each property to CTL.
4) Check coverage of CTL properties over
RTL code
92
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Vacuous Property Checking
A G ( p A X (q) )
If p does not occur, we cannot check A
X(q) at all.
Model Checker says it is verified as true.
We should check if p occurs at least onc
e, i.e., A G (~p) is false!
93
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Fairness Constraint
The correctness of a module depends
not only on environment, but also some
specific behavior of the environment
This specific behavior is modeled as
fairness constraints (input restrictions)
Also called assumptions in assume-
guarantee reasoning
94
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Reduction of Address Bus and
Data Bus
Traditional approach:
Abstraction:
32-bit wide bus 1-bit or 2-bits wide
95
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Reduction of Address Bus and
Data Bus
Different approach:
Divide verification task into 2 parts:
CR accessing logic
Normal operation logic
2 different environments
2 different property groups
96
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Modules Verified
Modules CTL State Time
properties variables (min)
AHB arbiter 27, 38 90, 80 50
Bridge 61 50 5
DMA 67 100 440
USB (m 102+4+5 N/A 9h, 43h
w) 36+4+2 2h, 6h
Host (mr)
97
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Discussions on Example
Incremental design and verification
Early stage of design: helps find real
design errors
Later stage of design: helps find model
and property errors
Design and verification time reduced
98
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Conclusions
Formal verification of SoC is definitely
required!
But, it should be used in conjunction
with other verification techniques.
Capacity of formal verification must be
enlarged for its wide-spread adoption
Techniques required:
Design abstraction
Verification partitioning
99
Pao-Ann Hsiung, CSIE, National Chung Cheng University
Future Work
Automatic abstraction & partitioning
Assume-Guarantee Reasoning (AGR)
Incorporation of assertion languages:
Verplex’s OVL
Language
Intel’s ForSpec Wars!!!
etc.
IP = Verilog + OVL + AGR
Hierarchical verification of SoC based on
OVL + AGR 100
Pao-Ann Hsiung, CSIE, National Chung Cheng University