fpga technology mapping

46
FPGA Technology Mapping Dr. Philip Brisk Department of Computer Science and Engineering University of California, Riverside CS 223

Upload: alida

Post on 23-Feb-2016

48 views

Category:

Documents


0 download

DESCRIPTION

FPGA Technology Mapping. Dr. Philip Brisk Department of Computer Science and Engineering University of California, Riverside CS 223. Example. Theoretical Results. Minimize Number of Logic Stages Polynomial-time Minimize Total Number of LUTs (Area) NP-Complete Minimize Power Consumption - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: FPGA Technology Mapping

FPGA Technology Mapping

Dr. Philip BriskDepartment of Computer Science and Engineering

University of California, Riverside

CS 223

Page 2: FPGA Technology Mapping

Example

Page 3: FPGA Technology Mapping

Theoretical Results

• Minimize Number of Logic Stages– Polynomial-time

• Minimize Total Number of LUTs (Area)– NP-Complete

• Minimize Power Consumption– NP-Complete

Page 4: FPGA Technology Mapping

DAG Representation

• Since LUTs are reconfigurable, we don’t need to worry about the logic function of each gate during mapping

Page 5: FPGA Technology Mapping

K-Feasible Cuts and LUT Mapping

Page 6: FPGA Technology Mapping

Example: Node Duplication

Page 7: FPGA Technology Mapping

FlowMap: An Optimal Technology Mapping Algorithm for Delay Optimization in Lookup-Table

Based FPGA Designs

Jason Cong and Yuzheng DingIEEE Trans. CAD 13(1): 1-12, Jan. 1994

Page 8: FPGA Technology Mapping

Cuts in a Directed Acyclic Graph (DAG)

A cut is K-feasible if:

This cut is 3-feasible

Page 9: FPGA Technology Mapping

Edge Cut Size

• Each edge has non-negative capacity

• The edge cut size is the sum of the capacities of the forward edges that cross the cut

• All edge capacities are assumed to be 1

Page 10: FPGA Technology Mapping

Example: Edge-cut size is 10

Page 11: FPGA Technology Mapping

Volume and Height

• The volume of a cut is the number of vertices in X:

• Given an assignment of labels to vertices, the height of a cut is the largest label in X

Page 12: FPGA Technology Mapping

Example: Volume=9, Height=2

Page 13: FPGA Technology Mapping

FlowMap Algorithm (Overview)

• Labeling Phase– Computes a label for each node reflecting the

level of the K-LUT that implements that node in a depth-optimal mapping solution

• Mapping Phase– Generates the K-LUT mapping solution based on

node labels computed in the first phase

Page 14: FPGA Technology Mapping

Subnetwork of a Node

• For node t, let Nt denote the subnetwork consisting of every vertex s, such that there is a path from s to t

Page 15: FPGA Technology Mapping

Conversion to a Network Nt

• For node t, let Nt denote the subnetwork consisting of every vertex s, such that there is a path from s to t

• We can ignore the logic function of each gate

Page 16: FPGA Technology Mapping

Intuition

• Let LUT(t) represent a K-LUT that produces an output at node t

• Define a K-feasible cut where– denotes the set of nodes in LUT(t)– denotes the remaining nodes in– K-feasibility is ensured since LUT(t) has < K inputs

• If u has the maximum label in , then in the optimal mapping,

Page 17: FPGA Technology Mapping

Minimizing the Level of LUT(t)

• There may be many K-feasible cuts in • Lemma 1. Find the one that minimizes height!

• Note: This definition enumerates all K-feasible cuts at t– Key contribution: This can be done in O(Km) time,

where m is the number of edges in

Page 18: FPGA Technology Mapping

Example

• You get the existence of the 3-feasible cut in part (c) for free. • Figuring out how to compute it is the hard part!

Page 19: FPGA Technology Mapping

Lemma 2

• Proof Strategy1. Prove2. Prove

Consult the paper for details

Page 20: FPGA Technology Mapping

Algorithmic Strategy

• Check if there is a K-feasible cut of height in – If so, pack along with the nodes in in the

second phase of the algorithm. • Otherwise, the minimum height among all K-

feasible cuts in is is ,, and is one such cut.– If so, use a new K-LUT for in the next phase.

Page 21: FPGA Technology Mapping

How to efficiently test if has a K-feasible cut of height p – 1?

• Let p be the maximum label among all nodes of input(t)

• Equivalently, p is the maximum label of all nodes that belong to

• Collapse all nodes in with label > p along with t into a single sink t’; call the new network

Page 22: FPGA Technology Mapping

More Theory

• Construct another network from – Details to follow…

• has a cut whose edge cut-size is no more than K if the max. flow in is at most K

