Download Advanced Reachability Analysis: BDDs, Variable Ordering, and Efficient Computation and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!
ECE 510 OCE
BDDs and Their Applications
Lecture 10. Advanced Topics in
Reachability Analysis
April 27, 2000
Alan Mishchenko
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 2
Overview
- Variable ordering for reachability analysis
- Extension of Malik’s heuristics for static ordering
- Combination of static and dynamic reordering
- Generalized cofactor and its flavors
- Improvements to image computation
- Interleaved variable ordering
- Iterative squaring
- Transition relation clustering
- Recursive image computation
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 3
Variable Ordering for Sequential Logic
- Good static variable ordering heuristics are known (Malik’s fan-in heuristic for functions given as a net list)
- They can be extended to sequential logic by
- finding a permutation θθθθ of outputs Fk(x), 1≤k≤n, of the next- state (output) logic blocks that minimizes the cost function:
ΣΣ ΣΣ 1 ≤i≤n | ∪∪∪∪ 1 ≤k≤i [ Supp( Fθk(x) ) ] |,
where Supp(F) is input support of F and |S| is the set size
- interleaving the input and output variables as follows: Supp( Fθ1(x) ) < yθ1 < Supp( Fθ2(x) ) - Supp( Fθ1(x) ) < yθ2 < … <
Supp( Fθn(x) ) - ∪∪∪∪ 1 ≤k≤n-1 [ Supp( Fθk(x) ) ] < yθn
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 4
Static and Dynamic Variable Ordering
- The success of the algorithms critically depends on the size of BDDs, which are very sensitive to var ordering
- In practice, the combination of static and dynamic variable ordering proved to be helpful
- First, a good static ordering is found
- Next, dynamic reordering is aumatically initiated when one of the two criteria is met: - the size of the intermediary BDDs has reached a certain threshold value - the size of the intermediary BDDs has increased by a certain value since the last call to reordering
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 5
Generalized Cofactor
- Generalized cofactor extends the concepts of “classic” cofactor (cofactor of the given function w.r.t. a cube) to the cofactor w.r.t. an arbitrary function
- Generalized cofactor has a number of flavors
- It serves diverse purposes in BDD-based applications:
- constraint and restrict are used to reduce the size of the BDD by exploiting don’t cares of the function
- constraint is used to create an alternative image computation procedure
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 6
Generalized Cofactor: Constraint
- To define one type of generalized cofactor of function F with respect to the care set C (the complement of the
don’t care set of the function), a mapping π (called the
shortest interpretation) is defined for the domain of F: if C(x)=1, πc (x)=x
if C(x)=0, πc (x)=argmin y,c(y)=1[ΣΣΣΣ 1 ≤i≤n |xi-y i|*2 n-i^ ]
The generalized cofactor constraint is defined as F↓C = F( πc (x) )
- Constraint is also known as image restrictor, because it reduces image computation to range computation
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 7
Interpretation of Mapping π and F↓C
Bn
C
ON-set of F
OFF-set of F
πc(xi )
x i
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 8
Interpretation of Im R(C) = ImR↓C( Bn^ )
Bm
Y
R: Bn^ → Bm
Bn
C
πc(xi )
x i
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 9
Recursive Computation of Constraint
bdd Constraint ( bdd F, bdd C ) { assert( c != bddfalse ); if ( C == bddtrue || F == bddtrue || F == bddfalse ) return F; // check cache for ready results int var = bdd_var( C ); if ( C (^) VAR’ == bddfalse ) return Constraint ( FVAR , C (^) VAR ); if ( C (^) VAR == bddfalse ) return Constraint ( FVAR’ , C (^) VAR’ ); bdd Res=var’ & Constraint(FVAR’ ,C (^) VAR’ )+var & Constraint(FVAR’,C (^) VAR’ ); // insert the result into cache return Res; }
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 10
Generalized Cofactor: Restrict
- It was noticed that constraint is not efficient in reducing the node count of the BDD of the function F when the care set C has a large BDD
- In particular, it happens when C depends on some input variables, on which F does not depend
- The “improved” generalized cofactor (called restrict) overcomes this by smoothing (quantifying) away those variables in C that do not belong to the support of F
- As a result, restrict is more efficient than constraint in reducing the BDD size
- However, restrict cannot used as image restrictor
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 11
Recursive Computation of Restrict
bdd Restrict ( bdd F, bdd C ) { assert( c != bddfalse ); if ( C == bddtrue || F == bddtrue || F == bddfalse ) return F; // check cache for ready results int var = bdd_var( C ); if ( C (^) VAR’ == bddfalse ) return Restrict ( FVAR , C (^) VAR ); if ( C (^) VAR == bddfalse ) return Restrict ( FVAR’ , C (^) VAR’ ); if ( var != bdd_var( F) ) return Restrict ( F , ∃∃∃∃VAR C ); bdd Res = var’ & Restrict (FVAR’ ,C (^) VAR’ )+var & Restrict (F (^) VAR’,C (^) VAR’); // insert the result into cache return Res; }
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 12
Interleaved Variable Ordering
- Interleaving input and output variables reduces the BDD size by exploiting the dependency between codes of the current state and the next state (it is more noticeable when states that are connected by transitions are encoded using the Grey code)
- Interleaving the variables leads to an efficient variable replacement procedure, which allows to substitute next state variables in the image by performing one pass over the BDD representing the image
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 13
Iterative Squaring
- Iterative squaring is used to reduce the number of iterations in reachability analysis
- Given the transition relation R 1 (x,y), compute the transition relation for states that are reachable in two transitions, four transition, etc. as follows:
R 2 (x,y) = ∃∃∃∃z [ R 1 (x,z) & R 1 (z,y) ]
R 4 (x,y) = ∃∃∃∃z [ R 2 (x,z) & R 2 (z,y) ]
- Iterative squaring is closely related to the computation of transitive closure
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 14
Transition Relation Clustering
- The motivation for transition relation clustering is the need to reduce the BDD size for large sequential logic
- It is achieved by exploiting the property of existential quantifier that can be moved across expressions that do not depend on variables being quantified
- Given the clustered transition relation R(i,x,y) =∏R (^) k (i,x,y), Im (^) R(A) = ∃∃∃∃x,i ( [∏R (^) k (i,x,y) ] & A(x) ) = = ∃∃∃∃xn,i n ( Rn(i,x,y) & ∃∃∃∃xn-1,in-1( R (^) n-1 (i,x,y) & ... ∃∃∃∃x 2 ,i 2 ( R 2 (i,x,y) & ∃∃∃∃x 1 ,i 1 ( [R 1 (i,x,y) & A(x)] ) ) ) )
April 27, 2000 ECE 510 OCE: BDDs and Their Applications 15
Recursive Image Computation
- This method of recursive computation of the image is based on reduction of image computation to the range computation
- The procedure proceeds by recursively cofactoring w.r.t a variable of the input or the output domain
- Using the abbreviation rg(f) to denote the range of the vector function f = {f 1 ,f 2 ,…,fn}, we get the following: rg(f)(y) = y 1 ’ & rg( {f 2 ,…,fn}|f1’ )+y 1 ’ & rg( {f 2 ,…,fn}|f1 ) or rg(f)(y) = rg( {f 1 ,f 2 ,…,fn}|x1’ ) + rg( {f 1 ,f 2 ,…,fn}|x1 )