ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science...

28
ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    1

Transcript of ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science...

Page 1: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

ICS 252 Introduction to Computer Design

Lecture 14

Winter 2004

Eli BozorgzadehComputer Science Department-UCI

Page 2: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

2 Winter 2004 ICS 252-Intro to Computer Design

References and Copyright (cont.)• Slides used: (Modified by Kia when necessary)

– [©Sarrafzadeh] © Majid Sarrafzadeh, 2001; Department of Computer Science, UCLA

– [©Sherwani] © Naveed A. Sherwani, 1992 (companion slides to [She99])

– [©Keutzer] © Kurt Keutzer, Dept. of EECS, UC-Berekeleyhttp://www-cad.eecs.berkeley.edu/~niraj/ee244/index.htm

– [©Gupta] © Rajesh Gupta UC-Irvinehttp://www.ics.uci.edu/~rgupta/ics280.html

– [©Kang] © Steve Kang UIUChttp://www.ece.uiuc.edu/ece482/

Page 3: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

3 Winter 2004 ICS 252-Intro to Computer Design

Floorplanning• Problem

– Given circuit modules (or cells) and their connections, determine the approximate location of circuit elements

– Consistent with a hierarchical / building block design methodology

– Modules (result of partitioning):• Fixed area, generally rectangular• Fixed aspect ratio hard macro

(aka fixed-shaped blocks)fixed / floating terminals (pins)Rotation might be allowed / denied

• Flexible shape soft macro (aka soft modules)

(w1,h1)

(wN,hN)

Page 4: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

4 Winter 2004 ICS 252-Intro to Computer Design

Floorplanning (cont.)• Objectives:

– Minimize area– Determine best shape of soft modules– Minimize total wire length

• to make subsequent routing phase easy(short wire length roughly translates into routability)

– Additional cost components:• Wire congestion (exact routability measure)• Wire delays• Power consumption

• Possible additional constraints:– Fixed location for some modules– Fixed die, or range of die aspect ratio

• NP-hard

Page 5: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

5 Winter 2004 ICS 252-Intro to Computer Design

Floorplanning: Why Important?• Early stage of physical design

– Determines the location of large blocks detailed placement easier (divide and conquer!)

– Estimates of area, delay, power important design decisions

– Impact on subsequent design steps (e.g., routing, heat dissipation analysis and optimization)

B

C G

EL F

K I

J AHD

J

K

L G

I E

H

C

B

A

F

D

Page 6: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

6 Winter 2004 ICS 252-Intro to Computer Design

Floorplan Classes• Slicing, recursively defined as:

– A module OR– A floorplan that can be

partitioned into two slicing floorplans with a horizontal or vertical cut line

• Non-slicing– Superset of slicing floorplans– Contains the “wheel” shape too.

1234567

167 2345

234 5167

43

6 27 34

1 3

4

5

2

67

Slicingfloorplan

Corresp.Slicingtree

Non-Slicingfloorplan

Page 7: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

7 Winter 2004 ICS 252-Intro to Computer Design

• Hierarchical floorplan of order 5– Templates

– Floorplan and tree example

Non-slicing Floorplan Example

3

857

L5 R5

34

6

87

1

2

5

R5

1 6 2

4

Page 8: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

8 Winter 2004 ICS 252-Intro to Computer Design

Floorplanning Algorithms• Components

– “Placeholder” representation• Usually in the form of a tree• Slicing class: Polish expression [Otten]• Non-slicing class: O-tree, Sequence Pair, BSG, etc.• Just defines the relative position of modules

– Perturbation• Going from one floorplan to another• Usually done using Simulated Annealing

– Floorplan sizing• Definition: Given a floorplan tree, choose the best shape for each

module to minimize area• Slicing: polynomial, bottom-up algorithm• Non-slicing: NP! Use mathematical programming (exact solution)

– Cost function• Area, wire-length, ...

Page 9: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

9 Winter 2004 ICS 252-Intro to Computer Design

Area Utilization, Hard and Soft Modules• The hierarchy tree and floorplan

define “place holders” for modules• Area utilization

– Depends on how nicelythe rigid modules’ shapes are matched

– Soft modules can take different shapes to“fill in” empty slots floorplan sizing

1

7 6

23

4

5

m1

m7

m6 m5

m2 m

4m

3

m1

m7

m6 m5

m2 m

4m

3

m7

m7

m1

m7

Area = 20x22 = 440 Area = 20x19 = 380

Page 10: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

10 Winter 2004 ICS 252-Intro to Computer Design

