Post on 16-Dec-2015
transcript
Global Flow Optimization (GFO) in Automatic Logic Design
“TCAD91”by
C. Leonard Berman&
Louise H. Trevillyan
Global Flow Optimization (GFO) in Automatic Logic Design
“TCAD91”by
C. Leonard Berman&
Louise H. TrevillyanCAD Group Meeting
Prepared by Ray Cheung
Global Flow Optimization in Automatic Logic Design
2CAD Group
OutlineOutline
Introduction
Background and Definitions
Min-Cut
Main Results
Discussion & Conclusions
Global Flow Optimization in Automatic Logic Design
3CAD Group
IntroductionIntroduction
Machine becomes more complex more logic Use local pattern matching to improve a circuit. Moving signal connections from one gate to another
or by deleting connection. Advantage – Efficiency, Effectiveness Disadvantage – Miss global information (only view at
small logic windows)
Main spirit of the GFO paper Use global flow analysis Gather and utilize information from the entire circuit. Especially faster than local transformation for large
circuits. Present how to use this global information to
simplify logic. Supply a firm theoretical foundation.
Global Flow Optimization in Automatic Logic Design
4CAD Group
Background & DefinitionsBackground & Definitions
Given a circuit C which have function F, which associate with every wire w, F(w).
Rearrange the connection points of w such that F(w) does not change.
Use data flow analysis, compute a quick approx. to F(w) and then construct a weighted, directed graph. Every cut of the graph corresponds to a set of
connection points for w. The cost of cut equals to the number of connection
points of w in the new circuit.
Global Flow Optimization in Automatic Logic Design
5CAD Group
DefinitionsDefinitions
All the logic is combinational and all functional nodes are single-output NOR’s.
If a signal i is an input to node j, we write i j
If there is a path from node i to node j, we write i j which means j is reachable from i.
Global Flow Optimization in Automatic Logic Design
6CAD Group
DefinitionsDefinitions
The set of immediate successors of a signal s as sink(s) = {t: s t}
The set of immediate predecessors of s as input(s) = {t: t s}
Global Flow Optimization in Automatic Logic Design
7CAD Group
DefinitionsDefinitions
If n is a node in C and S is a subset of nodes of C, then “n is blocked by S” if every path beginning at a sink of n and ending at an output contains a node of S.
Global Flow Optimization in Automatic Logic Design
8CAD Group
DefinitionsDefinitions
For each wire, x C, there are four sets of wires, forcing sets. Fij(x) = {s: if x = i then s = j}, i,j {0,1} Below shows F10 = {n1, n2, n3, n4, n8, n9, n12, n13, n18} There are F00, F01, F10 and F11
Global Flow Optimization in Automatic Logic Design
9CAD Group
Lemma 1Lemma 1
If i F10(s) and there is no path i s, then s may be connected as an input to node i without changing the function.
No path from i to s, therefore still DAG after reconnect.
If s = 0, no problem, since they are all NOR gate, 0 is non-controlling value of NOR gate.
If s = 1, since i F10(s), therefore no change.
Global Flow Optimization in Automatic Logic Design
10CAD Group
Lemma 2Lemma 2
If s is connected to node j in C and j is blocked by sinks(s) then the connection of s at j can be replaced by the constant 0 without changing the function of C.
If s = 0, two circuit equivalent.
If s = 1, since all NOR gate which s is connected. Therefore, there is no difference.
Global Flow Optimization in Automatic Logic Design
11CAD Group
DefinitionsDefinitions
A frontier node is defined as from this node to any primary output, there exists a path which does not contain a node in F10 or F11. i.e. the far-most node close to PO. E.g. {n8, n9, n12, n13}
Global Flow Optimization in Automatic Logic Design
12CAD Group
S-frontier of iS-frontier of i
S = { S1, …, Sn } be a set indexed by the nodes of C, and let Si be a set of nodes of C. This is summary information.
S-frontier of i denoted as c(i,S) Element of c(i,S) are nodes j such that
j Si There is a path j j1 j2 … OUTPUT such that for no jl Si; j is reachable in the circuit from i.
Global Flow Optimization in Automatic Logic Design
13CAD Group
Theorem 3Theorem 3
Let C be a circuit, and s a wire in C. Let F10 be the forcing set defined earlier, and let D be a set for which sink(s) D F10(s) and such that for no d D is there a path d s. If C’ is identical to C except that in C’, signal s is an input only to those nodes in c(s,D), then C C’.
Figure on the left side is C, and C’ on the right side.
Use Lemma 1 and Lemma 2 and the definition of c
Global Flow Optimization in Automatic Logic Design
14CAD Group
Corollary 4Corollary 4
Let C and C’ be two circuits which are identical except in the set of gates to which one wire s, is an input. Let F10 and F’10 be the two forcing sets for C and C’, respectively. Assume sink(s) D F10(s) and sink(s) D’ F’10(s). If c(s,D) = c’(s,D’) then C C’.
In the figure below, C C’.
Global Flow Optimization in Automatic Logic Design
15CAD Group
Alter connection of signal sAlter connection of signal s
Determine a set Ns of nodes of C such that n Ns with three properties. There is no path n s. Node n is blocked by c(s,D). If C is changed to C’ in which s is connected only at the nodes of
Ns, c(s,D) = c’(s,D)
Properties 1 and 2 are easy to determine.
But finding the minimal set of nodes which satisfies property 3 is NP-Hard – we call it Ns problem.
Efficient method (min-cut) to find an approximate solution to the Ns problem.
Other approach is Linear programming.
Global Flow Optimization in Automatic Logic Design
16CAD Group
Construction of GsConstruction of Gs
Add Nodes Source node labeled SOURCE with inf weight. Sink node labeled SINK with inf weight. For each iC10(s) which is reachable from s, add node(i) with weight = 1. For each node i, blocked by (s,C10), from which s is not reachable, add node(i)
with weight = 1. Add Edges
SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
For each node(k) with k (s,C10), add an edge from k to the sink.
Global Flow Optimization in Automatic Logic Design
17CAD Group
Construction of GsConstruction of Gs
Add Nodes Source node labeled SOURCE with inf weight. Sink node labeled SINK with inf weight. For each iC10(s) which is reachable from s, add node(i) with weight = 1. For each node i, blocked by (s,C10), from which s is not reachable, add
node(i) with weight = 1.
Global Flow Optimization in Automatic Logic Design
18CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
19CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
20CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
21CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
22CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
23CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
24CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
25CAD Group
Construction of GsConstruction of Gs
Add Edges SET = {(s,C10)} DO WHILE SET is not EMPTY
In reverse breadth first order, choose and remove i from SET A. Choose k{inputs(i)} for which
– k C10
– node(k) Gs
l {inputs(k)} node(l) Gs
B. For k found in A above
– Remove node(k) from Gs
l {inputs(k)}: add edge(l,I)to Gs, add node(l) to SET. If no such k exists, add edge (SOURCE, i)
End DO
Global Flow Optimization in Automatic Logic Design
26CAD Group
Construction of GsConstruction of Gs
For each node(k) with k (s,C10), add an edge from k to the sink.
Global Flow Optimization in Automatic Logic Design
27CAD Group
Derived Flow graphDerived Flow graph
Add a source node (src) and sink node (snk).
For each node in F10, add node in flow graph with weight 1.
Global Flow Optimization in Automatic Logic Design
28CAD Group
Max-Flow Min-Cut TechniqueMax-Flow Min-Cut Technique
Edmonds-Karp: O(|V||E|2)
Ford & Fulkerson: O(|E||f|)Note: For unit capacity, |f| |V|, so O(|V||E|) time.
s t
a b
c d
16
13
10 4 9 7
12
20
4
14
s t
a b
c d
11/16
12/13
10 1/4 9 7/7
12/12
19/20
4/4
11/14
min-cut = max-flow
Global Flow Optimization in Automatic Logic Design
29CAD Group
Theorem 5Theorem 5
Let K be any node cut separating the source and sink in Gs, and let C’ be a circuit which is identical to C except that the sinks of signal s are precisely those nodes which are cut by K, then c(s,C10) = c’(s,C10).
Proof Theorem 5 needs Lemma 6, 7, 8.
Theorem 5 allows us to rearrange the connections of signal s without changing the circuit functionality. Given a circuit C, and wire s, construct Gs
Use min-cut algorithm to find a node cut of Gs. Rearrange the connections of s based on the cut-set & Theorem 3.
Global Flow Optimization in Automatic Logic Design
30CAD Group
Lemma 6Lemma 6
Every gate in C corresponding to a node in Gs is blocked by (s,C10).
Global Flow Optimization in Automatic Logic Design
31CAD Group
Lemma 7Lemma 7
In Gs, every node corresponding to a gate in (s,C10(s)) is reachable from the SOURCE.
Global Flow Optimization in Automatic Logic Design
32CAD Group
Lemma 8Lemma 8
Every gate in C’ which corresponds to a node in Gs which is reachable from K is in C10(s). If the longest path from K to a node is 0, then s will be the direct
input of this node, there it is in C10(s). Assume it is true for the nodes of distance less than i+1 When the node n of distance is i+1,
By the construction of Gs, it implies One of the input to n is in C11(s) Therefore, n C10(s)
Global Flow Optimization in Automatic Logic Design
33CAD Group
Theorem 9Theorem 9
Let K be any cut separating SOURCE and SINK in Gs, then let C and C’ be related as in Theorem 5, then C C’.
Theorem 5 shows two Frontier are the same.
Theorem 9 shows two circuit are the same.
We have the following - Connection Optimization Procedure
PROC: OPTCON; /* OPTimize CONnections */ FOR EACH SIGNAL
CONSTRUCT Gs; FIND MINIMAL CUT, K; CREATE C’ AS IN THEOREM 9; C = C’;
END;
END OPTCON;
Global Flow Optimization in Automatic Logic Design
34CAD Group
ResultsResults
The flow graph has the following property. If the source node is re-connected to the corresponding nodes in the cut-set, the circuit is unchanged.
Therefore, the problem finding minimum number of nodes (fan-outs of s), can be solved by finding a minimum cut-set in the flow graph.
Cut-set reduce the fanouts from 6 to 3.
Global Flow Optimization in Automatic Logic Design
35CAD Group
ConclusionsConclusions
Present a new approach to logic optimization.
Use global flow analysis to gather information about the relationships between wires.
Use network flow to optimize the circuit.
Decreasing the number of fan-out nodes.
Is there any better approx. than recurrences approx.?
We can use Linear programming technique to replace min-cut technique.
Another ICCAD2000 paper introduced “Implication Flow Graph” based on GFO.
Because it has a larger solution space than GFO, and for the previous example, IFG can reduce the fanout of s from 6 to 2.
Global Flow Optimization in Automatic Logic Design
36CAD Group
The EndThe End
Please feel free to ask any question !