Understanding force-directed placement Andrew Kennings Electrical and Computer Engineering University of Waterloo 1
Outline of talk � Introduction. � Implementation details. � Force computation. � Force scaling. � Overlap assessment. � Stability issues. � Improvements. � Median improvement. � Multi-level clustering. � Unification with partitioning. � Numerical results. � Current and future work. Force-directed placement... (UTexas@Austin) 2
Introduction � Force-directed placement is an alternative placement method compared to simulated annealing-based or top-down partitioning-based methods. � It has two main thrusts: � Quadratic optimization to pull connected cells together. � Force computation to push cells apart. � Force-directed placement is interesting… � Seems fairly generic (no reason mixed-size blocks can’t be handled w/ o changing the algorithm). � Seems amenable to physical re-synthesis and incremental placement due to “continuous cell trajectories”. Force-directed placement... (UTexas@Austin) 3
The mathematics � Assume that cells are allowed to overlap. Connected cells can be kept close together (and hence indirectly minimize some measure of wire length) by solving a QP: � Simple to solve by differentiating, where we find a positive- definite system of linear equations: � Clearly fast to solve (advantage), but result has a lot of cell overlap (disadvantage). Force-directed placement... (UTexas@Austin) 4
Spreading forces � We can perturb the optimality conditions to change the resulting solution (i.e., the cell positions) slowly over many iterations: � The perturbations are chosen based on the current (overlapping) cell positions in order to remove the cell overlap. � Hence, over many iterations, the cells converge to non- overlapping positions. � The above equation resembles a force equation, we have force-directed placement. Force-directed placement... (UTexas@Austin) 5
Force-directed placement in action � This slide is inserted to visually give an idea of what happens during force-directed placement. � Cell trajectories (top) and cumulative forces in cells (bottom) are shown as the force-directed placement progresses. Force-directed placement... (UTexas@Austin) 6
Towards implementation � The best known example of force-directed placement is probably Kraftwerk (1998). � It sounds very simple but we found several difficulties during implementation: � How to actually compute forces efficiently? � How to properly weight the forces computed at each iteration? � How to track the progression of the algorithm and to decide when to stop? � How to identify and handle stability problems? � Briefly touch on each of these topics. Force-directed placement... (UTexas@Austin) 7
Efficient force computation � We compute forces by building (bottom-up) a (Barnes-Hut) quad-tree once over the entire placement area. � Then, prior to each QP: � Each cell’s area is inserted top-down into bins of the quad-tree at all levels of the quad-tree. � Force on quad-tree bins is computed using interaction lists, near neighbor computations, and so forth. � Forces on individual cells is then computed by summing up forces from overlapped bins. � Hence, we use a particle-mesh-particle methodology for force computation. Force-directed placement... (UTexas@Austin) 8
Force scaling � The quad-tree provides forces (directions) and proportional lengths. � Investigation turned out that forces need to be scaled in two ways: � For mixed-size designs, larger cells overlap more quad- tree bins and therefore get very large forces relative to smallish cells. � Forces are not computed in any sort of scale compared to the QP spring forces. Force-directed placement... (UTexas@Austin) 9
Scaling for differing cell sizes � Very large forces on large cells empirically resulted in large blocks getting pushed quickly to the outside of the placement region. � Empirically, found that scaling the Forces on cells of different sizes force on each cell computed from computed from the quad-tree before scaling the quad-tree by the square root of number of overlapped quad-tree bins fixed the problem. and after scaling Force-directed placement... (UTexas@Austin) 10
Scaling for optimality conditions � Recall that forces are combine into optimality conditions but constant force weighting (advocated by Kraftwerk ) was found to hurt quality. � Implemented a state machine to dynamically weighting: � Start out small (cells adjust themselves into correct order relative to each other). � Increase to encourage fairly rapid spreading. � Based on a monitoring of cell overlap, adjust weight up or down as appropriate. Force-directed placement... (UTexas@Austin) 11
Overlap assessment � The proper assessment and monitoring of cell overlap is important. Provides: � indication of algorithm progression. � indication of problems in convergence. � mechanism to determine when to stop. � Have developed two metrics: � Two metrics since we found that different metrics are useful at different stages of the algorithm. � The two methods are combine in a weighted amount to provide a single number measuring overlap. Force-directed placement... (UTexas@Austin) 12
Overlap assessment – Metric # 1 � Metric # 1 is based on a typical occupancy verses capacity measure of available placement area. � We scan the quad-tree used for force computation top-down, and compute: � Metric is normalized into the range [ 0,1] where 0 means no overlap, and 1 means (essentially) total overlap. � Metric found to be very good early in placement. Force-directed placement... (UTexas@Austin) 13
Overlap assessment – Metric # 2 � Metric # 2 is based on a O(n log n) plane-sweep algorithm that directly measures the union of cell area. Area of cells individually is 188 units , and the area of their union is 170 units . � 170 / 188 = 0.90, or ~10% overlap � Metric is normalized into the range [ 0,1] (divide union of cell area by total cell area) where 1 means no overlap, and 0 means (essentially) total overlap. � Metric found to be very good late in placement. Force-directed placement... (UTexas@Austin) 14
Stability issues � Discovered that placements occasionally collapse back onto themselves. � Due to the iterative solver and poor conditioning of the system of equations. � Problem easily seen visually, but harder to detect in softw are -- detected by good overlap assessm ent!!! Force-directed placement... (UTexas@Austin) 15
Our solution to stability issues � Change in cell positions between two iterations of placement is given by: � Modify by making it more diagonally dominant: � Improves conditioning and makes it easier to solve. � Diagonal modification is like adding a fixed point for each cell that tracks the cell’s location. Force-directed placement... (UTexas@Austin) 16
How good is the method so far? � Aforementioned implementation should have paralleled Kraftwerk so we tested: � Placed the ISPD-2002 benchmarks using Kraftwerk via bX at the University of Michigan. � Measured the overlap in Kraftwerk placements and tuned our tool to stop at roughly the same amount of overlap. � Compared wire length. � Not surprisingly results were very comparable to Kraftwerk , but far from other state-of-the-art academic tools like Capo and Fengshui . Force-directed placement... (UTexas@Austin) 17
Problems of cell ordering � Force-directed placement begins from an initial QP that provides rough information about the left/ right (top/ bottom) ordering of cells. Cells A and B connected; attractive force pulling A A C B tow ards B. Cell C creates an obstacle causing a force keeping A and B apart. � Hypothesized that there is a cell ordering problem. � Spreading forces used to remove overlap make it difficult for cells to cross paths once ordered. Force-directed placement... (UTexas@Austin) 18
Median improvement � We implemented a heuristic that directly attempts to minimize wire length and interleaved it within the force- directed iterations. � Heuristic called as overlap is continually reduced by ~ 3% . � Essentially considers each cell, and attempts to compute an HPWL minimizing range of locations into which the cell can be placed. � The heuristic can re-introduce small amounts of overlap, so careful attention is paid to overlap. Force-directed placement... (UTexas@Austin) 19
Median improvement BoxPlace- BoxPlace- derived range derived range for HPWL for HPWL minimization minimization Extended range for HPWL minimization and overlap Cell Cell � For a cell compute median of its connected cells. Move cell into this box (while trying to avoid re-introduction of overlap). � If too much overlap re-introduced expand the box so at least the cell attempts to get re-placed in the “right direction”. Force-directed placement... (UTexas@Austin) 20
Recommend
More recommend