Floorplan Sizing for Slicing Floorplans• Bottom-up process• Has to be done per floorplan perturbation• Requires O(n) time.

– N is the total number of shapes of all the modules

V

L R

H

T B

biai

yjxj

bi+yj

max(ai, xj)

biai

max(bi, yj)ai+ xj

yjxj

Page 11: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

11 Winter 2004 ICS 252-Intro to Computer Design

17x16

Sizing Slicing Floorplans

m1

9x15

m7

m6

9x7

m5

8x16

8x11m2

m4

m3

4x11

1234567

167 2345

234 5167

43

6 27 34

4x7 5x4

8x8

4x8

3x6 4x5

7x5

• Simple case:– All modules are hard macros– No rotation allowed

one shape only

134

5

2

67

Page 12: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

12 Winter 2004 ICS 252-Intro to Computer Design

Sizing Slicing Floorplans (cont.)• What if modules have more than one shape?• If area only concern:

– Module A has shapes 4x6, 7x8, 5x6, 6x4, 7x4,which ones should we pick?

– Module A has shapes 4x6, 5x5, 6x4,which ones should we pick?(what if B is 3x5?!)

• Dominant points– Shape (x1, y1) dominates (x2, y2)

if x1 x2 and y1 y2.

A B

p q

r dominates p dominates q

dominates r

Page 13: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

13 Winter 2004 ICS 252-Intro to Computer Design

Sizing Slicing Floorplans: Example

AA BB a1 a2 a3

4x6 5x5 6x4

b1

b2

b3

3x4

2x7

4x2

6x7 7x7 8x7

b1a1 b1a2

b1a3

7x6 8x5 9x4

b2a1 b2a2 b2a3

8x6 9x5 10x4b3

a1b3

a2b3a3

Page 14: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

14 Winter 2004 ICS 252-Intro to Computer Design

Slicing Floorplan Sizing AlgorithmProcedure Vertical_Node_Sizing 

Input: Two sorted lists L = { (a1, b1), ... , (as,bs) },

R = { (x1, y1), ... , (xt, yt) }

where ai < aj, bi > bj, xi < xj, yi > yj for all i < j

Output: A sorted list H = { (c1, d1), ... , (cu,du) }

where u s + t - 1, ci < cj, di > dj for all i < j  

begin-1 H := i := 1, j := 1, k = 1 while (i s) and (j t) do begin-2

(ck, dk) := (ai + xj, max(bi, yj))

H := H { (ck, dk) } k := k + 1

if max(bi, yj) = bi then i := i + 1

if max(bi, yj) = yj then j := j + 1 end-2

end-1

Page 15: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

15 Winter 2004 ICS 252-Intro to Computer Design

Slicing Floorplan Sizing• Input: floorplan tree, modules shapes• Start with sorted shapes lists of modules• In a bottom-up fashion, perform:

– Vertical_Node_SizingANDHorizontal_Node_Sizing

• When get to the root node, we have a list of shapes. Select the one that is best in terms of area

• In a top-down fashion, traverse the floorplan tree and set module locations

Page 16: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

16 Winter 2004 ICS 252-Intro to Computer Design

Wire Length• For hyperedges:

– Either of complete graph, MST, or Steiner tree

• For each edge:– Euclidian distance sqrt( (x1-x2)2 + (y1-y2)2 ).

• Direct lines– Manhattan distance |x1 – x2| + |y1 – y2|

• Manhattan: Only horizontal / vertical lines

(c) complete graph (length = 32)

(b) minimum spanning tree (length = 11)

(a) Steiner tree

(length = 13)

Page 17: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

17 Winter 2004 ICS 252-Intro to Computer Design

Polish Expression• Tree representation of the

floorplan– Left child of a V-cut in the tree

representsthe left slice in the floorplan

– Left child of an H-cut in the tree representsthe top slice in the floorplan

• Polish expression representation– A string of symbols obtained

by traversing a binary tree in post-order.

1 7 6 | - 2 3 4 - | 5 - |1 7 6 | - 2 3 4 - | 5 - |

134

5

2

67

1 5

43

67 2

Page 18: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

18 Winter 2004 ICS 252-Intro to Computer Design

Normalized Polish Expression• Problem with Polish expressions?

– Multiple representations for some slicing trees• When more than one cut in one direction cut a floorplan

– Larger solution space– A stochastic algorithm (e.g., Simulated Annealing) will be

more biased towards floorplans with multiple representations

• (More likely to be visited)

1

23 4

1 2 - 3 4 | |1 2 - 3 4 | | 1 2 - 3 | 4 |1 2 - 3 | 4 |

1 2 3 4

4

3

21

