290 likes | 435 Views
A New Approach to Structural Analysis and Transformation of Networks. Alan Mishchenko November 29, 1999. Problem1: Locating Elements. Find all occurrences of the combination of AND-OR gate in the network of logic gates. Element. Network. Element. Element. a. a. c. c. b. b. d. d.
E N D
A New Approach to Structural Analysis and Transformation of Networks Alan Mishchenko November 29, 1999
Problem1: Locating Elements • Find all occurrences of the combination of AND-OR gate in the network of logic gates Element Network Element Element
a a c c b b d d Problem2: Replacing Elements Replace a given element with another one in all the places where is occurs. For example: c = a + b; d = ( a + b )&b = ab + b = b
Presentation Overview • Introduction • BDD basics • Product and quantification • Image computation • Labels • Location of structural elements • Replacement of structural elements • Conclusions Logic, Design, and Learning Group Seminar
Truth Table and Decision Tree x1 1 0 x2 x2 0 1 0 1 x3 x3 x3 x3 1 0 0 1 0 1 0 1 1 0 0 0 1 0 0 1
Reduction of Decision Tree Rule 1: Nodes must be unique Rule 2: Redundant tests should not be present a a a a b b b b b b
Decision Tree Reduction:Example x1 x1 x1 x2 x2 x2 x2 x2 Rule 2 Rule 1 x3 x3 x3 x3 x3 x3 x3 0 1 0 1 0 1 Reduced Tree BDD Decision tree
Introduction to BDDs • Canonicity • Compactness (with some exceptions) • BDDs represent various discrete objects • Boolean functions • Compositional sets • Encodings and labels • BDDs facilitate symbolic methods • Two-level minimization, state minimization, decomposition, ATPG, etc.
BDD Representation • Boolean functions • Characteristic functions • Combinatorial sets • Relations • FSM transition relations • Covering tables, matrices, graphs
Characteristic Functions: Example • Problem: Given the set {p1, p2, p3, p4, p5, p6 }, create the characteristic function of the subset {p1, p3, p4} and represent it using BDDs • Step 1: Introduce an encoding of the set p1–p2– p3 – p4 – p5 – p6– • Step 2: Define a function over the encoding variables (x1, x2, x3) such that it will be equal to 1 for minterms encoding the subset {p1, p3, p4}.
Characteristic Functions: Example (continued) {p1, p3, p4}(x0, x1, x2 ) = = + + • Step 3: Represent this function as a BDD x2 x1 x0 0 1
Labeling • To generate m unique labels • Define k = log2m binary labeling variables • Create m minterms, corresponding to the binary encoding of integers {0, 1, 2,… m-1} • Represent the minterms as BDDs over the labeling variables • For any assignment of labeling variables, only one label can be equal to 1
Boolean Relations • A boolean relation is a boolean function over two domains of binary variables (x1,x2,x3,…) and (y1,y2,y3,…). The function is true for an assignment of variables (x1,x2,x3,…,y1,y2,y3,…) iff assignments (x1,x2,x3,…) and (y1,y2,y3,…) are in a certain relation. • Example: Assignments (x1,x2,x3,…) and (y1,y2,y3,…) may be the codes of a present state and a next state of a Finite State Machine
Relations for FSMs Transition Relation T(x0,x1,y0,y1,i0,i1) = 00 01 / 0 1 1- / 1 00 / 1 01 3 00 / 1 10 2 11 / 1
Relations for Graphs • a and n are in relation AND2-direct • n and a are in relation AND2-reverse • a and b are in relation AND2-adjacent, etc.
Relations for Graphs • Assign each signal (“cut point”), each type of gate and relation a unique binary code (label) a - b - n - , etc AND2 - OR2 - EXOR2 - Direct - Reverse - Adjacent – • Create products for each couple of objects (like nodes in the graph) and multiply these objects by labels, defining their relationship • Compute a bdd equal to the sum of these products
Relations for Graphs • Create a structural BDD of the network • R(x2,x1,x0,y2,y1.y0,g1,g0,a1,a0) =
Structural BDD Representation • Encodes all information about structure (complementary w.r.t. the sensitivity function) • Lead to a new “calculus” for structural analysis and transformations of encoded graphs (logic networks) based on the following operations efficiently implemented in the BDD package • product/sum, • quantification (existential, universal, unique) • image/pre-image computation
Quantification • Given boolean function F(x1, x2, x3) • Existential quantification of F w.r.t. x1 is x1F(x1, x2, x3) = F(0, x2, x3) +F(1, x2, x3) • Universal quantification of F w.r.t. x1 is x1F(x1, x2, x3) = F(0, x2, x3) &F(1, x2, x3) • Unique quantification of F w.r.t. x1 is !x1F(x1, x2, x3) = F(0, x2, x3) F(1, x2, x3)
Image Computation • Given relation R(X, Y)and the set of assignments A(X), it is possible to compute the set of assignments B(Y) such that X and Y satisfy the relation R(X, Y). B(Y) =x [ R(X, Y) & A(X) ] • B(Y) is called the forward image of the set A(X) in the relation R(X, Y). • Similarly, it is possible to compute the backward image A(X) of the set B(Y).
Problem1: Locating Elements • Find all occurrences of the combination of AND-OR gate in the network of logic gates Element Network Element Element
a a c c b b d d Problem2: Replacing Elements c = a + b; d = ( a + b )&b = ab + b = b
a c b d Solution of Problem 1: Idea • Given the structural representation of the network R( X, Y, A ), it is possible to find relations between any types of “cutpoints”
Solution of Problem 1 (cont.) • Cut-points b and c are in relations OR2-direct and AND2-adjacent • Relation between all possible occurrences of b and c throughout the network is Rbc(X,Y) = R(X,Y,AOR2D) & R(X,Y,AAND2A) • The characteristic function of all occurrences of the structural element (located using b-type cut-points as references)is Lb(X) = y Rbc(X,Y)
a a c c b b d d Solution of Problem 2: Ideas • Find the char. function Ld of the d-type cut-points • Extract relations with d from R(X,Y,A) • Remove relations b-d-AND2D and d-c-AND2D from the extracted relation • Remove relations b-c-AND2A from R(X,Y,A) • Replace d-encoded cut-points for b-encoded cut-points in the remaining extracted relations • Add them to the structural bdd R(X,Y,A)
Solution of Problem 2 (cont.) • Characteristic function Ld of d-type cut-points is Ld(X) = y [ R(X,Y,AAND2D) & Lb(Y) ] • Extract relations with d extracted from R(X,Y,A) Rd(X,Y,A) = R(X,Y,A) & Ld(X) • Remove b-d-AND2D and d-c-AND2D from Rd Rd*(X,Y,A) = Rd (X,Y,A) & Lb(X)’ & Lc(X)’ • Remove b-c-AND2A from R(X,Y,A) R*(X,Y,A) = R(X,Y,A)&( Rbc(X,Y) )’ • Replace d-type cut-points for b-type cut-points R**(X,Y,A) = z [Rbd(X,Z) & Rd*(Z,Y,A)] • Add this relation to the structural representationR(X,Y,A) = R(X,Y,A) + Rd**(X,Y,A)
Universal Search Algorithm • Step1: Traverse the fragment starting from the outputs and mark the overlapping cut-points • Step 2. Recursively call the search procedure for each output of the fragment
Recursive Procedure (sketch) • In this node • Call the procedure for two (or more) siblings • When they return the sets of cut-points • If the incoming sets of the node are disjoint, multiply their images • If the incoming sets are non-disjoint (the branches are symmetric or quasi-symmetric), apply the following transformation (see next slide) • At the meeting points of two overlapping branches, find the intersection of sets of possible cut-points • Return the result
(Quasi-)Symmetric Branches • Computing the two related sets of ordered output cut-points R(Z1,Z2) = Y[R(Y,Z1,AND2R) & R(Y,Z2,AND2R) & Z1 Z2] S1(Z1) = Z2[R(Z1,Z2)] S2(Z2) = Z1[R(Z1,Z2)] • Computing the “merged set” S(Y) =(Z1[R(Y,Z1,AND2R) & S1(Z1)]& Z2[R(Y,Z2,AND2R) & S2(Z2)]) + (Z1[R(Y,Z1,AND2R) & S2(Z1)]& Z1[R(Y,Z2,AND2R) & S1(Z2)]) Z1 Z2 Y