42
Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Embed Size (px)

Citation preview

Page 1: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Topics in “Middle-Down” PlacementTopics in “Middle-Down” Placement

John Lillis

Karthik Kalpat

Devang Jariwala

Sung-Woo Hur

UIC

Page 2: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Background/OverviewBackground/Overview

Current Target: Wire-Length Driven Cell Placement

Origins: Mongrel (ICCAD 2000)

Key Concepts “Middle-Down” flow Relaxation Based Local Search Novel Legalization Procedures Detailed Optimization Techniques: Interleaving

Extensions (works in progress) Multi-Level Strategies (both in target grid and source

netlist) Placement-Based Strategies: Re-clustering, tie-breaking Two Row Interleaving

Page 3: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

ThemesThemes

Constraint Relaxation (flow/qplace for global placement)

Constraint Imposition (e.g., interleaving)

Search

Clustering Scalability Escape From Local Optima Inducing Uniformity

Page 4: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Wire-Length Driven PlacementWire-Length Driven Placement

Given: netlist of a circuit,

# rows

Placement Problem: |E|

min len(ei) over all legal placement P i = 1

Page 5: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Mongrel Middle-Down Flow (2-level)Mongrel Middle-Down Flow (2-level)

Global Placement

Relaxation-Based Local Search

Detailed Placement

Optimal Interleaving...

Page 6: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Why Middle-Down?Why Middle-Down?

Better correlation with final result min-cut bets a lot on 1st cut other objectives (e.g., timing) are meaningless in strict

top-down

Simplification of constraints (vs. flat)

Enables “Search” More than most Analytical Methods

Moves (later) More Global Than Traditional Search

Page 7: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Key Concepts In MongrelKey Concepts In Mongrel

Global Placement RBLS: Relaxation Based Local Search (Network flow

based) Max-Gain Based Legalization

Detailed Placement Dynamic Clustering Optimal Interleaving

Page 8: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Global PlacementGlobal Placement

Given n and m, place cells on an n X m grid

Total cell area Bin capacity C = (n x m)

Bin Capacity Constraint:Each bin B(i,j) has lower and upper bound to allow cells to be placed (1 - ) C Sv (1 + ) C vB(I,j)

Legal Global Placement: Given , every bin satisfies bin capacity constraint and row size constraint

Row Size Constraint: Every row size should be within specified tolerance

Page 9: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Philosophy of Constraint RelaxationPhilosophy of Constraint Relaxation

- Relax constraints (e.g., allow cell overlap)- Solve relaxed formulation optimally (and efficiently)- Resolve infeasibility (cell overlap) heuristically

Page 10: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Overview of Relaxation Based Local SearchOverview of Relaxation Based Local Search

Input : M and c

while k > 0

Extract set of M mobile nodes

Find optimal relaxed location for mobile nodes

P Legalized placement

Local optimization using partitioning technique

Improved

k k - 1

P New placement k c

k c P initial placement

Yes

No

Page 11: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Set of Mobile NodesSet of Mobile Nodes

Page 12: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Sub-circuit ConceptSub-circuit Concept

a c

e

f h

b

gd

e1

e3

e4

e2

e5

e6

e7a

e

g

f,h

c

b

de3

e2e5e4

e6e7

e1

d b c

h g ea,f

e3 e4

e1e2

e5e6

e7Projected sub-circuits

Page 13: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Relaxed Placement SolversRelaxed Placement Solvers

Linear Program --> Network Flow Solution Measures Half-Perimeter Combinatorial Algorithm

Quadratic Placement Can Only Appx. Half-Perimeter Quadratic Objective:

Measures “wrong” thing Can give more favorable cell distribution

Current Implementation Faster than Flow

Preliminary Data: Qplace better for early in optimization (large sub-ckt size); Flow better for small sub-ckt size.

Page 14: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Philosophy of Optimal InterleavingPhilosophy of Optimal Interleaving

Target: Intra-row optimization

Desirable Properties:

1. Efficiency

2. Large solution space

Page 15: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Optimal InterleavingOptimal Interleaving

A1 A2 A3B1 B2 B3 B4

A1 A2 A3 B1 B2 B3 B4

