Title: SAT Sweeping with Local Observability DontCares
1SAT Sweeping with Local Observability Dont-Cares
- Nathan Kitchen
- University of California, Berkeley
2Acknowledgements
- Collaborators
- Qi Zhu (UC Berkeley)
- Andreas Kuehlmann (UCB, Cadence Berkeley Labs)
- Alberto Sangiovanni-Vincentelli (UC Berkeley)
- Initiators
- Steve Teig (Tabula)
- Andy Caldwell (Tabula)
- Discussion
- Ellen Sentovich (Cadence Berkeley Labs)
- Christoph Albrecht (Cadence Berkeley Labs)
3Outline
- Background
- Representations of Boolean Functions
- And-Inverter Graphs
- SAT Sweeping
- Improving SAT Sweeping with Observability
Dont-Cares - Motivating Example
- Observability and Local Observability
- Algorithm Flow
- Implementation
- Experimental Results
- Conclusions, Future Work
4Boolean Reasoning in CAD
- Logic synthesis
- Computing don't-cares
- Boolean matching for technology mapping
- Redundancy removal
- Rewriting
- Functional verification
- Equivalence checking
- Property checking
5Representations of Boolean Functions
Canonical?
Worst-Case Complexity in Problem Size
Representation
yes
exponential
Truth tables
no
exponential
Cube covers
yes
exponential
Binary decision diagrams
no
linear
Circuit graphs
6Circuit Representations
- For efficient Boolean reasoning
- Vertices have fixed number of inputs (e.g. two)
- Small set of possible vertex labels (e.g. VAR,
AND, OR) - On-the-fly compaction of circuit structure
- Allows incremental reasoning on subsequent
problems - Example And-Inverter Graphs (AIGs)
7And-Inverter Graphs
constant
0
AND gates
x1
V1
f (x1 x2) x3
inputs
V4
V5
x2
V2
V3
x3
8AIG Edges
- May be complemented
- Implemented as references to vertices
x1
V1
f (x1 x2) x3
V4
f
V5
x2
V2
V3
x3
9AND Operation
Algorithm AND(Ref p1,Ref p2) if(p1 const1)
return p2 if(p2 const1) return p1 if(p1
p2) return p1 if(p1 p2) return
const0 if(p1 const0 p2 const0) return
const0 if(RANK(p1) gt RANK(p2)) SWAP(p1,p2)
if((p HASH_LOOKUP(p1,p2)) return p return
CREATE_AND_VERTEX(p1,p2)
10AIG Simplification
- Simplification of AIGs can exponentially improve
Boolean reasoning. - BDD sweeping Kuehlmann97
- Local rewriting
- During construction, with two-level hashing
Kuehlmann02 - After construction, sharing-aware Bjesse04
- Cut-based, tailored to synthesis Mishchenko06
11SAT Sweeping
- SAT sweeping Kuehlmann04 is fast and robust
since it combines - Random simulation
- SAT queries
- Structural hashing
- Speedup in bounded model checking 10x-1000x
12SAT Sweeping Example
0
0
0
0
1
0
0
1
1
0
1
0
random simulation
random simulation
x1
V1
V4
V6
V8
refine classification
refine classification
0
0
1
0
1
1
1
1
0
0
1
0
x2
V2
V5
V9
V7
N
N
any class sizegt1?
any class sizegt1?
1
0
1
1
x3
end
end
Y
Y
V3
pick two vertices in same class do SAT query
pick two vertices in same class do SAT query
Use SAT solver to check the equivalence of v2
and v5.
V7
V1
SAT
SAT
UNSAT
V6
UNSAT
V4
merge vertices
update simulation vec.
update simulation vec.
merge vertices
v7 can be merged onto v6 since f(v7)f(v6).
Use SAT solver to check the equivalence of v6
and v7.
V2
V5
V3
13SAT Sweeping with ODCs
- Background
- Representations of Boolean Functions
- And-Inverter Graphs
- SAT Sweeping
- Improving SAT Sweeping with Observability
Dont-Cares - Motivating Example
- Observability and Local Observability
- Algorithm Flow
- Implementation
- Experimental Results
- Conclusions
14Motivating Example
x1
V7
V1
V4
V4
x2
x2 x3
V8
V5
V2
00
01
11
10
x1
0
V5
1
x3
V6
V6
V3
V6
?
P
V5
V4
?
?
15Observability
- Observability for AIGs without reconverging
paths - Full observability computation is VERY expensive!
(
)
otherwise
v
v
other(v, v)
16Local Observability
- k levels of observability obs(v, k)
- Criterion for merging vertices under local
observability
V
k0
k1
k2
k circuit depth
17Algorithm
- Equivalence-class refinement cannot be used since
the merging criterion is not an equivalence
relation. - Search for merging candidates of each vertex
individually. - Build a dictionary of simulation vectors to find
candidates efficiently.
?
P
18Algorithm (cont.)
- Mask simulation vectors with observability
vectors. - Compare simulation vectors and observability
vectors to filter candidates. - Check the merging criterion with a SAT solver.
OBS(v,2)0100
v
v
OBS(v,1)1101
w
F(w)0110
other(v,v)
19Algorithm Flow
random simulation compute obs vec.
random simulation compute obs vec.
111
1
110
0
x1
V7
V1
V4
for each vertex
for each vertex
find merging candidates from dictionary
find merging candidates from dictionary
110
0
110
0
x2
V5
V2
candidates exist?
candidates exist?
N
V8
001
110
0
1
x3
V3
V6
Y
Y
1-level observability
pick candidate vertex and do SAT query
pick candidate vertex and do SAT query
V1
V1
V2
V2
UNSAT
?
UNSAT
SAT
SAT
V5
update simulation vec.and candidates
update simulation vec.and candidates
merge vertices
merge vertices
V4
V6
20Dictionary Implementation
- Use a binary trie.
- Simulation vectors of vertices are stored in leaf
nodes.
F(v2)0110
1
0
bit 4
F(v3)1110
F(v4)0101
1
0
bit 3
F(v5)0100
21Dictionary Implementation (cont.)
- Search for merging candidates along the trie
using simulation vectors and observability
vectors.
F(v1) 0 1 0 0
OBS(v1, k) 1 0 1 0
1
0
bit 4
candidates for v1 are v4, v5
F(v4)0101
1
0
bit 3
F(v2)0110
F(v5)0100
F(v3)1110
22Reconverging Structure
x1
V1
V4
V4
V2
x2
V2
V6
1
V5
x3
V3
V4
Reconverging structure causes the problem.
Can v2 be merged to constant 1 if k2?
We use a conservative approximation of
observability to avoid this problem.
The controlling value at v4 changes!
23Experimental Results
- 15 designs from IWLS 2005 benchmark
set(synthesized from OpenCores repository) - Size from 200 to 48K AND vertices in AIG(200 to
30K Gates)
Basic SAT sweeping
24Experimental Results (cont.)
- Our approximation of observability is tight.
Compared with exact local observability - k2 0.1 fewer vertices merged on average
- k5 0.5 fewer vertices merged on average
25Experimental Results
- Application in bounded model checking
- Simplification of unrolled frames
P?
P?
P?
P?
26Conclusions
- ODC-based SAT sweeping simplifies AIGs
significantly more than basic version - 5.4x more vertices merged with 3 levels of
observability than with basic SAT sweeping (4.4x
runtime) - Greatest benefits from few levels of
observability - Captures 90 of mergers with 3 levels of
observability - Broadly applicable for Boolean reasoning
- Synthesis (combinational and sequential)
- Verification (bounded model checking, equivalence
checking) - Available at www.openedatools.org/projects/oagear
ODC-based SAT sweeping is simple and inexpensive,
and greatly speeds up Boolean reasoning.
27Future Work
- Sensitivity to iteration order
- Real effect on BMC, equivalence checking
- Algorithmic refinements
- vector computation
- Non-fixed k (depending on depth, reconvergence)
- Compare with redundancy removal
- Circuit-based SAT solver
28QA