cs137: electronic design automation

103
CALTECH CS137 Fall2005 -- DeHon 1 CS137: Electronic Design Automation Day 3: September 29, 2005 Clustering (LUT Mapping, Delay)

Upload: holmes-soto

Post on 01-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

CS137: Electronic Design Automation. Day 3: September 29, 2005 Clustering (LUT Mapping, Delay). Today. How do we map to LUTs? What happens when delay dominates? Lessons… for non-LUTs for delay-oriented partitioning. LUT Mapping. Problem : Map logic netlist to LUTs minimizing area - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 1

CS137:Electronic Design Automation

Day 3: September 29, 2005

Clustering

(LUT Mapping, Delay)

Page 2: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 2

Today

• How do we map to LUTs?

• What happens when delay dominates?

• Lessons…– for non-LUTs– for delay-oriented partitioning

Page 3: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 3

LUT Mapping

• Problem: Map logic netlist to LUTs– minimizing area– minimizing delay

• Old problem?– Technology mapping? (last week)– Library approach require 22K gates in library

Page 4: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 4

Simplifying Structure

• K-LUT can implement any K-input function

Page 5: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 5

Cost Function

• Delay: number of LUTs in critical path– doesn’t say delay in LUTs or in wires– does assume uniform interconnect delay

• Area: number of LUTs– Assumes adequate interconnect to use

LUTs

Page 6: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 6

LUT Mapping

• NP-Hard in general

• Fanout-free -- can solve optimally given decomposition– (but which one?)

• Delay optimal mapping achievable in Polynomial time

• Area w/ fanout NP-complete

Page 7: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 7

Preliminaries

• What matters/makes this interesting?– Area / Delay target– Decomposition– Fanout

• replication• reconvergent

Page 8: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 8

Area vs. Delay

Page 9: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 9

Decomposition

Page 10: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 10

Decomposition

Page 11: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 11

Fanout: Replication

Page 12: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 12

Fanout: Replication

Page 13: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 13

Fanout: Reconvergence

Page 14: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 14

Fanout: Reconvergence

Page 15: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 15

Monotone Property

• Does cost function increase monotonicly as more of the graph is included? (do all subsets have property)– gate count?– I/o?

• Important?– How far back do we need to search?

Page 16: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 16

Delay

Page 17: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 17

Dynamic Programming

• Optimal covering of a logic cone is:– Minimum cost (all possible coverings)

• Evaluate costs of each node based on:– cover node– cones covering each fanin to node cover

• Evaluate node costs in topological order

• Key: are calculating optimal solutions to subproblems– only have to evaluate covering options at

each node

Page 18: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 18

Flowmap

• Key Idea:– LUT holds anything with K inputs– Use network flow to find cuts

logic can pack into LUT including reconvergence

• …allows replication

– Optimal depth arise from optimal depth solution to subproblems

Page 19: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 19

• Delay objective: – minimum height, K-feasible cut– I.e. cut no more than K edges– start by bounding fanin K

• Height of node will be:– height of predecessors or– one greater than height of predecessors

• Check shorter first

Flowmap

1 1

1 1

2

Page 20: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 20

Flowmap

• Construct flow problem– sink target node being mapped– source start set (primary inputs)– flow infinite into start set– flow of one on each link– to see if height same as predecessors

• collapse all predecessors of maximum height into sink (single node, cut must be above)

• height +1 case is trivially true

Page 21: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 21

1 1

2

2

1 1

Example Subgraph

Target: K=4

Page 22: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 22

3

1 1

2

2

1 1

Trivial: Height +1

Page 23: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 23

1 1

2

2

1 1

Collapse at max height

Page 24: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 24

2

1 1

2

2

1 1

Collapse not work (different/larger graph)

Forced to label height+1

Page 25: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 25

2

1 1

1

2

1

Reconvergent fanout (different/larger graph)

Can label at height

1

Page 26: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 26

Flowmap

• Max-flow Min-cut algorithm to find cut

• Use augmenting paths to until discover max flow > K

• O(K|e|) time to discover K-feasible cut

– (or that does not exist)