Page 19: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

19 Winter 2004 ICS 252-Intro to Computer Design

Normalized Polish Expression (cont.)

• Solution?– Assign priorities to the cuts– In a top-down tree construction,

• Pick the right-most cut• Pick the lowest cut

– Result: no two same operatorsadjacent in the Polish expression(i.e., no “| |” or “— —”)

1

2 3 4

51 2 – 5 - 3 | 4 |1 2 – 5 - 3 | 4 |

4

3

5

21

Page 20: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

20 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing• Idea originated from observations of crystal formations (e.g., in

lava)– A crystal is in a low energy state– Materials tend to form crystals (global minimum)– If at the right temperature (i.e., right speed), a molecule will adhere to a

crystal formation

• Very slowly decrease temperature– When very hot, molecules move freely

• When a molecule gets to a chunk of crystal,it *might* move away due to its high speed

– When colder, molecules slow down• The probability of moving away from a local optimum decreases

– When the material “freezes”, all molecules are fixed and the material is in minimum energy state

Page 21: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

21 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing Algorithm

• Components:– Solution space (e.g., slicing floorplans)– Cost function (e.g., the area of a floorplan)

• Determines how “good” a particular solution is

– Perturbation rules(e.g., transforming a floorplan to a new one)

– Simulated annealing engine• A variable T, analogous to temperature

• An initial temperature T0 (e.g., T0 = 40,000)

• A freezing temperature Tfreez (e.g., Tfreez=0.1)

• A cooling schedule (e.g., T = 0.95 * T)

Page 22: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

22 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing AlgorithmProcedure SimulatedAnnealing

curSolution = random initial solution

T = T0 // initial temperature

while (T > Tfreez) do

for i=1 to NUM_MOVES_PER_TEMP_STEP donextSol = perturb (curSolution)cost = cost(nextSol) – cost(curSolution)if acceptMove (cost, T) then

curSolution = nextSol // accept the moveT = coolDown (T )

Procedure acceptMove (cost, T)if cost < 0 then return TRUE // always accept a good moveelse

boltz = e-cost / k T // Boltzmann probability functionr = random(0,1) // uniform rand # between 0&1if r < boltz then return TRUEelse return FALSE

Page 23: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

23 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing: Move Acceptance

• Good moves are always accepted• Accepting bad moves:

– When T = T0, bad move acceptance probability 1

– When T = Tfreez, Bad move acceptance probability = 0

• Boltzmann probability function?!?– boltz = e-cost / k T.– k is the Boltzmann constant,

chosen so that all moves at the initial temperatureare accepted

Page 24: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

24 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing: More Insight...

Annealing steps

0

10000

20000

30000

40000

1 51 101 151 201 251 301 351 401

Tem

pera

ture

0

0.2

0.4

0.6

0.8

1

1 51 101 151 201 251 301 351 401

Bo

ltzm

an

n E

xp

Page 25: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

25 Winter 2004 ICS 252-Intro to Computer Design

Simulated Annealing: More Insight...

0

200

400

600

800

1 51 101 151 201 251 301 351 401

Co

st

Fu

ncti

on

0

50

100

150

200

250

1 51 101 151 201 251 301 351 401

Nu

m M

oves A

cc

Page 26: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

26 Winter 2004 ICS 252-Intro to Computer Design

Wong-Liu Floorplanning Algorithm

• Uses simulated annealing• Normalized Polish expressions represent

floorplans• Cost function:

– cost = area + totalWireLength– Floorplan sizing is used to determine area– After floorplan sizing, the exact location of each

module is known, hence wire-length can be calculated

• Perturbation?....

Page 27: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

27 Winter 2004 ICS 252-Intro to Computer Design

Wong-Liu Floorplanning Algorithm (cont.)• Moves:

– OP1: Exchange two operands that haveno other operands in between

– OP2: Complement a series of operatorsbetween two operands

– OP3: Exchange adjacent operand and operator if the resulting expression still a normalized Polish exp.

24

13

3

24

1

3

1 24

4

1 2

3

12 | 4 – 3 | 12 | 3 – 4 | 12 - 3 – 4 | 12 - 3 4 - |

OP1OP1OP1OP1 OP2OP2OP2OP2 OP3OP3OP3OP3

Page 28: ICS 252 Introduction to Computer Design Lecture 14 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.

28 Winter 2004 ICS 252-Intro to Computer Design

Other Floorplanning Methods

• Rectangular dual graph

• Linear programming (floorplan sizing)

• Non-slicing methods– Sequence-pair– Bounded slice line grid– O-tree– Corner block list