Title: An Efficient Hybrid Constraint Solver for RTL Circuits
1An Efficient Hybrid Constraint Solver for RTL
Circuits
2Overview
- Boolean SAT Checking very fast, but
- Cost of RTL synthesis
- Poor performance on RTL with arithmetic
- Combine Boolean SAT with Arithmetic solving
- Enables direct SAT Checking on RTL
- Avoid costs of synthesis to Boolean domain
- Leverage RTL abstraction
3Outline
- Prior Work
- DPLL
- Modeling
- HDPLL
- Conflict-based Learning
- Experimental Data
- Future Directions
4Prior Work
- Barrett et. al SVC FMCAD 1996
- Implementation of Shostaks decision procedure
- Boolean, Ints, Arrays, Un-interpreted fns
- C. Liu et al. ICCAD, 2003
- CAMA SAT check of multi-valued logic
- Explicit representation impractical for
arithmetic - Fallah et al. DAC 1999, Huang et. al.DAC 2000
- Zeng et al. DATE 2001, M. Iyer ITC, 2003
- All have performance issues on RTL.
5Modern Boolean DPLL
- while (Decide() ! Done) do
- while (bcp() conflict) do
- blevel analyzeconflicts()
- if (blevel 0) then
- return UNSATISFIABLE
- else
- backtrack(blevel)
- end if
- end while
- end while
- return SATISFIABLE
- Key Factors for Performance
- Fast BCP 2 watched literals Dynamic Decision
Ordering based on learning Moskowicz et. al. - Conflict-based learning Non-chronological
backtracking Stallman, Marques-Silva et.al.
6Finite-Domain Constraints
- All RTL variables have finite domains
- Finite upper/lower-bounds
- eg. reg register70
- Boolean variables also have finite domains
- 0,1
- A constraint is defined as
- å ai . xi ? r , where, xi , r ? I
- Primitive Constraints have at most 3 variables
- RTL descriptions written as conjunct of
constraints
7Modeling RTL Operators
- Max Range L 2n 1, where n is bit-width of
primitive - Word operators can have Boolean outputs/inputs
- These Boolean variables are interface points
b
B
?
b2
8Modeling RTL Operators
- Model non-linear ops eg., concat, shifts by
- Bit-slicing Brinkmann et al. VLSI Design, 2001
9Hybrid DPLL
loop while (Decide() ! Done) while
(FdcpFme() conflict) blevel
hybrid_analyzeconflicts() if (blevel 0)
then return UNSATISFIABLE
else backtrack(blevel) end loop
- Decide() only on Boolean variables
- FdcpFME() does constraint propagation
10Consistency of Constraints
- Constraint locally consistent if some value in
domain of each variable satisfies it - a 2,...,3 b 2,..,3 ? 5 Consistent
Constraint - a 0,...,2 b 0,..,2 ? 5 Inconsistent
Constraint - Globally consistent if all constraints
simultaneously consistent - a 0,...,2 b 2,..,3 ? 5
(1) - a 0,...,2 c 0,..,1 ? 1
(2) - only a 2 satisfies (1),
- but that causes (2) to be inconsistent.
11Detecting Inconsistency
- Constraint propagation detects local
inconsistency - Bounds propagation very efficient
- Ensures bounds of variable consistent with
constraint - Caveat
- Even if all constraints are locally
consistent, that does not mean that constraint
set is globally consistent
12Finite-Domain Constraint Propagation
- Similar to Boolean Constraint Propagation(BCP)
- BCP has one rule to rule them all
- .. a clause shall imply only when all literals
in the clause but one has gone to false.. The
unit clause rule - FDCP has many rules
- Efficiency suffers
- Solutions to efficiency problem
- Minimize number of variables in constraint
- Minimize evaluations for implication
- Evaluate when implication guaranteed
13Constraint Watching
5
a 2 b 2,..,7 c 1,2
?
RHS (r)
LHS
vg
vi
vi -
- D(vi ) is the domain of word variable vi
- Watch bounds of constraint
14Constraint Watching rules
- Constraint is satisfied if wsumc wsumlb ? r
- No additional implications
- Constraint is conflicting if wsumc wsumub lt r
- If wsumc lt r and wsumub- wsumlb- wsumc ? r
- Constraint currently inconsistent
- Can be made consistent by bound changes
15Completeness Issues
- Constraint Propagation cannot guarantee
consistency under all conditions - Can fix by deciding on all variables
- Eventually the conflict will be detected if it
exists - But we dont make decisions in data-path
- We use Omega Test for global consistency
- Implementation of Fourier-Motzkin elimination
- Complete decision procedure for integer arithmetic
16Global Consistency ? Use FME
3
b0 1
- Conflict not caught by constraint propagation
- No conflict does not guarantee satisfiability
- Need to ensure completeness
- So, use FME as global consistency check procedure
17HDPLL In Action
W1 5
5
i1 1
w5
W2 6
Proposition
6
i2 0
w7
S0 0
b0 1
decision
7
i3 1
W3 7
w6
W4 8
S1 1
decision
- Comparators are remodeled as two geqs each
- i1 modeled by b1 ? w7 ? 5, b2 ? 5 ? w7
- i2 modeled by b3 ? w7 ? 6, b4 ? 6 ? w7
- i3 modeled by b5 ? w7 ? 7, b6 ? 7 ? w7
- b1, .. , b6 are Boolean
18Hybrid Conflict-based learning
- Learning UIPs implies learning hybrid clauses
- Conflict analysis on implication graph is complex
- Compromise by learning only on interface points
19Experimental Results
- Solver is combinational
- Safety property checking on ITC benchmarks using
BMC Biere et. al. DAC 1999 - Properties on b01, b02, b04 and b11
- Expanded by 10, 15 and 20 time-frames
- 2.4 GHz Pentium 4, 1 GB RDRAM
- Time-limit of 3600 CPU secs
20Benchmark suite characteristics
Number of Operators
21Relative size of Boolean/Arithmetic
Boolean to Arithmetic Ratio
22Effect of Constraint Propagation
100 CPU-time (secs)
23Comparison with SVC
100 CPU-time (secs)
24Conclusion
- HDPLL viable for RTL SAT checking
- Faster than SVC on benchmarks
- Strengths of paper
- Efficient integration of two decision procedures
- Efficient FDCP
- Conflict-based Learning
- Areas for improvement
- Current conflict-based learning inefficient
- Structure of data-path not cleverly used
- Not sequential
- Modeling issues remain
25Future Work
- Hybrid UIP Learning
- Hybrid clauses has Boolean and Word variables
- Two-literal watching for hybrid clauses
- Resolution-graph based learning in FME
- Advanced learning and decision strategies
- Hybrid learning for sequential search
- HDPLL decision proc. for opt. engine
26The End
27Prior Work In detail
28Hybrid Constraint Propagation
for all (ai ? impqueue) do if (fdcp (ai)
conflict) then return conflict end if end
for for all (ai ? impqueue and ai ? IPO IPI )
do if (fme () conflict) then return
conflict end if end for
- Impqueue holds event driven implications to be
evaluated - Fdcp(ai) processes one event
- Fme() checks all current values on interface
points - Result is complete
29Improvements on DAC techniques
100 CPU-time (secs)
30Future Work
- Decision making on all variables
- Make decisions on Word and Boolean variables
- Advanced learning and decision strategies
- Advanced static and dynamic learning tech.
- Auto. constraint extraction Integration of more
theories - Hybrid learning for sequential search
- HDPLL decision proc. for opt. engine