Professional Documents
Culture Documents
Equivalence Checking
Equivalence Checking
Equivalence Checking
EE 382M-11
The University of Texas at Austin
Department of Electrical and Computer Engineering
1
April 4, 2019
Outline
Sequential Equivalence Checking (SEC)
basics
Combinational EC vs. Sequential EC
Theory behind SEC
Reachability analysis on product machine
Bounded vs. unbounded, etc.
Partition on transition relation, CFG, etc.
How Industry deal with SEC issues
Leverage existing CEC and model checking tools
Sequential equivalence checking tools
E.g., SLEC, JasperGold SEC, VCF-SEQ, Hector, ESP-CV (RTL vs.
Spice)
IN OUT
… G Product Machine = G ×R
always 0?
always 0?
R R
X
Types of SEC
Input/output alignment
Cycle-accurate equivalence
Equivalent at every cycle
Transaction-level equivalence
Compare points can have different latencies
Initial state
Safe replacement (Singhal, Pixley, Aziz, Brayton)
No assumption about the initial state
Initial state needed
From init state, whether non-eq states can be forward reached
Or from non-eq states, where init state can be backward reached
CG_en==0 CG_en==1
Other inputs
2b d1
Instance a of
10DUT
Instance d0 of DUT • cg clocks can be disabled
based on internal< state
• cg clocks always running + *
Instance d0 of DUT
2b d1
Instance a of
10DUT
• X assignments • X assignments
•
•
Uninitialized registers
Array range overflow
•
•
+
Uninitialized registers
* <
Array range overflow
• Multiple drivers, etc.. • Multiple drivers, etc..
CEC vs SEC
Taken from reference 1
Re-encoding of state
differences
Sequential
scheduling SEC
pipelining
CEC
FFs match Data representation differences
Bit-accurate
SEC Approaches
Flattening
flatten a sequential circuit into a combinational circuit
Reduce SEC into CEC --- too big to handle
Graph isomorphism
Two FSMs can be translated into the same one
Re-writing rules, canonical forms.
Reachability analysis on product machine
Turn SEC into model checking on equality assertions
State space explosion
Bounded model checking (DAC’03, Kroening, Clarke, and Yorav)
Abstraction techniques (slicing, exploiting similarity, etc.)
Redundancy removing
EE382M-11 Sequential Equivalence Checking 10
Flatten
{IN} OUT
F1 F2 Fn
Sequential circuit C
IN0 OUT
C0 C1 Ct
INt
IN1
Combinational circuit
1/0 1/0
0/0 0/1 rewriting. 0/0 0/1
0 1/1 1
0 1.2
SEC Abstractions
Simplify model G and R
Rewriting – make G and R more alike
Redundancy removing – drop unneeded logic
Retiming – move logic across state points.
Divide and conquer – decomposition
Partition transition relations, state space, flop
stage, etc.
Use correspondences between G and R to
simplify the product machine
Structure similarities between G and R.
Design N
Redundancy
Removal Design N’
Result N
Engine
Target
Design N’’’
Result N’’ Enlargement
Engine
Result N’’’
3000
70000
60000 2000
Number of
Registers
50000
1000
40000
30000 0
20000 SMM
10000
0
IFU 600
400
Original Design 200
After Merging via Induction
After Merging via TBV 0
S6669
circuit CFG
B0 a = A, b =B
stall
a
b
+ out stall = 1
N
Y
B1
clock out = a + b
ACFG
Node0
a = A & b = B / _ / true
Node1
ACFG: Results
• We take radix-2 SRT divider as an example (2N-bit
dividend, N-bit divisor)
Without Partitioning ACFG Partitioned Model Checking
N Time(s) BDD size Time(s) BDD size Speedup
7 12.27 5390 6.99 7462 1.76x
8 32.31 10307 18.41 14635 1.76x
9 21.89 8982 14.97 9770 1.46x
10 50.62 6619 26.26 15566 1.93x
11 392.66 10915 379.52 59125 1.03x
12 727.43 19722 484.12 29792 1.50x
13 1854.62 63555 877.29 38756 2.11x
14 950.25 22262 636.86 44919 1.50x
15 EE382M-11
452.57 20036Sequential193.19
Equivalence Checking 56982 2.34x 27
Similarity
Signal correspondence TCADICS00, C. A. J. van Eijk
Internal state point mapping
Possible equivalent internal signals (wire, flop)
Cutpoint insertion
Text similarity –IWLS’03, Matsumoto, Saito, and Fujita
Leverage Similarities
If multiple stages of flops can be proven
equivalent, we can do assume-guarantee.
CG_en==0 CG_en==1
Assumptions for inputs
2b a 10
Levels
+ * <
X
… …
RTL Model
Blackbox Applied
…
…
…… …
RTL Model
F G
Double-side cutpoint
Prove f1(x) g1(x) f2 g2
Cut F.z and G.z z z
assume F.z G.z
f1 g1
x y x y Equivalent to
blackbox with prove
Single-side cutponit F G and assume
Prove f1(x) g1(x)
Cut G.z f2 g2
Assume G.z f1(x) z z
No false Non-eq
f1 g1
x y x y
EE382M-11 Sequential Equivalence Checking 32
Software Cutpoint
[DAC’06, EMSOFT’05, Feng and Hu]
….
while(…){ DAG
if ..
else… … …
for( …){
} … … …
}
…
X
…
Software
Symbolic
Simulation
X
X High-Level Synthesis
…
…
Circuit 34
SEC at Industry
Leverage existing formal verification tools
CEC resolves a subset by flattening/remodeling
Model checking tool + assertions
Small block level design
Cycle accurate equivalence
Manual cutpoints, manual design partitioning.
Apply SEC tools
Calypto SLEC
JasperGold SEC
IBM SixthSense
Synopsys ESP-CV (RTL vs Spice), VC Formal SEQ, Hector
In-house tools
CPT API
•Loop Unrolling Language Neutrality
•Dependence Analysis CPT • Support multiple languages scalably
•Flop/Mux inferencing • Language independent transforms
•Constant Propagation
•Dead code elimination CPT to CDB xforms
•Smart memory modeling
CDB
CDB API
Setup CDB
Inductive
Machine Sequential Convergence Analysis
Acceleration Analysis Analysis
Fixed point
Analysis
reset
spec
spec align
falsified
1
proven
align impl
bounded or full
impl
proof
reset
ESP-CV
SEC on RTL vs. Spice (switch-level)
Symbolic simulation (1, 0, X, Z, S) on product
machine
Bounded by simulation cycles or memory size
Terminates when simulation cycles complete.
Mem over limit, randomly picks values for symbols.
Exploits symmetry inside macro (SRAM, ROM)
models – efficient models for G and R to
reduce size of symbolic expression
References
1. Developing a commercially viable sequential equivalence checker. Anmol
Mathur, Calypto Design Systems,
2. SLEC user manual, Calypto
3. Sequential Equivalence Checking Across Arbitrary Design
Transformation: Technologies and Applications Viresh Paruthi, J.
Baumgartner, H. Mony, R. L. Kanzelman, IBM Corporation
4. ESP user manual, Synopsys
5. Scalable Sequential Equivalence Checking across Arbitrary Design
Transformations, J. Baumgartner, H. Mony, V. Paruthi, R. Kanzelman and
G. Janssen, ICCD06
6. Coping with Moore's Law (and More): Supporting Arrays in State-of-the-Art
Model Checkers, J. Baumgartner, M. L. Case and H. Mony, FMCAD10
7. Automatic Decomposition for Sequential Equivalence Checking of System
Level and RTL Descriptions S. Vasudevan, V. Viswanath, J. A. Abraham
and J. Tu, Formal Methods and Models for Co-Design, 2006.
8. Sequential equivalence checking based on structural similarities C. A. J.
van Eijk July, 2000 TCADICS