230 likes | 372 Views
To SAT or Not to SAT: Ashenhurst Decomposition in a Large Scale. Hsuan-Po Lin , Jie-Hong Roland Jiang, and Ruei-Rung Lee Graduate Institute of Electronics Engineering / Department of Electrical Engineering, National Taiwan University. 1. Outline. 1. 2. 3. 4. 5. Conclusions.
E N D
To SAT or Not to SAT:Ashenhurst Decomposition in a Large Scale Hsuan-Po Lin, Jie-Hong Roland Jiang, and Ruei-Rung Lee Graduate Institute of Electronics Engineering / Department of Electrical Engineering, National Taiwan University ICCAD 2008 1
Outline 1 2 3 4 5 Conclusions Introduction Prior Work Our Approach Experimental Results ICCAD 2008
Introduction • Ashenhurst decomposition • f(X) = h(XH,XC,g(XG,XC)) • When can f be decomposed as the composition of some g and h? • Comprehensible using decomposition chart ICCAD 2008
Decomposition Chart XH : {c} XG : {a,b} XC : {d} d g b a XGXC f a,b,d c XH XC c,d g h h XH XC c,d f ICCAD 2008 • f(a,b,c,d) = h(c,d,g(a,b,d))
Prior Work • BDD-based functional decomposition • Memory explosion problem • Variable partition cannot be automated • Hard to handle non-disjoint decomposition • Multiple-output decomposition cannot be handled naturally ICCAD 2008
Our Approach • SAT-based computation • Interpolation get g • Functional dependency get h • With/without pre-specified variable partition • Single-/multiple-output decomposition ICCAD 2008
Single-Output Decomposition • Problem formulation • Given a function f(X) withvariable partition X={XG|XH|XC}, find g and h such that f(X) = h(XH,XC,g(XG,XC)) ICCAD 2008
Decomposabilityas SAT 1 1 1 f f f f f f xc[[XC]] f XH2 XH3 XH2 XH3 XH1 XH1 XG1 XG3 XG1 XG3 XG2 XG2 XC XC XC XC XC XC ICCAD 2008 Functions g and h exists iff (f(XH1, XG1, XC)≠ f(XH1, XG2, XC))Λ (f(XH2, XG2, XC)≠ f(XH2, XG3, XC))Λ (f(XH3, XG3, XC)≠ f(XH3, XG1, XC))is UNSAT
Craig Interpolation P φA φB For formulas φA and φBwith φAΛ φB UNSAT, then there exists an interpolant P of φA such that 1. φAP 2. PΛφB is UNSAT 3. P refers only to the common variables of φA and φB We show the connection between P and g ICCAD 2008
Interpolating g-function 1 1 1 • P: refer to the common variables XG1, XG2, XC • φA: CP(XG1)≠CP(XG2) • φB: CP(XG2)≠CP(XG3),CP(XG1)≠CP(XG3), i.e., CP(XG1)=CP(XG2) f(XH1, XG1, XC)≠ f(XH1, XG2, XC) (f(XH2, XG2, XC)≠ f(XH2, XG3, XC))Λ (f(XH3, XG3, XC)≠ f(XH3, XG1, XC)) φA φB f f f f f f XH3 XH2 XH3 XH1 XH1 XH2 XG2 XG3 XG1 XG1 XG3 XG2 XC XC XC XC XC XC ICCAD 2008
Interpolating g-function (cont’d) a offset XG1 XG1 XG2 XG2 p p onset q q r r s s Relation characterized by P(XG1, XG2,c)for some c [[Xc]] Relation after cofactoring P(XG1=a, XG2,c) w.r.t. some a [[XG1]] … … … … P(XG1=a, XG2, XC) is a feasible implementation of g(XG, XC)! ICCAD 2008
Computingh-function • A naïve approach • For XC = , function h can be derived using Shannon expansion h(XH,xg)=(xg Λhxg) v (xg Λhxg) • Non-scalable(w.r.t. XCsize) where hxg(XH) = h(XH,0) = h(XH,g(XG=a)) = f(XH,XG=a) and hxg(XH) = h(XH,1) = h(XH,g(XG=b)) = f(XH,XG=b) for a,b[[XG]] with g(a)=0 and g(b)=1 ICCAD 2008
Computingh-function (cont’d) • A scalable approach • Function h can be obtained with functional dependency formulation • f(X) = h(φ1(X), φ2(X),…, φm(X)), where h is the unknown to be computed • Let the above gi be such that φi = xi with xi XHXC for i = 1,…,m-1 φm = g(XG,XC) • So-derived h is what we want • Computation can be done with pure SAT solving [Lee et al.07] ICCAD 2008
Overall Flow AshenhurstDecomposition(f, XH, XG, XC): FCircuitInstantiation(f ) (φA, φB) CircuitPartition(F) P(XG1,XG2,XC) Interpolation(φA, φB) g(XG,XC) Cofactor(P, a[[XG1]]) h FunctionalDependency(f, g) return(g, h) ICCAD 2008
AutomatingVariable Partition 1 1 1 f f f f f f XH6 XH5 XH4 XH3 XH1 XH2 XG5 XG4 XG6 XG3 XG2 XG1 XC6 XC5 XC4 XC1 XC3 XC2 ICCAD 2008 • For each xi X, add conditional clauses for XG: ((xi2≡xi3)Λ(xi4≡xi5)Λ(xi6≡xi1)) V ai conditional clauses for XH:((xi1≡xi2)Λ(xi3≡xi4)Λ(xi5≡xi6)) Vbi • (ai,bi) • (0,0) xi XC • (0,1) xi XG • (1,0) xi XH • (1,1) xi can be in either of XG and XH
AutomatingVariable Partition (cont’d) • Make “unit assumptions” on control variables ai, bi for each xi • Avoid trivial partition • Impose seed partition • Enforce one variable in XH • Enforce two variables in XG • Enumerate seed partitions • Incremental SAT solving • Apply minimal UNSAT core refinement to reduce XC ICCAD 2008
Multi-Output Decomposition i i XH f X h XC i ... ... g XG xg New UNSAT condition: V(fi(XH1, XG1, XC)≠ fi(XH1, XG2, XC))Λ V(fi(XH2, XG2, XC)≠ fi(XH2, XG3, XC))Λ V(fi(XH3, XG3, XC)≠ fi(XH3, XG1, XC)) Computation is same as before ICCAD 2008
Experimental Setup • Implemented in ABC using MiniSAT • Linux, Xeon 3.4GHz CPU, and 6Gb RAM • Decompose primary-output and transition functions • Only functions with no less than 50 inputs are considered • ISCAS, MCNC, and ITC ICCAD 2008
Experimental Results Single-output decomposition ICCAD 2008 Two-output decomposition
Experimental Results (cont’d) Variable partition before / after UNSAT core refinement ICCAD 2008
Experimental Results (cont’d) |XC|/|X| ||XG|-|XH||/|X| w/o mini w/ mini Variable partition qualities resulted from different efforts ICCAD 2008
Conclusions • Proposed pure SAT-based Ashenhurst decomposition • Easily extendable to non-disjoint and multiple-output decompositions • Scalable to functions with up to 300 input variables • Future work • Functional decomposition beyond Ashenhurst ICCAD 2008
Thanks forYour Attention! ICCAD 2008