• Depth identification: O(KN|e|)

Page 27: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 27

Flowmap

• Min-cut may not be unique

Page 28: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 28

Two 3-cuts

Page 29: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 29

Flowmap

• Min-cut may not be unique

• To minimize area achieving delay optimum– find max volume min-cut

• Compute max flow find min cut• remove edges consumed by max flow• DFS from source• Compliment set is max volume set

Page 30: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 30

Graph

Page 31: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 31

Graph: maxflow (K=3)

Page 32: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 32

Graph: BFS source

Reachable

Page 33: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 33

Max Volume min-cut

Page 34: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 34

Flowmap

• Covering from labeling is straightforward– process in reverse topological order– allocate identified K-feasible cut to LUT– remove node– postprocess to minimize LUT count

• Notes:– replication implicit (covered multiple places)– nodes purely internal to one or more covers may

not get their own LUTs

Page 35: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 35

Flowmap Roundup

• Label– Work from inputs to outputs– Find max label of predecessors– Collapse new node with all predecessors at this label– Can find flow cut K?

• Yes: mark with label (find max-volume cut extent)• No: mark with label+1

• Cover– Work from outputs to inputs– Allocate LUT for identified cluster/cover– Recurse covering selection on inputs to identified LUT

Page 36: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 36

Area

Page 37: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 37

DF-Map

• Duplication Free Mapping– can find optimal area under this constraint– (but optimal area may not be duplication

free)

[Cong+Ding, IEEE TR VLSI Sys. V2n2p137]

Page 38: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 38

Maximum Fanout Free Cones

MFFC: bit more general than trees

Page 39: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 39

MFFC

• Follow cone backward

• end at node that fans out (has output) outside the code

Page 40: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 40

MFFC example

Page 41: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 41

MFFC example

Page 42: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 42

DF-Map

• Partition into graph into MFFCs• Optimally map each MFFC• In dynamic programming

– for each node• examine each K-feasible cut

– note: this is very different than flowmap where only had to examine a single cut

• pick cut to minimize cost– 1 + MFFCs for fanins

Page 43: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 43

DF-Map Example

Cones?

Page 44: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 44

DF-Map Example

Page 45: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 45

DF-Map Example

Page 46: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 46

DF-Map Example

Page 47: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 47

DF-Map Example

Page 48: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 48

DF-Map Example

Page 49: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 49

DF-Map Example

Startmappingcone

Page 50: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 50

DF-Map Example

1 1

1 1

Page 51: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 51

DF-Map Example

?

1 1

1 1

Page 52: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 52

DF-Map Example

?

1 1

1 1

Page 53: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 53

DF-Map Example

?

1 1

1 1

Page 54: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 54

DF-Map Example

1

1 1

1 1

Page 55: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 55

DF-Map Example

1 1

1

1

1

1 1

Similarto previous

Page 56: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 56

DF-Map Example

?

1 1

1

1

1

1 1

Page 57: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 57

DF-Map Example

?

1 1

1

1

1

1 1

Page 58: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 58

DF-Map Example

?

1 1

1

1

1

1 1

3

Page 59: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 59

DF-Map Example

?

1 1

1

1

1

1 1

Page 60: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 60

DF-Map Example

?

1 1

1

1

1

1 1

2

Page 61: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 61

DF-Map Example

?

1 1

1

1

1

1 1

Page 62: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 62

DF-Map Example

?

1 1

1

1

1

1 1

3

Page 63: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 63

DF-Map Example

2

1 1

1

1

1

1 1

Page 64: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 64

DF-Map Example

2 ?

1 1

1

1

1

1 1

Page 65: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 65

DF-Map Example

2 ?

1 1

1

1

1

1 1

Page 66: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 66

DF-Map Example

2 ?

1 1

1

1

1

1 1

3

Page 67: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 67

DF-Map Example

2 ?

1 1

1

1

1

1 1

3

Page 68: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 68

DF-Map Example

2 ?

1 1

1

1

1

1 1

3

3

Page 69: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 69

DF-Map Example

2 ?

1 1

1

1

1

1 1

3