Page 23: FPGA Technology Mapping

Example

Page 24: FPGA Technology Mapping

Algorithmic Strategy (Recap)

• Check if there is a K-feasible cut of height in – If so, pack along with the nodes in in the

second phase of the algorithm. • Otherwise, the minimum height among all K-

feasible cuts in is is ,, and is one such cut.– If so, use a new K-LUT for in the next phase.

Page 25: FPGA Technology Mapping

Labeling Algorithm for K-LUTs

• For each node t in the DAG, taken in topological order– Let p be the max. label among all nodes of – Build networks , , and – Compute the maximum flow in – If the maximum flow is less than K, then:– Otherwise

Page 26: FPGA Technology Mapping

Summary of Theoretical Results

Page 27: FPGA Technology Mapping

FlowMap Algorithm

Page 28: FPGA Technology Mapping

Post-processing for Area Reduction

Page 29: FPGA Technology Mapping

Post-processing for Area Reduction

Page 30: FPGA Technology Mapping

Post-processing for Area Reduction

Page 31: FPGA Technology Mapping

WireMap: FPGA Technology Mapping for Improved Routability and Enhanced LUT Merging

S. Jang, B. Chan, K. Chung, and A. MishchenkoACM TRETS 2(2): article #14, June, 2009

Page 32: FPGA Technology Mapping

And-Inverter Graph (AIG)

https://en.wikipedia.org/wiki/And-inverter_graph

ANDANDAND

ANDAND

INV

INVINV

INV

INVINV

Page 33: FPGA Technology Mapping

Generic FPGA Technology Mapping

Page 34: FPGA Technology Mapping

Cut Enumeration

• The set of K-feasible cuts for an AND node n with predecessor nodes n1 and n2

• Let A and B be two sets of cuts

Page 35: FPGA Technology Mapping

Cut Enumeration

• Process vertices in topological order to ensure that cut sets for n1 and n2 are known before computing the cut set for n– The CUT set of an AND node is computed by

merging the CUT sets of its predecessors and adding the trivial cut (containing just n) while keeping only the K-feasible cuts

– Remove dominated cuts– Each AIG node is a 2-input AND

Page 36: FPGA Technology Mapping

Depth-Oriented Mapping• Keep the node at each level that minimizes

depth (e.g., FlowMap)

Page 37: FPGA Technology Mapping

Area Recovery

• Depth minimization may cause area duplication– Multiple cuts cover an AIG node– Increases LUT count

// Area Flow• Global View• Selects cuts with more shared logic

// Exact Local Area• Local View• Minimizes area exactly at each node

Page 38: FPGA Technology Mapping

Area Flow

• Estimates sharing between cuts without the need to (re-)traverse them

Area(n) is the area cost of the LUT that maps node n

Leafi is the ith leaf of the cut at n

NumFanout(n) is 1 if n is not used in the current mapping for area flow computation

nLeaf

Page 39: FPGA Technology Mapping

Local View

• The exact local area of the current node is the area added to the mapping by using the current node

• Recursively compute the number of LUTs in the max. fanout free cone (MFFC) of the current node– Use a fast local DFS traversal

Recursive Calls

n

Page 40: FPGA Technology Mapping

Producing a Mapped Network

• Assume one K-feasible representative cut is computed for each node

Page 41: FPGA Technology Mapping

WireMap

• Objective– Reduce the number of LUT-to-LUT connections in

addition to area reduction

• Rationale– Fewer nets will help the placer to generate a

solution with reduced wirelength

Page 42: FPGA Technology Mapping

Global View Heuristic

• Area Flow (from previous slide)

• Edge Flow (new idea)

Area(n) is the area cost of the LUT that maps node n

Edge(n) is the number of fanin edges to the LUT that maps node n

Page 43: FPGA Technology Mapping

Global Edge/Area Recovery Alg.

Find all cuts with min. area

Use edge flow as tiebreaker

No recursion; use the saved edgeflow computed at each predecessor node

nLeaf

Page 44: FPGA Technology Mapping

Local View• The exact local area (edge

count) of the current node is the area (edge count) added to the mapping by using the current node

• Recursively compute the number (edge count) of LUTs in the max. fanout free cone (MFFC) of the current node– Use a fast local DFS traversal

Recursive Calls

n

Page 45: FPGA Technology Mapping

Local View Algorithm

Find all cuts that minimize the exact area; use the exact edge count as a tiebreaker

Edge count of a cut depends if the cut is representative of the node in the mapping• If so, reference the node and the leaves

of its representative cut

Pointer manipulation in function calls (not shown)

Page 46: FPGA Technology Mapping

WireMap Algorithm

Xilinx Virtex-5Dual Output LUT