1 / 25

Resubstitution for Logic Optimization

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.

wmejia
Download Presentation

Resubstitution for Logic Optimization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. 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

  4. = = = 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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

  10. = = = = = = 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. Typical Invariant Run Few candidate implications Mike Case, FMCAD 2008

  22. 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

  23. Results: Reg Reductions • Heavily synthesized designs • Invariants very important • 12% register reduction on average • Usually a net gain in ANDs Mike Case, FMCAD 2008

  24. 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

  25. 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

More Related