3

Page 70: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 70

DF-Map Example

2 ?

1 1

1

1

1

1 1

3

3

3

Page 71: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 71

DF-Map Example

2 3

1 1

1

1

1

1 1

Page 72: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 72

DF-Map Example

2 3

1 1

1

1

?

1

1 1

Page 73: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 73

DF-Map Example

2 3

1 1

1

1

?

1

1 1

Page 74: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 74

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

Page 75: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 75

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

Page 76: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 76

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

Page 77: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 77

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

Page 78: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 78

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

3

Page 79: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 79

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

3

Page 80: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 80

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

3

4

Page 81: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 81

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

3

4

Page 82: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 82

DF-Map Example

2 3

1 1

1

1

?

1

1 1

4

3

3

4

3

Page 83: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 83

DF-Map Example

2 3

1 1

1

1

3

1

1 1

Page 84: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 84

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

Page 85: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 85

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

Page 86: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 86

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

8

Page 87: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 87

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

8

7

Page 88: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 88

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

8

7

Page 89: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 89

DF-Map Example

?

2 3

1 1

1

1

3

1

1 1

8

75

Page 90: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 90

DF-Map Example

5

2 3

1 1

1

1

3

1

1 1

Page 91: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 91

DF-Map Example

5

2 3

1 1

1

1

3

1

1 1

Page 92: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 92

Composing

• Don’t need minimum delay off the critical path

• Don’t always want/need minimum delay

• Composite:– map with flowmap– Greedy decomposition of “most promising”

non-critical nodes– DF-map these nodes

Page 93: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 93

Variations on a Theme

Page 94: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 94

Applicability to Non-LUTs?

• E.g. LUT Cascade – can handle some functions of K inputs

• How apply?

Page 95: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 95

Adaptable to Non-LUTs

• Sketch:

– Initial decomposition to nodes that will fit

– Find max volume, min-height K-feasible cut– ask if logic block will cover

• yes done• no exclude one (or more) nodes from block and

repeat– exclude == collapse into start set nodes– this makes heuristic

Page 96: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 96

Partitioning?

• Effectively partitioning logic into clusters– LUT cluster

• unlimited internal “gate” capacity• limited I/O (K)• simple delay cost model

– 1 cross between clusters– 0 inside cluster

Page 97: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 97

Partitioning

• Clustering – if strongly I/O limited, same basic idea

works for partitioning to components• typically: partitioning onto multiple FPGAs• assumption: inter-FPGA delay >> intra-FPGA

delay

– w/ area constraints • similar to non-LUT case

– make min-cut– will it fit?– Exclude some LUTs and repeat

Page 98: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 98

Clustering for Delay

• W/ no IO constraint

• area is monotone property

• DP-label forward with delays– grab up largest labels (greatest delays)

until fill cluster size

• Work backward from outputs creating clusters as needed

Page 99: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 99

Area and IO?

• Real problem:– FPGA/chip partitioning

• Doing both optimally is NP-hard

• Heuristic around IO cut first should do well– (e.g. non-LUT slide)– [Yang and Wong, FPGA’94]

Page 100: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 100

Partitioning

• To date:– primarily used for 2-level hierarchy

• I.e. intra-FPGA, inter-FPGA

• Open/promising– adapt to multi-level for delay-optimized

partitioning/placement on fixed-wire schedule

• localize critical paths to smallest subtree possible?

Page 101: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 101

Summary

• Optimal LUT mapping NP-hard in general– fanout, replication, ….

• K-LUTs makes delay optimal feasible– single constraint: IO capacity– technique: max-flow/min-cut

• Heuristic adaptations of basic idea to capacity constrained problem– promising area for interconnect delay

optimization

Page 102: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 102

Admin

• No class Monday, October 3rd

Page 103: CS137: Electronic Design Automation

CALTECH CS137 Fall2005 -- DeHon 103

Today’s Big Ideas:

• IO may be a dominant cost– limiting capacity, delay

• Exploit structure: K-LUTs

• Mixing dominant modes– multiple objectives

• Define optimally solvable subproblem– duplication free mapping