• No se han encontrado resultados

Entrega de prestaciones sociales durante la pandemia: ¿para quiénes

In document Clases medias en tiempos de crisis (página 48-53)

As suggested by the name, the basic idea behind the Iterative Clustering algorithm is to progressively cluster the macros that overlap with each other, when the macros are assigned or moved to their target locations during legalization. Initially, every macro in the circuit is assigned to a separate cluster. Subsequently, to determine which macros need to be grouped in the same cluster, all the clusters are shifted to their optimal locations that satisfy the minimum perturbation objective function. In doing so, if there is any overlap among the clusters, then these clusters are merged to form a larger cluster. Within each cluster, the macros are abutted to each other preserving their left-to-right relationship as defined by the current sequence- pair. As a result, there is no overlap among the macros within the clusters. By progressively clustering the macros and moving the clusters to their optimal locations, a legalized placement solution of the macros is obtained. The pseudo-code for the Iterative Clustering algorithm to legalize the macro-blocks in the horizontal direction is given in Algorithm 3.2.

Algorithm 3.2 The Iterative Clustering algorithm

1: from the current sequence-pair (p, q) determine the horizontal constraint graph

2: find the immediate left and right neighbors of all the macro-blocks from the horizontal constraint graph

3: for (i ← 1 to N ) do

4: place macro pi in its target location 5: Let C be a new cluster consisting of pi 6: while (C overlaps with other clusters) do

7: merge C with the closest cluster on its left

8: let C be the new cluster that is formed 9: shift C to its optimal location

10: if (macro pj ∈ C is at its target location) then 11: detach pj from C if possible and goto step 9

12: end if

13: end while

The individual steps of the Iterative Clustering algorithm are now explained in more detail with the help of an example given in Figure 3.2 and Figure 3.3. Figure 3.2(a) shows an example circuit with six macro-blocks in which macros 3, 5 and 6 overlap in the horizontal direction. Traversing the list of the macros from left to right, the overlaps among the macros are as follows: (a) macro 5 overlaps with macro 6 by d1 units (b) macro 3 overlaps with macro 6 by

d1/2 units, and (c) macro 3 overlaps with macro 5 by d2 − d1/2 units. From Figure 3.2(a),

it can be seen that the minimum horizontal displacement required to yield an overlap-free placement is: d1+ (d2− d1/2) = d1/2 + d2 units.

As mentioned before, the macro-block legalization algorithm uses the sequence-pair to represent the current floorplan. The sequence-pair is essentially a pair of N -dimensional vectors (p, q) that represent the horizontal and vertical relationships between the macro- blocks. For the circuit given in Figure 3.2(a), the corresponding sequence-pair is given by (p, q) = (412653, 615342) [42]. From Algorithm 3.2, for horizontal placement, initially the horizontal constraint graph is constructed from the current sequence-pair. This is shown in Figure 3.2(b). The horizontal constraint graph gives the immediate left and right neighbors of all the macro-blocks in the circuit. These neighbors are associated with the non-transitive edges in the horizontal constraint graph and can be found in O(N2) time.

The macros are then placed one at a time from left to right according to the horizontal sequence p. In case, there is no overlap between a macro and an existing cluster, the macro is placed at its target location. This is shown in Figure 3.2(c) in which the macros have been placed in the order 4 → 1 → 2 → 6 given by the horizontal sequence. In case a macro overlaps with an existing cluster, then the clustering is updated according to steps 6–13 (Figure 3.2(d)– Figure 3.3(g)). The condition in step 6 and the closest cluster in step 7 can be determined by considering the constraints of the immediate left neighbors of the macros in C.

The distance to shift a cluster in step 9 is determined according to the following lemma: Lemma 1 For a cluster C, its location is optimal if the number of macros perturbed to the left from their target locations is equal to the number perturbed to the right.

an overlap between a macro and an existing cluster, the macro will always be abutted to the right of the cluster (Figure 3.2(d) and Figure 3.3(f)). Hence, newly added macros will always be placed to the right of their target locations. As a result, the clusters will always shift left to move the macros closer to their target locations (Figure 3.3(e) and Figure 3.3(g)). This makes it relatively simple to find the correct shift amount for the newly formed clusters. Let the displacement of a macro to the right of its target location be defined as a positive displacement and to left of its target location as negative. Then the shift amount for a cluster can be determined by looking at all its constituent macros that have a positive displacement value. In accordance with Lemma 1, if a cluster has an even number of macros, then it is shifted to the left by half the minimum positive displacement value among its constituent macros (Figure 3.2(d)). If the cluster has an odd number of macros, then it is shifted to the left by the minimum positive displacement value among its constituent macros (Figure 3.3(g)). In step 10, after shifting a cluster C, a macro pj ∈ C may potentially reach its target

location. If pj does not have any right neighbors that belong to cluster C, then it is detached

from the cluster. Otherwise, it will move along with the cluster during the subsequent iterations and will not be placed in its optimal location. The condition to detach pj can be checked by

looking at its immediate right neighbors.

Although the while loop in steps 6–13 looks complicated, it can be shown with careful implementation and analysis that the runtime complexity of the Iterative Clustering algorithm is O(N2).

In document Clases medias en tiempos de crisis (página 48-53)