understanding force-directed placement

39
1 Understanding force-directed placement Andrew Kennings Electrical and Computer Engineering University of Waterloo

Upload: others

Post on 24-Jan-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Understanding force-directed placement

1

Understanding force-directed placement

Andrew KenningsElectrical and Computer EngineeringUniversity of Waterloo

Page 2: Understanding force-directed placement

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.

Page 3: Understanding force-directed placement

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”.

Page 4: Understanding force-directed placement

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 overlap (disadvantage).

Page 5: Understanding force-directed placement

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-overlapping positions.

The above equation resembles a force equation, we have force-directed placement.

Page 6: Understanding 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.

Page 7: Understanding force-directed placement

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.

Page 8: Understanding force-directed placement

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.

Page 9: Understanding force-directed placement

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.

Page 10: Understanding force-directed placement

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 of 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

Page 11: Understanding force-directed placement

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.

Page 12: Understanding force-directed placement

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.

Page 13: Understanding force-directed placement

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 overlap, and 1 means (essentially) total overlap.

Metric found to be very good early in placement.

Page 14: Understanding force-directed 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% overlap

Page 15: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 15

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 software -- detected by good overlap assessment!!!

Page 16: Understanding force-directed placement

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.

Page 17: Understanding force-directed placement

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 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 Capoand Fengshui.

Page 18: Understanding force-directed placement

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) ordering 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 towards B.

Cell C creates an obstacle causing a force keeping A and B apart.

Page 19: Understanding force-directed placement

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.

Page 20: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 20

Median improvement

BoxPlace-derived range

for HPWLminimization

Cell

BoxPlace-derived range

for HPWLminimization

Cell

Extended rangefor HPWL

minimizationand 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”.

Page 21: Understanding force-directed placement

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

SpreadingForce

MedianImprovement

Force

ResultantForce pointing

in favor ofspreading

Page 22: Understanding force-directed placement

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.

Page 23: Understanding force-directed placement

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

PhysicalCluster

Force-directedPlacement

originalcircuit

originalcircuit

Decluster

Improvement

PhysicalRecluster

originalcircuit

Force-directedPlacement

Legalization+DetailedImprovement

Page 24: Understanding force-directed placement

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).

Page 25: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 25

How good are things now?

Results on IBM-MS 2002 mixed-size circuits (no pin offsets).

Page 26: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 26

How good are things now?

Results on IBM-MS 2004 mixed-size circuits (pin offsets).

Page 27: Understanding force-directed placement

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 other 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.

Page 28: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 28

Iteration count versus overlap

Multi-level force-directed placement exhibits three ranges of placement progression.

Getting started.Spreading cells.Incremental overlap removal.

Large initial overlap; potential for more cell ordering problemsand wasted runtime. Could potentially “warm-start” the force-directed method using an alternative placement method.

Page 29: Understanding force-directed placement

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 CellsAdequatelySpread?

Bi-Partition

Is CircuitAdequatelySpread?

No

No

(Examine each block at thecurrent min-cut layer)

Yes

(All partitioningblocks at

this layer havebeen examined)

Min-CutPartitioning

Solve a QP(with cutlines)

Yes Enter Force-Directed

Placement

Page 30: Understanding force-directed placement

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 placement the change to do something, and do not want to degenerate into a top-down partitioning-based placer.

Initial placement without partitioning…

and with partitioning.

Page 31: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 31

Numerical results

Results on IBM-MS standard cell circuits (macro cells reduced to standard row height).

Page 32: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 32

How good are things now?

Results on IBM-MS 2002 mixed-size circuits (no pin offsets).

Page 33: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 33

How good are things now?

Results on IBM-MS 2002 mixed-size circuits (pin offsets).

Page 34: Understanding force-directed placement

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.

Page 35: Understanding force-directed placement

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.

Page 36: Understanding force-directed placement

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.

Page 37: Understanding force-directed placement

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 objective 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.

Page 38: Understanding force-directed placement

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 overlap is handled and the resulting objective function) are “more capable” at certain problems (e.g., moveable pads, obstacles, etc.)

Page 39: Understanding force-directed placement

Force-directed placement... (UTexas@Austin) 39

The end – Thanks!

Happy to answer any questions…