250 likes | 260 Views
This research paper explores the technique of resubstitution for logic optimization, specifically focusing on enhancements such as direct register elimination, dependency function minimization, dynamic basis, and compatible dependencies. The paper also discusses the results and the impact on verification.
E N D
Invariant-Strengthened Elimination of Dependent State Elements Michael L Case †‡ Alan Mishchenko † Robert K Brayton † Jason Baumgartner ‡ Hari Mony ‡ † University of California, Berkeley ‡ IBM Systems and Technology, Austin, TX
Resubstitution Basics • Working in an RTL level design • Let g1, g2, …be “basis functions” • Let X be a “target function” • To resubstitute is to find a dependency function f() s.t. X = f(g1, g2, …) Mike Case, FMCAD 2008
Why Resubstitute? • For Synthesis: • Increases logic sharing • Decreases total area • For Verification: • Can be tailored to reduce the number of latches • #latches more important than #gates • Traditionally performed with BDDs • BDDs don’t scale to many/large g’s • SAT-based approach first proposed by Lee, Jiang et. al., ICCAD 2007 Mike Case, FMCAD 2008
= = = Replace X with I Resubstitution with Interpolation 1 • Interpolant I has the properties: • I is a function of the g’s only • onset → I → ¬ offset X’s onset X’s offset (1) (0) X X g1 g3 g2 g1 g3 g2 Circuit copy 2 Circuit copy 1 Mike Case, FMCAD 2008
Our Objectives • Proposed approach is a good foundation, but missing many practical details • Improve SAT-based Resub • Guard against interpolant logic bloat • Improve speed and scalability • Provide details necessary for industrial use • Extend to sequential synthesis • Apply to Verification • Reduce the registers as much as possible Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
time == 0 S InitialState S T1 T2 T1 T2 (c) Eliminate S by separating time 0 and time > 0 behavior (b) Resubstitute next(S) in terms of the other next-state function 0 1 Register Elimination S T1 T2 (a) Original Circuit Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
= = = = = = 1 1 X X X X g1 g3 g2 g1 g3 g1 g3 g1 g3 g2 g2 g2 Dependency Function Minimization • Interpolant logic may be bloated • Note: Test function is symmetric • Extract both dependency functions and choose the “best” one Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
Dynamic Basis • Large basis set can slow resubstitution basisSet := while (1) { switch (resubsitute(X, basisSet)) { case Counterexample: Find new basis elements to block the cex. if (! new basis elements) return “resub failed” case Unsat: Interpolate, simplify circuit return “resub succeeded” } } Mike Case, FMCAD 2008
0 1 X 1 1 0 0 0 X 0 0 X X X X X Dynamic Basis • Heuristic method with risks • May add too many basis functions • Might miss a basis function • If tuned properly, 80x speedup Resubstitution Test Function • For a particular state var S, next(S1)=1 & next(S2)=0 • For every other state var T, next(T1) = next(T2) next(S1) next(S2) 1 0 1 1 0 X Next StateFunctions Next StateFunctions Copy 1 Copy 2 Inputs / Current State Inputs / Current State Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
One-Hot Encoding: Valid resubstitutions: R1 R2 R3 R4 R1= R2 R3 R4 1 0 0 0 R2= R1 R3 R4 0 1 0 0 0 0 1 0 Optimize Logic: 0 0 0 1 R1= R1 R3 R4 Compatible Dependencies • Not all resubstitutions are compatible • Use of many dependency functions may lead to combinational cycles Mike Case, FMCAD 2008
Compatible Dependencies candidates := order(foundResubs) accepted := foreach C in candidates { if (! isCyclic(C accepted)) { accepted += C } } • Need to discard 24% of the found resubstitutions, on average • Ordering is very important for keeping the most valuable resubs Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
Invariants Invariants Strengthening with Invariants • Leverage invariants Resubstitution Test Function • For a particular state var S, next(S1)=1 & next(S2)=0 • For every other state var T, next(T1) = next(T2) • Invariants = 1 Next StateFunctions Next StateFunctions Copy 1 Copy 2 Inputs / Current State Inputs / Current State • Makes this a sequential transformation • Allows us to find resubstitutions post-retiming Mike Case, FMCAD 2008
Invariant Generation Techniques • Over-approximate reachability • Conjunction of many small local invariants gives a reachability approximation • Simple algorithm: • Use simulation to guess candidate invariants • Use induction to prove the candidates • Many types of invariants in our code: • Constants • Equivalences • Implications • Prove invariants in batches and vary the invariant families to take advantage of their orthogonal strengths • Invariants from circuit cuts • Random clauses Mike Case, FMCAD 2008
Candidate Invariant C Amount by which Cstrengthens Iis C I Reachable State Set If C is proved,I := C I Simulation Filtering • Simultation allows us to focus on the “best” candidate invariants • Want a tight reachability approximation Reachable State Set Proved Invariants I Mike Case, FMCAD 2008
Typical Invariant Run Few candidate implications Mike Case, FMCAD 2008
Outline • Resubstitution Enhancements • Direct register elimination • Dependency function minimization • Dynamic Basis • Compatible Dependencies • Invariant Strengthening • Results • Register reductions obtained • So what? The effect on verification. Mike Case, FMCAD 2008
Results: Reg Reductions • Heavily synthesized designs • Invariants very important • 12% register reduction on average • Usually a net gain in ANDs Mike Case, FMCAD 2008
Results: Effect on Verification • Run verification flow (SixthSense) on 267 IBM designs • 141 have remaining properties • Resubstitute, run verification flow again • Additional properties proven in 10 designs • Register reductions helpful in: interpolation, BMC, induction Mike Case, FMCAD 2008
Summary • Extended previous work: • Direct register elimination • Address potential logic bloat • Scalability improvements • Compatibility issues explored • Invariant strengthening • Results demonstrated to: • Reduce design size • Simplify verification efforts • Questions? Mike Case, FMCAD 2008