• 沒有找到結果。

The Legalization Approach for Standard Cell Based Design with Minimal

3.5 Legalization Core (LegCore)

LegCore is the abbreviation of “Legalization Core”. It is used to solve the overlap among cells and determine the optimal positions of cells in each subrow. The algorithm of this section is divided into four parts. One is the main algorithm of the LegCore, which contains the initial-ization of new inserted cell, decides whether the cell is overlapped with its predecessor cluster or not, and integrates with the other two parts. Another is Collapse, which uses the SADS

pro-posed in Section 3.6 to calculate the optimal positions for clusters by solving (3.18). Another is Optimal Position of Cells, which solves the optimal position of all cells in the last cluster of the subrow by solving (3.15). The other is cost function, which calculates the amount of influence on other cells as a new cell inserted by cell movement. Hence, the four parts are described as follows.

The notation used in the rest of this thesis is summarized in Figure 3.6. Let xc(i), wc(i) be the optimal position of lower-left coordinate and the width of i-th cluster, respectively. If the optimal position is not in the scope between xmin and xmax, which are left and right boundary of the subrow, respectively, it will be limited. Similarly, if the optimal position is not in the scope between Bmin and Bmax, which are left and right boundary of the bin structure, it will be limited. The algorithm of LegCore is described in Figure 3.7. First, a new inserted cell is

Algorithm: Legalization Core (LegCore) Input:

Cell i in the bin-merged structure Output:

Cells (including cell i) with optimal position in the subrow r 01 Create a new cluster clastr , and it is the last cluster of subrow r;

02 Cell i is stored in cluster clastr & xc(clastr ) ← x(i), wc(clastr ) ← w(i);

03 c0 ← Predecessor of clastr ;

04 if c0 exists and xc(c0) + wc(c0) ≥ xc(clastr ) then 05 wc(c0) ← wc(c0) + wc(clastr );

06 Store all cells from cluster clastr into cluster c0; 07 Remove cluster clastr ;

08 Collapse (c0);

09 end

10 Optimal Position of Cells();

11 Cost Function();

Figure 3.7: Algorithm of Legalization Core (LegCore).

initialized before legalization (line 1-2). In initialization, the cell is included in a new cluster whose optimal position and width are the same as the cell, respectively (line 2). Moreover, a cluster can include lots of cells but only one cell is included in it initially. The cluster is processed according to ascending x-coordinate positions; therefore, early processed cluster is absolutely left of lately processed cluster. It means, the relative order of the cells in the legal

placement is the same in the global placement. If the last cluster clastr is overlapped with the predecessor cluster c0, the two clusters will be merged into one cluster whose cells in cluster clastr and c0are included and the Collapse is called to calculate the position of the merged cluster (line 4-9). Nevertheless, the subCollapse of Collapse is called continually as long as the new position of cluster is overlapped with its predecessor cluster until the overlap among all clusters is solved (subCluster of Collapse is called by itself; see the overview in Section 3.5.1). Finally, Optimal Position of Cells is called to calculate the optimal position of all cells included in the last cluster in the subrow (line 10).

The LegCore we presented is partly similar to [2, 21, 22]. The cells are placed by dynamic refresh or theirs with preserving the order of cells and no overlap. Because of the optimality proof presented in [21], it can state that our LegCore is also optimal.

Algorithm: Collapse Input:

The cluster clastr Output:

The overlap is solved among clusters

01 Calculate ∆xj = x(j) −

\\Do c0and clastr overlap with each other?

10 if c0exists and xc(c0) + wc(c0) > xc(clastr ) then 11 wc(c0) ← wc(c0) + wc(clastr );

12 Store all cells from cluster clastr into cluster c0; 13 subCollapse(c0, clastr )

14 end

Figure 3.8: Algorithm of Collapse.

Algorithm: subCollapse Input:

Two clusters c0and clastr Output:

The overlap is solved among clusters 01 Calculate ∆xj = ∆xj

j=1 ) is obtained from (3.18);

04 xc(c0) ← Q1/2({∆x0j}(i+k)j=1 );

\\Do c00and c0overlap with each other?

10 if c00exists and xc(c00) + wc(c00) > xc(c0) then 11 wc(c00) ← wc(c00) + wc(c0);

12 Store all cells from cluster c0 into cluster c00; 13 subCollapse(c00, c0)

14 end

Figure 3.9: Algorithm of subCollapse.

3.5.1 Collapse

The algorithm of Collapse is described in Figure 3.8, and subCollapse called by Collapse is described in Figure 3.9. The optimum position is obtained from the procedure line 1-4 of Collapse or subCollapse, which will be described in Section 3.6. After the optimal position of cluster c is obtained, the position must be checked whether it is in the scope of subrow or not. The left corner xc(c) of cluster c is limited to right of xmin and Bmin, and the right corner of xc(c) + wc(c) is limited to left of xmax and Bmax (line 5-8) of Collapse or subCollapse.

If the new position of cluster is overlapped with its predecessor cluster (line 10) of Collapse or subCollapse, the width and the cells of the cluster is added to the predecessor cluster for merging (line 11-13). Then, the subCollapse is called to legalize between them (line 13). It is called continually until the overlap among clusters are solved.

Algorithm: Optimal Position of Cells Input:

Cells of the last cluster in the subrow r Output:

Cells with optimal position of the last cluster in the subrow r 1 clastr ← the last cluster c in the subrow r;

Figure 3.10: Algorithm of Optimal Position of Cells.

3.5.2 Optimal Position of Cells

The algorithm of Optimal Position of Cells is described in Figure 3.10. After all overlaps are solved among the clusters in the subrow described in previous subsections, the positions of cells in the last cluster are determined in line 2-5. The position of first cell is determined by the position of the cluster (line 2), and the position of second cell is x0(1) + w(1) because it is abutted with the first cell and so on (line 4).

The main difference to Abacus is that our SADS minimizes the amount of total cell move-ment. Because of the median concept manipulated by SADS described in Section 3.6, lots of constraints are not solved necessarily. Additionally, our approach relies on simple data struc-ture; complex data structure is not necessary in our approach.

3.5.3 Cost Function

As a new cell is inserted and placed in subrow r, the Cost function calculates the influence on affected cells and determines the cost. The cost includes two parts, the difference of x-and y-coordinate in distance between global placement x-and legalization of all affected cells.

Figure 3.11 gives an example to illustrate the legalization procedure.

Figure 3.11(a) is one bin of unlegalized circuit. In Figure 3.11(b), cell 1 is legalized in optimal position, and cell 2 is moved to the nearest row in y-direction. There is an overlap

Figure 3.11: An example for illustrating the legalization procedure.

between cell 1 and 2, and the LegCore is called to solve the overlap between them. The overlap between them is solved, as shown in Figure 3.11(c). At this time, the cost is calculated and includes the movement of cell 1 and cell 2 between global placement and legalization position.

Similarly shown in Figure 3.11(d), cell 2 have to be moved as cell 4 is overlapped with cell 2. Note that the cell 1 has to be moved since cell 1 and cell 2 are in the same cluster; hence, Figure 3.11(e) shows the legalized cell 1, 2, and 4, and the cost of three cells are included.

Similarly shown in Figure 3.11(f), the cost of cell 3 and 5 are included as the cell 3 is affected and cell 5 is inserted.

3.6 The Optimal Position for Clusters by Sum of Absolute

相關文件