B1 B2 A1 A2B3 B4 A3

Window

Partitioning

Interleaving

Page 16: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Two Row InterleavingTwo Row Interleaving

Idea: Enable More Flexibility by Considering Adjacent Rows Simultaneously.

Cells Constrained to be in Original Rows, but Enables Cells to “Move Together” (less influence of “anchors” other rows.

Formulation: A1, B1: Subsequences of row 1 (relative order obeyed) A2, B2: Subsequences of row 2 (relative order obeyed) Simultaneously find optimal interleavings of (A1,B1)

and (A2,B2) s.t. WL is min.

Note: only x-wire length changes.

Page 17: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Two Row Interleaving – Uniform CaseTwo Row Interleaving – Uniform Case

Window

R1

R2

- All cells identical width (e.g., FPGAs)

- Cells (e.g., a, b) can move together

- Solution: Dynamic Programming

b

a

Page 18: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

DP Idea for Uniform CaseDP Idea for Uniform Case

- For Separability, “scan line” must move L-to-R

- Decomposition:

- k: length of prefix in # cells

- i1 <= k: index into subseq A1

- [ j1 = k - i1 : implicit index into B1 ]

- i2 <= k: index into subseq A2

- [ j2 = k – i2: implicit index into B2 ]

- S[k,i1,i2] = WL of opt. Interleaving of:

A1[1..i1], B1[1..j1] and

A2[1..i2], B2[1..j2]

Page 19: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Four ways to form S[k,i1,i2]Four ways to form S[k,i1,i2]

S[k-1,i1-1,i2-1]A1[i1]

A2[i2]{ k-1

cells

A1[i1]

B2[j2]S[k-1,i1-1,i2] {

S[k-1,i1,i2-1] {S[k-1,i1,i2] {

B1[j1]

A2[i2]

B1[j1]

B2[j2]

Page 20: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Uniform Case DiscussionUniform Case Discussion

Fill in table using recurrence

Take best of four cases by incremental wire-length calculation

Because parameterized by k, we ensure separability required for DP

Run-Time: O(N^3) for constant degree (more complex expression if pins considered)

Next: how about variable width standard cells?

Page 21: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Standard Cell CaseStandard Cell Case

20 cells

80 cells

Issues:

- Decomposition by k not generally possible

- Need to deal with “jaggedness” of right boundary

Page 22: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Dealing with “Jaggedness”Dealing with “Jaggedness”

WLOG: assume left boundary identical for both rows (minor modifications can accommodate general case).

Let w(R,i,j) be the total cell width of cells A[1..i] and B[1..j] in row R (for given window).

Feasibility requirement for quadruple (i1,j1,i2,j2): | w(R1,i1,j1) – w(R2,i2,j2) | < D Idea: allow a certain degree of noise with “near

separability”).

Nevertheless, near-uniformity desirable (large D implies large error; wide-variance: few or no feasible configurations).

Page 23: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Clustering for UniformityClustering for Uniformity

Clustering is performed within the chosen windows for uniformity.

A method similar to the dynamic clustering method that finds the cluster edges at points of minimum density is used for this purpose.

Page 24: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Graph InterpretationGraph Interpretation

[ i1 j1 i2 j2]

0000

0001

0010

0100

1000

1001

0110

0101

1010

n1 m1 n2 m2

Notes: Eight candidate edges; only feasible

nodes considered.

Page 25: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

DiscussionDiscussion

Feasible space much smaller than n^4. Use hash table for this sparseness Practical runtime: O(n^3)

With clusters, a generalization is employed: cluster flipping (pin locations preserved).

Page 26: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Routed WL for FPGAsRouted WL for FPGAs

CKT

ALU4

APEX2

APEX4

BIGKEY

CLMA

DES

VPR

100

100

100

100

100

100

VPR+1ROW

99.7

99.6

99.4

99.6

99.3

99.9

VPR+2ROW

98.2

96.2

98.5

95.5

99.1

99.9

Page 27: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Notion of Force VectorNotion of Force Vector

Idea: use a cell’s force vector to guide decisions

Primary Application: Tie-Breaking

Current Applications: Interleaving Max-Gain Path (Dynamic Re-clustering)

Details: Weighted Graph Model

used (as in Qplace) Weighted Center of

Gravity of Neighbors Calculated

Page 28: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

CLUSTERINGIN

GLOBAL PLACEMENT

CLUSTERINGIN

GLOBAL PLACEMENT

Page 29: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Middle-Down With ClusteringMiddle-Down With Clustering

Global Placement on “coarse” grids

De-cluster this circuit, increase the grid size &

place

Cluster the net list & place

Is the circuit completely flattened?

NO

Convert to detailed placement

Perform interleaving & output final result

YES

Page 30: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Clustering CycleClustering Cycle

ClusteringUnclustering

Placement of clusters

Page 31: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Grid ScheduleGrid Schedule

Mongrel: 2-level

Newer Work: Multi-Level

One Data Point (ckt: IBM11): A: 25x25 -> 40x40 -> 60x40 -> 128x40 B: 3x3 ->10x10 -> 20x20 -> 40x40 -> 128x40

Schedule B consistently better

Page 32: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Bottom-up clusteringBottom-up clustering

Pair-wise merging

Selection of Node1 Criteria: size

Selection of Node2 Criteria: bandwidth

Note: Target Size is always maintained

Page 33: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Reclustering (Work In Progress)Reclustering (Work In Progress)

Idea: Let Placer Help in Finding Candidate Pairs to Cluster

Run Global Placer at Certain Granularity

Partially Flatten

Run Global Placer on Flattened Netlist

Cells (clusters) in same bin now are good candidates to join.

Additionally: Use “force vector” as similarity metric.

Page 34: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

MOTIVATION:RE-CLUSTERING IN

LINEAR PLACEMENT

MOTIVATION:RE-CLUSTERING IN

LINEAR PLACEMENT

Page 35: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Displacement GraphDisplacement Graph

Regarding displacement graph, placement means linear placement.

P[ i ]: cell placed in location i

P-1-1[ v ]: location of cell v

Assume each cell has a unit size for linear placement

a b c d e f g h i

1 2 3 4 5 6 7 8 9

P[4] = d P-1[g] = 7

Location:

Placement:

E.g.:

Page 36: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Displacement Graph (cont.)Displacement Graph (cont.)

Suppose Pg is a relatively good reference placement and Pb a mediocre one.

Displacement of Pb for each location i w.r.t. Pg is

D[ i ] = Pg-1[Pb[ i ]] - i

An Example of Displacement

Pb:

Pg:

location :

D[i] :

c d f g h a b i e

a b c d e f g h i

1 2 3 4 5 6 7 8 9

2 2 3 3 3 -5 -5 1 -4

Page 37: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Displacement Graph (cont.)Displacement Graph (cont.)

14050 1420014125

location

-2000

0

4000

2000

6000

disp

lace

me

nt

• Test circuit: s38584

• length(reference placement) = 1247152

• length(mediocre placement) = 2698928

Page 38: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Plateaus-Density CorrelationPlateaus-Density Correlation

120 290location

displacement

density

Test circuit: s38584

(of mediocre

placement)

Page 39: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Dynamic Clustering (Linear Placement)Dynamic Clustering (Linear Placement)

200 1200700

Time(sec)

450000

Wire

le

ngth

500000

500000

550000

600000

• Test circuit: s15850

• : Flat placement

• : Clustered placement

Page 40: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

A Few Data PointsA Few Data Points

MCNC avql (1 cell-height row spacing): Middle-Down: 5.86 Capo: 6.207 Feng Shui: 6.291 DRAGON: 5.25

IBM11 Middle-Down: 4.21 DRAGON: 4.08

Page 41: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Strengths and Weaknesses Strengths and Weaknesses

Flexibility and Potential of Framework Timing Optimization? Modularity of Optimizers

Strong results for small to medium sized circuits

Near competitive results for larger circuits

Scalability Unclear

Speed

Ongoing Work: More Careful Study of

Initial Clustering Speedup Techniques

(esp. gain graph) Implementation of 2-row

interleaving Dynamic Re-clustering

Page 42: Topics in “Middle-Down” Placement John Lillis Karthik Kalpat Devang Jariwala Sung-Woo Hur UIC

Thank you !Thank you !