If two modules b i and b j are in horizontal relation, then there is an edge between i and j in GH, and thus they do not overlap horizontally in the resulting placement.. Because any pai
Trang 1For the exchange and insert (rotate and randomize) operations, the first l terms of the given CS will not
be changed during perturbation, where l = min{i, j} − 1(l = i − 1) Therefore, for each perturbation,
we only need to consider the modules after the lth term and perform incremental update on the existing packing (solution) The coordinate of module b i in S i , i = l + 1, , m, can be obtained by inserting a node n i into two neighboring nodes n j and n k in L if D i = [j, k] However, if the designated nodes do not exist in L, we randomly insert the node n i into two arbitrary neighboring nodes n qand
nr in L, and thus D i = [q, r] Note that we can guarantee a feasible solution after each perturbation
by applying this process
Figure 11.8 illustrates the procedure to perturb the CS using the exchange operation If two
modules f and h in S6and S8are exchanged, we have the new CS shown in Figure 11.8a Figure 11.8b
shows the placement and L for the CS before perturbation Modules a, b, c, d, and e are in the first five terms of the CS, and will not be changed for this perturbation because l= min{6, 8}−1 = 5 here The coordinates of the modules in the last three terms of CS can be obtained by their corresponding bends (We insert nodes between two designated neighboring nodes according to their bends) Figure 11.8c
shows the resulting placement and L after we insert the node n h between the nodes n e and n cin the
L of Figure 11.8b Then, for module g, we cannot place it at the designated bend [c, t] because there
do not exist two adjacent nodes n c and n t in the L of Figure 11.8c Therefore, we randomly insert
ng into two arbitrary neighboring nodes in L There are three candidate bends for placing module g: [s, e], [e, h], and [h, t] (see the L and the placement) If we insert n g between n e and n h(the new
bend of module g becomes [e, h]), the resulting placement and L is given in Figure 11.8d Similarly,
we intend to insert n f between nodes n f and n c for the module f in the L of Figure 11.8d However,
CS ⬘ = 〈 , (h, [e, c]) (g, [e, h]) (f, [g, h]) 〉
(f)
(a)
n s n e
Exchange f and h
CS = 〈 , (f, [e, c]) (g, [c, t]) (h, [f, c]) 〉
CS ⬘ = 〈 , (h, [e, c]) (g, [c, t]) (f, [f, c]) 〉
n c n t L
n s n e n h n t
L L n s n g n h n t L n s n f n t
(b)
(d)
b
e h
f g
b
e h g
b
e h
b
e
h f
g
FIGURE 11.8 Example of exchanging two modules b f and bh in S6and S8for the CS (a) CS after the modules
in S6and S8have been exchanged (b) L for those modules a, b, c, d, and e whose coordinates remain the same (c)–(e) Resulting placement and L after the modules h, g, and f have been packed, respectively (f) Resulting
CS after the operation (From Lin, J.-M., Chang, Y.-W., and Lin, S.-P., IEEE Trans VLSI Syst., 11, 679, 2003.
With permission.)
Trang 2the resulting CS shown in Figure 11.8f.
11.5 SEQUENCE PAIR
Sequence pair (SP) is proposed by Murata et al [6] An SP is an ordered pair of module name sequences to model general floorplans
Figure 11.9 gives an example placementP on a chip The following procedure encodes P to an SP For each module b i, we draw two lines, up-right locus and down-left locus The up-right locus of module
bi is initially located at the upper-right corner of b i and starts to move upward It turns its direction alternately right and up until it reaches the upper-right corner without crossing: (1) boundaries of other modules, (2) previously drawn lines, and (3) the boundary of the chip The down-left locus of
bican be drawn in the similar method The union of these two loci and the connecting diagonal line
of b i is called the positive locus of b i They are referred to by the corresponding module names An example of resulting positive loci is shown in Figure 11.10a
With the construction of positive loci, we have that no two positive loci cross each other Thus, these positive loci can be linearly ordered, as well as the corresponding modules Here we order the positive loci from left Let+ be the module name sequence in this order In Figure 11.10a,
+= ecadfb is obtained.
Negative loci are drawn similarly as the positive loci The difference is that a negative locus is the union of the left-up locus and right-down locus Let−be the module name sequence in the order
of the negative loci from left An example of negative loci is shown in Figure 11.10b Observing it from left,−= fcbead is obtained Finally, the SP (+,−) is obtained.
Given an SP(+,−), the geometric relation of modules can be derived from an SP as follows Module b i is left (right) to module b j if b i appears before (after) b jin both+and− Module b iis
below (above) module b j if b i appears after (before) b jin+and b i appears before (after) b jin−
e
c
f
b
H W
FIGURE 11.9 Placement P on a chip (From Murata, H., Fujiyoshi, K., Nakatake, S., and Kajitani, Y., IEEE
Trans Comput Aided Des Integr Circuits Syst., 15, 1518, 1996 With permission.)
Trang 3a c
b f
e
a c
b f
d d
FIGURE 11.10 (a) Positive loci and (b) negative loci (From Murata, H., Fujiyoshi, K., Nakatake, S., and
Kajitani, Y., IEEE Trans Comput Aided Des Integr Circuits Syst., 15, 1518, 1996 With permission.)
To obtain the placement from an SP, we construct an m × m grid Label the horizontal grid lines
and vertical grid lines with module names along+and−from top and from left, respectively A
cross point of the horizontal grid line of label i and the vertical grid line of label j is referred to by (i, j) Then, rotate the resulting grid by 45◦counterclockwise to get an oblique grid (Figure 11.11)
Put each module b i with its center being on(i, i) Expand the separation of grid lines enough to
eliminate overlapping of modules The resulting packing trivially satisfies the constraint implied by the given SP An example is shown in Figure 11.11
Given an SP(+,−), the optimal packing under the constraint can be obtained in O(m2) time, where m is the number of modules, by applying the well-known longest path algorithm for
node-weighted directed acyclic graphs The process is given below We first construct the
horizontal-constraint graph, a directed and node-weighted graph GH(V, E) (where V is the set of nodes, and E
is the set of edges), based on the “left of” constraint of(+,−).
e
c
f
b
FIGURE 11.11 Packing on an oblique grid for (+,−) = (ecadfb, fcbead) (From Murata, H., Fujiyoshi,
K., Nakatake, S., and Kajitani, Y., IEEE Trans Comput Aided Des Integr Circuits Syst., 15, 1518, 1996 With
permission.)
Trang 4both+and−(the “left of” constraint)
3 Node-weight: zero for s and t, width of module b ifor the remaining nodes
Similarly, the vertical-constraint graph GV(V, E) is constructed using the “below” constraint and
the height of each module
There should be no directed cycle in both graphs We set the x-coordinate of b ito be the longest
path length from s to i in GH The y-coordinate of b i is set independently using GV If two modules
b i and b j are in horizontal relation, then there is an edge between i and j in GH, and thus they do not
overlap horizontally in the resulting placement Similarly, if b i and b jare in vertical relation, they do not overlap vertically Because any pair of modules are either in horizontal or vertical relation, no two modules overlap each other in the resulting placement
The width (height) of the chip is determined by the longest path length between the source and
the sink in GH(GV) The longest path length calculation on each graph can be done in O(m2) time, proportional to the number of edges in the graph For the GHand GVshown in Figure 11.12, we have
(+,−) = (ecadfb, fcbead) The resulting placement after the longest path length calculation is
shown in Figure 11.13
On the basis of the longest common subsequence (LCS), two faster packing algorithms with
respective time complexities O (lg n) and O(lg lg n) to transform a SP to its placement are proposed
by Tang, Tian, and Wong [14] and Tang and Wong [15] Given an SP(+,−), let R
+denotes the reverse of+, and define lcs (X, Y) as the length of the LCS of X and Y That is, if Z = z1, z2, , zn
is the LCS of two weighted sequences X and Y , lcs (X, Y) =n
i=1w (zi ), and w(zi ) is the weight
of z i If an SP (+,−) = (X1bX2, Y1bY2), then lcs(X1, Y1) is the x coordinate of the block b, where w (i) is the width of the block i, and lcs(+,−) is the width of the placement For the y
coordinate, if an SP(+,−) = (X1bX2, Y1bY2), then ( R
+,−) = (X R
1, Y1bY2) and lcs(X R
2, Y1) is the y coordinate of the block b, where w (i) is the height of the block i, and lcs(+,−) is the width
of the placement Thus, given an SP, we can compute the LCS to determine the x and y coordinates
of all blocks and the width/height of the placement The packing times are O (lg n) and O(lg lg n)
when the balanced search tree and host tree are used to compute the LCS [14], respectively
e
c
f
b
e
c
f
b
FIGURE 11.12 (a) Constraint graph GHand (b) constraint graph GV(transitive edges are not shown in both
graphs for simplicity) (From Murata, H., Fujiyoshi, K., Nakatake, S., and Kajitani, Y., IEEE Trans Comput.
Aided Des Integr Circuits Syst., 15, 1518, 1996 With permission.)
Trang 5c
f
a
d
b
FIGURE 11.13 Best packing with the minimum area induced by (+,−) = (ecadfb, fcbead) (From
Murata, H., Fujiyoshi, K., Nakatake, S., and Kajitani, Y., IEEE Trans Comput Aided Des Integr Circuits Syst.,
15, 1518, 1996 With permission.)
11.5.3 SP PERTURBATIONS
There are three types of pair-interchanges: (1) two module names in+, (2) two module names both
in+ and−, and (3) the width and the height of a module, where the last one is for orientation optimization
11.6 BOUNDED-SLICELINE GRID
A BSG structure [7] contains rooms, horizontal unit segments, and vertical unit segments
Figure 11.14 shows an example of a BSG of dimension p × q, BSG p ×q When using a BSG structure
to represent a placement, p × q must be larger or equal to the number of modules A rectangular
space surrounded by an adjacent pair of vertical and horizontal units is called the room Vertical unit
(p,q)
x
y
(0,0)
FIGURE 11.14 BSG of dimension p × q, BSG p ×q (From Nakatake, S., Fujiyoshi, K., Murata, H., and
Kajitani, Y., Proceedings of International Conference on Computer-Aided Design, 1996 With permission.)
Trang 6into different rooms The next section describes an algorithm to transform the BSG room assignment
to the corresponding placement
Given a set of modules M, where |M| = n Assuming that p × q ≥ n, an assignment of M is a
one-to-one mapping of modules into the rooms of BSGp ×q A room to which no module is assigned
is called an empty room
We use the example shown in Figure 11.15 to explain the process of transforming the BSG
to the corresponding placement Given four modules (Figure 11.15a) and the assignment of four
modules in the BSG (Figure 11.15b), we construct a horizontal unit adjacency graph Gh(Vh, Eh) and
a vertical unit adjacency graph Gv(Vv, Ev) according to the BSG, and assign the weight of the edges
in the unit adjacency graphs If e ∈ Ehand e crosses a nonempty room, w (e) = height of the module assigned there If e ∈ Ev and e crosses a nonempty room, w (e) = width of the module assigned there Otherwise, if e crosses an empty room or is incident on the source or the sink, w (e) = 0 The corresponding horizontal unit adjacency graph Gh(Vh, Eh) and the vertical unit adjacency graph
Gv(Vv, Ev) to the assignment are shown in Figure 11.15c and d, respectively.
Let Gh(Vh, Eh) be the horizontal unit adjacency graph For each vertex u ∈ Vh, lh(u) denotes the length of the longest path from the source sh to u Similarly in Gv, lv(u) denotes the longest path length from svto u ∈ Vv We use a longest-path algorithm to determine the positions of modules The
longest-path algorithm works in linear time of the number of edges when the input G is a directed
acyclic graph The total number of edges of the unit adjacency graphs is between 2(pq + p + q) and
2(pq + p + q) − 4 So, the time complexity to find the longest path is O(pq).
d c
b a
(8, 3) (6, 9) (11, 4) (a)
(b) (9, 8)
a b
c d
0
9
11 6
0
0 0
0
0 0
0 0 0 0
4 9
3
8
0 0 0
8
sh
th
tv
sv
FIGURE 11.15 (a) Input modules, (b) BSG assignment, (c) horizontal unit adjacency graph Gh(Vh, Eh), and
(d) vertical unit adjacency graph Gv(Vv, Ev) (From Nakatake, S., Fujiyoshi, K., Murata, H., and Kajitani, Y., Proceedings of International Conference on Computer-Aided Design, 1996 With permission.)
Trang 7a
b
d x
y
4 9 12
17
FIGURE 11.16 Corresponding placement of the example in Figure 11.15 (From Nakatake, S., Fujiyoshi, K.,
Murata, H., and Kajitani, Y., Proceedings of International Conference on Computer-Aided Design, 1996 With
permission.)
The following BSG-PACK procedure transforms a BSG with a given assignment to the corresponding placement [7]:
Given an assignment of M to BSGp ×q , let m be a module assigned to a room whose left (vertical) boundary unit is Vm and bottom (horizontal) boundary unit is Hm Then, place m such that its left bottom
is at(lv(u V m ), lh(u H )) where u V m and uH are the vertices corresponding to the units Vm and Hmin the vertical unit and horizontal unit adjacency graphs, respectively The area of the packing is(lv(tv)×lh(th)).
Figure 11.16 gives the resulting placement for the assignment of Figure 11.15
11.6.2 BSG PERTURBATIONS
It is very simple to perturb one BSG assignment to get another BSG assignment We can first choose two different rooms, and then interchange (swap) the contents of them to generate a new BSG assignment
11.7 TRANSITIVE CLOSURE GRAPH
The transitive closure of a directed acyclic graph G is defined as the graph G = (V, E), where
E = {(n i , n j): there is a path from node ni to node n j in G} The representation, proposed by Lin and Chang in Refs [4,12], describes the geometric relations among modules based on two graphs,
namely a horizontal TCG Chand a vertical TCG Cv In this section, we first introduce the procedure
for constructing Chand Cv from a placement Then, we describe how to pack modules from TCG
For two nonoverlapped modules b i and b j , b i is said to be horizontally (vertically) related to b j,
denoted by b i b j(bi ⊥ b j), if bi is on the left (bottom) side of b j and their projections on the y (x)
axis overlap Note that two modules cannot have both horizontal and vertical relations unless they
overlap For two nonoverlapped modules b i and b j , b i is said to be diagonally related to b j if b iis on
the left side of b j and their projections on the x and the y axes do not overlap In a placement, every
two modules must bear one of the three relations: horizontal relation, vertical relation, and diagonal relation To simplify the operations on geometric relations, we treat a diagonal relation for modules
bi and b as a horizontal one, unless there exists a chain of vertical relations from b (bj), followed by
Trang 83
7
6
4 6
6
4
4
b
n c
n e
c
n a
Cv
n b
n a
Ch
n b a
FIGURE 11.17 (a) Placement in a chip and (b) the corresponding TCG (From Lin, J.-M., and Chang, Y.-W.,
IEEE Trans VLSI Syst., 13, 288, 2005 With permission.)
the modules enclosed with the rectangle defined by the two closest corners of b i and b j, and finally
to b j(bi ), for which we make bi ⊥ b j (bj ⊥ b i).
Figure 11.17a shows a placement with five modules b a , b b , b c , b d , and b e whose widths and
heights are (6, 4), (4, 6), (7, 4), (6, 3) and (3, 2), respectively In Figure 11.17a, b a b b , b a ⊥ b c, and
module b e is diagonally related to module b b There exists a chain of vertical relations formed by
modules b e , b c , and b b between the two modules b e and b b (i.e., b b ⊥ b c and b c ⊥ b e) Therefore, we
make b b ⊥ b e Also, module b e is diagonally related to module b d However, there does not exist a
chain of vertical relations between modules b e and b d , and thus we make b e b d
TCG can be derived from a placement as follows For each module b iin a placement, we introduce
a node n i with the weight being the width (height) in Ch(Cv) If bi b j, we construct a directed edge
from node n i to node n j(denoted by(ni , n j)) in Ch Similarly, we construct a directed edge(ni , n j) in
Cvif b i ⊥ b j Given a placement with m modules, we need to perform the above process m (m − 1)/2 times to capture all the geometric relations among modules (i.e., Chand Cvhave m (m − 1)/2 edges
in total)
As shown in Figure 11.17b, for each module b i , i ∈ {a, b, c, d, e}, we introduce a node n i in Chand
also in Cv For each node n i in Ch(Cv), i ∈ {a, b, c, d, e}, we associate the node with a weight equal
to the width (height) of the corresponding module b i Because b a b b, we construct a directed edge
(na , n b) in Ch Similarly, we construct a directed edge(na , n c) in Cvbecause b a ⊥ b c This process is repeated until all geometric relations among modules are defined As shown in Figure 11.17b, each
TCG has five nodes, and there are totally ten edges in Chand Cv(four in Chand six in Cv)
We now present the packing method for a TCG Given a TCG, its corresponding placement can
be obtained in O (m2) time by performing a well-known longest path algorithm on the TCG, where
m is the number of modules To facilitate the implementation of the longest path algorithm, we
augment the given two closure graphs as follows We introduce two special nodes with zero weights
for each closure graph, the source n s and the sink n t , and construct an edge from n sto each node with
in-degree equal to zero, and also from each node with out-degree equal to zero to n t (Note that the TCG augmentation is performed only for packing It will be clear later that such augmentation is not needed for other operations such as solution perturbation.)
Let Lh(ni )(Lv(ni)) be the length of the longest path from ns to n i in the augmented Ch(Cv).
Lh(ni)(Lv(ni)) can be determined by performing the single source longest path algorithm on the augmented Ch(Cv) in O(m2) time, where m is number of modules The coordinate (xi , y i ) of a module
biis given by(Lh(ni), Lv(ni)) Because the respective width and height of the placement for the given TCG are L (nt ) and L (nt ), the area of the placement is given by L (nt )L (nt ).
Trang 911.7.3 TCG PROPERTIES
A feasible TCG has the following three properties: (1) Ch and Cvare acyclic (2) each pair of nodes
must be connected by exactly one edge either in Chor in Cvand (3) the transitive closure of Ch(Cv)
is equal to Ch(Cv) itself.
Property 1 ensures that a module b i cannot be both left and right to (below and above) another
module b j in a placement Property 2 guarantees that no two modules overlap because each pair
of modules have exactly one of the horizontal or vertical relation Property 3 is used to eliminate
redundant solutions It guarantees that if there exists a path from n i to n j in one closure graph, the edge(ni , n j) must also appear in the same closure graph For example, there exist two edges (ni , n j )
and(nj , n k) in Ch, which means that b i b j and b j b k , and thus b i b k If the edge(ni , n k) appears
in Cvinstead of in Ch, b k is not only left to b i but also above b i The resulting area of the corresponding placement must be larger than or equal to that when the edge(ni , n k) appears in Ch
On the basis of the properties of TCG, there exists a unique placement corresponding to a TCG, and the size of the solution space for TCG is(m!)2, where m is the number of modules [4].
11.7.4 TCG PERTURBATIONS
To ensure the correctness of the new TCG after perturbation, as described in the preceding section, the new TCG must satisfy the aforementioned three feasibility properties To identify a feasible TCG for perturbation, we introduce the concept of transitive reduction edges of TCG
An edge(ni , n j) is said to be a reduction edge if there does not exist another path from ni to n j, except the edge(ni , n j ) itself; otherwise, it is a closure edge Because TCG is formed by directed acyclic TCGs, given an arbitrary node n iin one TCG, there exists at least one reduction edge(ni , n j), where n j ∈ Fout(ni) Here, we define the fan-in (fan-out) of a node ni , denoted by Fin(ni)(Fout(ni)),
as the nodes n j’s with edges(nj , n i)(ni , n j) For nodes nk , n l ∈ Fout(ni), the edge (ni , n k) cannot be a reduction edge if n k ∈ Fout(nl) Hence, we remove those nodes in Fout(ni) that are fan-outs of others The edges between n i and the remaining nodes in Fout(ni) are reduction edges For the Cv shown
in Figure 11.17a, Fout(na) = {nc , n e } Because n e belongs to Fout(nc), edge (na , n e) is a closure edge
while(na , n c) is a reduction one.
We apply the following four operations to perturb a TCG:
• Rotation: rotate a module
• Swap: swap two nodes in both of Chand Cv
• Reverse: reverse a reduction edge in Chor Cv
• Move: move a reduction edge from one TCG (Chor Cv) to the other
Rotation and swap do not change the topology of a TCG while reverse and move do To maintain the properties of the TCG after performing the reverse and move operations, we may need to update the resulting graphs
Rotation To rotate a module bi , we only need to exchange the weights of the corresponding node n i
in Chand Cv TCG is closed under the rotation operation, and such an operation takes O (1) time Swap To swap two nodes ni and n j , we only need to exchange two nodes in both Chand Cv TCG is closed under the swap operation, and such an operation takes O(1) time
Reverse The reverse operation reverses the direction of a reduction edge (ni , n j) in a TCG, which corresponds to changing the geometric relation of the two modules b i and b j For two modules b i and b j , b i b j (bi ⊥ b j) if there exists a reduction edge (ni , n j ) in Ch(Cv); after reversing the edge (ni , n j), we have the new geometric relation bj b i(bj ⊥ b i ) Therefore, the geometric relation among
modules is transparent not only to the TCG representation but also to the reverse operation (i.e., the effect of such an operation on the change of the geometric relation is known before packing); this property can facilitate the convergence to a desired solution
Trang 10new graph, we shall check whether the edge(nk , n l) exists in the new graph If the graph contains the
edge, we do nothing; otherwise, we need to add the edge to the graph and delete the corresponding edges(nk , n l) (or (nl , n k)) in the other TCG, if any, to maintain the properties of the TCG.
To maintain the properties of a TCG, we can only reverse a reduction edge Further, for each edge introduced in a TCG, we remove its corresponding edge from the other graph Therefore, there is always exactly one relation between each pair of modules TCG is closed under the reverse operation,
and such an operation takes O (m2) time, where m is the number of modules in the placement Move The move operation moves a reduction edge (ni , n j) in a TCG to the other, which corresponds
to switching the geometric relation of the two modules b i and b jbetween a horizontal relation and a
vertical one For two modules b i and b j , b i b j(bi ⊥ b j ) if there exists a reduction edge (ni , n j) in
Ch(Cv); after moving the edge (ni , n j) to Cv(Ch), we have the new geometric relation bi ⊥ b j (bi b j).
Therefore, the geometric relation among modules is also transparent to the move operation
To move a reduction edge(ni , n j ) from a TCG G to the other Gin a TCG, we first delete the
edge from G and add it to G Similar to the reverse operation, for each node n k ∈ Fin(ni) ∪ {ni} and
nl ∈ Fout(nj ) ∪ {nj }, we shall check whether the edge (n k , n l ) exists in G If Gcontains the edge, we
do nothing; otherwise, we need to add the edge to Gand delete the corresponding edge(nk , n l ) (or (nl , n k)) in G, if any, to maintain the properties of the TCG.
To maintain the properties of a TCG, we can only move a reduction edge If we move a closure edge(ni , n k) associated with the two reduction edges (ni , n j) and (nj , n k) in one TCG to the other, then there exist a path from n i to n k in the two graphs, implying that b i b k and b i ⊥ b k, which gives
a redundant solution Further, for each edge introduced in a TCG, we remove its corresponding edge from the other graph Therefore, there is always exactly one relation between each pair of modules
TCG is closed under the move operation, and such an operation takes O (m2) time, where m is the
number of modules in the placement
11.8 TCG-S
TCG-S representation, also proposed by Lin and Chang in Refs [5,13], combines TCG= (Ch, Cv)
and SP= (+,−), which uses a horizontal and a vertical TCGs as well as the packing sequence
−to represent a placement TCG-S tries to combine the advantages of SP and TCG and at the same time eliminate their disadvantages With the property of SP, faster packing and perturbation schemes are possible Inheriting some nice properties from TCG, the geometric relations among modules are transparent to TCG-S (implying faster convergence to a desired solution), placement with position constraints becomes much easier, and incremental update for cost evaluation can be realized
With the characteristics of TCG and SP, TCG-S has the following four feasibility properties:
1 Chand Cvare acyclic
2 Each pair of nodes must be connected by exactly one edge either in Chor in Cv
3 Transitive closure of Ch(Cv) is equal to Ch(Cv) itself.
4 Packing sequence−is the topological order of both Ch and Cv
For two nonoverlapped modules b i and b j, they could bear one of the horizontal, vertical, and
diagonal relations as defined in Section 11.7 If b i is horizontally (vertically) related to b j, denoted
by b i b j(bi ⊥ b j), then bi is left to (below) b j and their projections on the y (x) axis overlap The diagonal relation between two modules b i and b jis also defined in Section 11.7, and is treated as a
horizontal one unless there exists a chain of vertical relations from b (bj), followed by the modules