1
Understanding force-directed placement Andrew Kennings Electrical - - PowerPoint PPT Presentation
Understanding force-directed placement Andrew Kennings Electrical - - PowerPoint PPT Presentation
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
Force-directed placement... (UTexas@Austin) 2
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) 3
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) 4
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
- verlap (disadvantage).
Force-directed placement... (UTexas@Austin) 5
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-
- verlapping positions.
The above equation resembles a force equation, we have force-directed placement.
Force-directed placement... (UTexas@Austin) 6
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) 7
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) 8
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) 9
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) 10
Scaling for differing cell sizes
- Very large forces on large cells
empirically resulted in large blocks getting pushed quickly to the outside
- f the placement region.
- Empirically, found that scaling the
force on each cell computed from the quad-tree by the square root of number of overlapped quad-tree bins fixed the problem.
Forces on cells of different sizes computed from the quad-tree before scaling and after scaling
Force-directed placement... (UTexas@Austin) 11
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) 12
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) 13
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
- verlap, and 1 means (essentially) total overlap.
- Metric found to be very good early in placement.
Force-directed placement... (UTexas@Austin) 14
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.
- 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.
Area of cells individually is 188 units, and the area of their union is 170 units. 170/188 = 0.90, or ~10%
- verlap
Force-directed placement... (UTexas@Austin) 15
Stability issues
- Discovered that placements
- ccasionally 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) 16
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) 17
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
- ur 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) 18
Problems of cell ordering
- Force-directed placement begins from an initial QP that
provides rough information about the left/ right (top/ bottom)
- rdering of cells.
A C B
Hypothesized that there is a cell ordering problem. Spreading forces used to remove overlap make it difficult for cells to cross paths once ordered.
Cells A and B connected; attractive force pulling A tow ards B. Cell C creates an obstacle causing a force keeping A and B apart.
Force-directed placement... (UTexas@Austin) 19
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) 20
Median improvement
BoxPlace- derived range for HPWL minimization Cell BoxPlace- derived range for HPWL minimization Cell Extended range for HPWL minimization and overlap
- 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) 21
Force reorientation
- Basically make a hypothetical call to the median improvement
in order to get a direction that each cell wishes to follow.
- Combine direction with direction computed for cell spreading.
- Tends to help with HPWL minimization, but with some
impact on the required iterations for convergence. Use force re-orientation prior to solving each QP during force- directed placement.
Cell Spreading Force Median Improvement Force Resultant Force pointing in favor of spreading
Force-directed placement... (UTexas@Austin) 22
Multi-level clustering
- We also implemented multi-level clustering in order to have a
multi-level, force-directed placer.
- Several objectives in this flow:
- Help to improve runtime (clustering/ de-clustering takes
time, but smaller netlists at top levels).
- Help to improve quality of results (clustering keeps
connected cells together, thereby helping to circumvent cell ordering problems).
- Makes sense to use clustering; always used in top-down
partitioning and simulated annealing placers.
Force-directed placement... (UTexas@Austin) 23
Illustrated clustering flow
- Our clustering uses physical info + connectivity.
- It also (occasionally) performs de- and re-clustering.
Solve QP Physical Cluster Force-directed Placement
- riginal
circuit
- riginal
circuit Decluster Improvement Physical Recluster
- riginal
circuit Force-directed Placement Legalization+Detailed Improvement
Force-directed placement... (UTexas@Austin) 24
How good are things now?
Results on IBM-MS standard cell circuits (macro cells reduced to standard row height).
Force-directed placement... (UTexas@Austin) 25
How good are things now?
Results on IBM-MS 2002 mixed-size circuits (no pin offsets).
Force-directed placement... (UTexas@Austin) 26
How good are things now?
Results on IBM-MS 2004 mixed-size circuits (pin offsets).
Force-directed placement... (UTexas@Austin) 27
Commentary on algorithm progression
- Force-directed placement with median improvement and
clustering provided excellent quality of results compared to
- ther tools (e.g., Capo9.0 and Fengshui2.6).
- CPU somewhat worse…
- Thought about how we could be both better and faster…
- We did this by considering how the force-directed placer
worked at reducing overlap.
Force-directed placement... (UTexas@Austin) 28
Iteration count versus overlap
- Multi-level force-directed
placement exhibits three ranges
- f placement progression.
- Getting started.
- Spreading cells.
- Incremental overlap removal.
Large initial overlap; potential for more cell ordering problems and wasted runtime. Could potentially “warm-start” the force-directed method using an alternative placement method.
Force-directed placement... (UTexas@Austin) 29
Unification with partitioning
- Used partitioning at the top to help
generate better cell ordering and initial placements with less overlap.
- Question: how to properly stop
partitioning and switch to force- directed placement?
- Too much partitioning would
result in a partitioning-based placer.
- Too little partitioning wouldn’t
be useful either.
- The proper hand-off to force-
directed placement represents the unification.
Are Cells Adequately Spread? Bi-Partition Is Circuit Adequately Spread? N
- N
- (Exam
ine each block at the current m in-cut layer) Yes (All partitioning blocks at this layer have been exam ined) M in-Cut Partitioning Solve a QP (w ith cutlines) Yes Enter Force- Directed Placem ent
Force-directed placement... (UTexas@Austin) 30
Proper hand-off to force-directed placement
- Perform top-down bisection. Terminal
propagation done via QP at after each partitioning iteration.
- Assess overlap after each partitioning
- iteration. Terminate partitioning once
we have hit a reasonable overlap target.
- Need to give force-directed
placem ent the change to do som ething, and do not w ant to degenerate into a top-dow n partitioning-based placer.
Initial placement without partitioning… and with partitioning.
Force-directed placement... (UTexas@Austin) 31
Numerical results
Results on IBM-MS standard cell circuits (macro cells reduced to standard row height).
Force-directed placement... (UTexas@Austin) 32
How good are things now?
Results on IBM-MS 2002 mixed-size circuits (no pin offsets).
Force-directed placement... (UTexas@Austin) 33
How good are things now?
Results on IBM-MS 2002 mixed-size circuits (pin offsets).
Force-directed placement... (UTexas@Austin) 34
Conclusions
- Implementation of a force-directed placer requires attention
to detail:
- Force computation.
- Force scaling.
- Proper overlap assessment (useful for many reasons).
- Stability issues.
- To be competitive with today’s tools, force-directed placers
require enhancements (vs. basic Kraftwerk description):
- Median improvement (various forms).
- Multi-level clustering.
- Unification with partitioning.
Force-directed placement... (UTexas@Austin) 35
Current thoughts and work - Fixed objects
- Typical that some objects (e.g., IP) are pre-placed.
- Fixed objects become obstacles for force-directed placers.
- What modifications (if any) are required in order for force-
directed placers to properly account for obstacles?
- Other types of placement constraints.
Force-directed placement... (UTexas@Austin) 36
Future thoughts and work
- Try to significantly reduce CPU w/ o loss in quality.
- Better parameter selection (i.e., weighting of “this vs. that”
at each force-directed iteration) seems beneficial.
- Want to look at other objectives; e.g.,
- Routability, Timing, Physical Synthesis.
Force-directed placement... (UTexas@Austin) 37
Future thoughts and work – An aside
- Related to work on better parameter selection…
- Much of the analytic and force-directed methods are much
the same… (mFar, Fastplace, Aplace, etc.)
- All methods (more or less) have an explicit or implicit
- bjective function that is a weighted combination of wire
length and overlap.
- Regardless, the resulting optimization generally has two
search directions; one for wire length and one for overlap.
Force-directed placement... (UTexas@Austin) 38
Future thoughts and work – An aside
- Hence, the tricks in the methods are:
- How to weight wire length direction vs. overlap direction
to get good results fast.
- How far to step once relative weighting is done, and a
search direction for minimization is computed.
- People need to say more about this type of stuff.
- It is also possible that some methods (because of how
- verlap is handled and the resulting objective function) are
“more capable” at certain problems (e.g., moveable pads,
- bstacles, etc.)
Force-directed placement... (UTexas@Austin) 39
The end – Thanks!
- Happy to answer any questions…