Metodologie di progetto HW Technology Mapping. Last update: 19/03/09

Similar documents
Engr354: Digital Logic Circuits

Unit 4. Combinational Circuits

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

m2 m3 m1 (a) (b) (c) n2 n3

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Logic Synthesis and Verification

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

y1 y2 DEMUX a b x1 x2 x3 x4 NETWORK s1 s2 z1 z2

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18

Logic Synthesis and Verification

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.

Part 4. Integration (with Proofs)

Chapter 4 State-Space Planning

Hardware Verification 2IMF20

Lecture 11 Binary Decision Diagrams (BDDs)

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Solutions to Assignment 1

CS 491G Combinatorial Optimization Lecture Notes

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Lecture Notes No. 10

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Numerical Methods for Chemical Engineers

Laboratory for Foundations of Computer Science. An Unfolding Approach. University of Edinburgh. Model Checking. Javier Esparza

Hyers-Ulam stability of Pielou logistic difference equation

The Regulated and Riemann Integrals

We will see what is meant by standard form very shortly

CS 573 Automata Theory and Formal Languages

AP Calculus AB Unit 4 Assessment

Electromagnetism Notes, NYU Spring 2018

SEMANTIC ANALYSIS PRINCIPLES OF PROGRAMMING LANGUAGES. Norbert Zeh Winter Dalhousie University 1/28

EE 108A Lecture 2 (c) W. J. Dally and P. Levis 2

Math 4310 Solutions to homework 1 Due 9/1/16

Propositional models. Historical models of computation. Application: binary addition. Boolean functions. Implementation using switches.

The Double Integral. The Riemann sum of a function f (x; y) over this partition of [a; b] [c; d] is. f (r j ; t k ) x j y k

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

ANALYSIS AND MODELLING OF RAINFALL EVENTS

T b a(f) [f ] +. P b a(f) = Conclude that if f is in AC then it is the difference of two monotone absolutely continuous functions.

1.2. Linear Variable Coefficient Equations. y + b "! = a y + b " Remark: The case b = 0 and a non-constant can be solved with the same idea as above.

Math 32B Discussion Session Week 8 Notes February 28 and March 2, f(b) f(a) = f (t)dt (1)

A Mathematical Model for Unemployment-Taking an Action without Delay

Section 3.6. Definite Integrals

More Properties of the Riemann Integral

Arrow s Impossibility Theorem

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

8 THREE PHASE A.C. CIRCUITS

Discrete Structures Lecture 11

INTEGRATION. 1 Integrals of Complex Valued functions of a REAL variable

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

A recursive construction of efficiently decodable list-disjunct matrices

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

Lecture 2: January 27

Dynamic Template Matching with Mixed-polarity Toffoli Gates

] dx (3) = [15x] 2 0

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

The DOACROSS statement

Lecture 6. CMOS Static & Dynamic Logic Gates. Static CMOS Circuit. PMOS Transistors in Series/Parallel Connection

Pre-Lie algebras, rooted trees and related algebraic structures

MATH34032: Green s Functions, Integral Equations and the Calculus of Variations 1. 1 [(y ) 2 + yy + y 2 ] dx,

Robust Timing-Aware Test Generation Using Pseudo-Boolean Optimization

Technology Mapping Method for Low Power Consumption and High Performance in General-Synchronous Framework

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

The Wave Equation I. MA 436 Kurt Bryan

Bisimulation, Games & Hennessy Milner logic

Data Structures and Algorithm. Xiaoqing Zheng

A Transformation Based Algorithm for Reversible Logic Synthesis

Implication Graphs and Logic Testing

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Administrivia CSE 190: Reinforcement Learning: An Introduction

Boolean Algebra. Boolean Algebras

Automatic Synthesis of New Behaviors from a Library of Available Behaviors

Arrow s Impossibility Theorem

Where did dynamic programming come from?

Section 1.3 Triangles

6.5 Improper integrals

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

March eq Implementing Additional Reasoning into an Efficient Look-Ahead SAT Solver

CS241 Week 6 Tutorial Solutions

Fast index for approximate string matching

(a) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P.

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

Power System Representation and Equations. A one-line diagram of a simple power system

Review of Gaussian Quadrature method

Green s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e

5.7 Improper Integrals

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh

System Validation (IN4387) November 2, 2012, 14:00-17:00

Fault Modeling. EE5375 ADD II Prof. MacDonald

Math Lecture 23

A Differential Approach to Inference in Bayesian Networks

CS 188: Artificial Intelligence Spring 2007

CS 275 Automata and Formal Language Theory

= state, a = reading and q j

Exercise sheet 6: Solutions

Graph States EPIT Mehdi Mhalla (Calgary, Canada) Simon Perdrix (Grenoble, France)

Math 426: Probability Final Exam Practice

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

Line Integrals and Entire Functions

Lecture 19: Continuous Least Squares Approximation

Transcription:

Metodologie di progetto HW Tehnology Mpping Lst updte: 19/03/09

Tehnology Mpping 2

Tehnology Mpping Exmple: t 1 = + b; t 2 = d + e; t 3 = b + d; t 4 = t 1 t 2 + fg; t 5 = t 4 h + t 2 t 3 ; F = t 5 ; t 1 t 2 + fg t 5 t 4 h + t 2 t 3 F +b d+e b+d This shows n unoptimized set of logi equtions onsisting of 16 literls 3

Optimized Equtions Using tehnology independent optimiztion, these equtions re optimized using only 14 literls: t 1 = d + e; t 2 = b + h; t 3 = t 2 + ; t 4 = t 1 t 3 + fgh; F = t 4 ; t 5 F t 1 t 3 + fgh t 4 F t 1 t 2 + fg t 4 h + t 2 t 3 t 2 + +b d+e b+d d+e b+h 4

Optimized Equtions Implement this network using set of gtes whih form librry. Eh gte hs ost (i.e. its re, dely, et.) 5

Tehnology Mpping Two pprohes: Rule-Bsed [LSS] Sme struture s rule bsed tehniques for tehnology independent optimiztion Useful for lol optimiztions Lrge exeution times Algoritmi [DAGON, MISII] Represent eh funtion of network using set of bse funtions. This representtion is lled the subjet grph. Typilly the bse is 2-input NANDs nd inverters (Best hoie) The set should be funtionlly omplete. Eh gte of the librry is likewise represented using the bse set. This genertes pttern grphs Represent eh gte in ll possible wys 6

Subjet Grph F F t 4 f Subjet grph of 2-input NANDs nd Invertors (NAND/INV) t 1 t 3 + fgh d+e t 2 + b+h d e b h g h 7

Algorithmi Approh A over is olletion of pttern grphs suh tht every node of the subjet grph is ontined in one (or more) pttern grphs eh input required by pttern grph is tully n output of some other grph (i.e. the inputs of one gte must exists s outputs of other gtes.) For minimum re, the ost of the over is the sum of the res of the gtes in the over. Tehnology mpping problem: Find minimum ost overing of the subjet grph by hoosing from the olletion of pttern grphs for ll the gtes in the librry. 8

Subjet Grph f g t 1 = d + e; t 2 = b + h; t 3 = t 2 + ; t 4 = t 1 t 3 + fgh; F = t 4 ; d e h b F 9

Pttern Grphs for the IWLS Librry inv(1) nnd2(2) nnd3 (3) nor(2) nor3 (3) oi21 (3) oi22 (4) xor (5) 10

Subjet grph overing f t 1 = d + e; t 2 = b + h; t 3 = t 2 + ; t 4 = t 1 t 3 + fgh; F = t 4 ; Totl ost = 23 g d e h b F 11

Better Covering nd2(3) f t 1 = d + e; t 2 = b + h; t 3 = t 2 + ; g d e or2(3) oi22(4) F t 4 = t 1 t 3 + fgh; F = t 4 ; h or2(3) b nnd2(2) Totl re = 19 nnd2(2) inv(1) 12

Alternte Covering f nnd3(3) t 1 = d + e; t 2 = b + h; g d e oi21(3) nd2(3) F t 3 = t 2 + ; t 4 = t 1 t 3 + fgh; h F = t 4 ; b oi21 (3) Totl re = 15 nnd2(2) inv(1) 13

Teh. mpping using DAG overing Input: Output: Tehnology independent, optimized logi network Desription of the gtes in the librry with their ost Netlist of gtes (from librry) whih minimizes totl ost Generl Approh: Construt subjet DAG for the network Represent eh gte in the trget librry by pttern DAG s Find n optiml-ost overing of subjet DAG using the olletion of pttern DAG s 14

DAG overing s binte overing problem Compute ll possible mthes {m k } (ellipses in fig.) for eh node Using vrible m i for eh mth of pttern grph in the subjet grph, (m i =1 if mth is hosen) Write luse for eh node of the subjet grph inditing whih mthes over this node. Eh node hs to be overed. e.g., if subjet node is overed by mthes {m 2, m 5, m 10 }, then the luse would be (m 2 + m 5 + m 10 ). m 1 m 2... m k Repet for eh subjet node nd tke the produt over ll subjet nodes. (CNF) n 1 n nodes 2... n l 15

DAG overing s binte overing problem Any stisfying ssignment gurntees tht ll subjet nodes re overed, but does not gurntee tht other mthes hosen rete outputs needed s inputs needed for given mth. not n output of hosen mth Retify this by dding dditionl luses. 16

DAG overing s binte overing problem Let mth m i hve subjet nodes s i1,,s in s n inputs. If m i is hosen, one of the mthes tht relizes s ij must lso be hosen for eh input j ( j not primry input). Let S ij be the disjuntive expression in the vribles m k giving the possible mthes whih relize s ij s n output node. Seleting mth m i implies stisfying eh of the expressions S ij for j = 1 n. This n be written (m i (S i1 S in ) ) (m i + (S i1 S in ) ) ((m i + S i1 ) (m i + S in ) ) 17

DAG overing s binte overing problem Also, one of the mthes for eh primry output of the iruit must be seleted. An ssignment of vlues to vribles m i tht stisfies the bove overing expression is legl grph over For re optimiztion, eh mth m i hs ost i tht is the re of the gte the mth represents. The gol is stisfying ssignment with the lest totl ost. Find lest-ost prime: if vrible m i = 0 its ost is 0, else its ost in i m i = 0 mens tht mth i is not hosen 18

Binte Covering This problem is more generl thn unte-overing for two-level minimiztion beuse vribles re present in the overing expression in both their true nd omplemented forms. The overing expression is binte logi funtion, nd the problem is referred to s the binte-overing problem. 19

Binte Covering: Exmple 1 3 5 o 1 2 b d 4 6 7 8 9 o 2 Gte Cost Inputs Produes Covers m1 inv 1 b g1 g1 m2 inv 1 g2 g2 m3 nnd2 2 g1, g2 g3 g3 m4 nnd2 2, b g4 g4 m5 nnd2 2 g3, g4 g5 g5 m6 inv 1 g4 g6 g6 m7 nnd2 2 g6, g7 g7 m8 inv 1 g7 g8 g8 m9 nnd2 2 g8, d g9 g9 m10 nnd3 3 g6,, d g9 g7, g 8, g 9 m11 nnd3 3, b, g7 g4, g 6, g 7 m12 xnor2 5, b g5 g1, g 2, g 3, g 4, g 5 m13 nnd4 4, b,, d g9 g4, g 6, g 7, g 8, g 9 m14 oi21 3, b, g4 g5 g1, g 2, g 3, g 5 20

Binte Covering: Exmple Generte onstrints tht eh node g i be overed by some mth. (m 1 + m 12 + m 14 ) (m 2 + m 12 + m 14 ) (m 3 + m 12 + m 14 ) (m 4 + m 11 + m 12 + m 13 ) (m 5 + m 12 + m 13 ) (m 6 + m 11 + m 13 ) (m 7 + m 10 + m 11 + m 13 ) (m 8 + m 10 + m 13 ) (m 9 + m 10 + m 13 ) To ensure tht over leds to vlid iruit, extr luses re generted. For exmple, seleting m 3 requires tht mth be hosen whih produes g 2 s n output, nd mth be hosen whih produes g 1 s n output. The only mth whih produes g 1 is m 1, nd the only mth whih produes g 2 is m 2 21

Binte Covering: Exmple The primry output nodes g 5 nd g 9 must be relized s n output of some mth. The mthes whih relize g 5 s n output re m 5, m 12, m 14 ; The mthes whih relize g 9 s n output re m 9, m 10, m 13 Note: A mth whih requires primry input s n input is stisfied trivilly. Mthes m 1,m 2,m 4,m 11,m 12,m 13 re driven only by primry inputs nd do not require dditionl luses 22

Binte Covering: Exmple Finlly, we get (m 3 + m 1 ) (m 3 + m 2 ) (m 3 +m 5 ) (m 5 + m 4 ) (m 6 + m 4 ) (m 7 + m 6 ) (m 8 + m 7 + m 11 ) (m 8 +m 9 ) (m 10 + m 6 ) (m 14 + m 4 ) (m 5 + m 12 + m 14 ) (m 9 + m 10 + m 13 ) The overing expression hs 58 implints The lest ost prime implint is m 3 m 5 m 6 m 7 m 8 m 9 m 10 m 12 m 13 m 14 This uses two gtes for ost of nine gte units. This orresponds to over whih selets mthes m 12 (xor2) nd m 13 (nnd4). 23

Gte Cost Inputs Produes Covers m1 inv 1 b g1 g1 m2 inv 1 g2 g2 m3 nnd2 2 g1, g2 g3 g3 m4 nnd2 2, b g4 g4 m5 nnd2 2 g3, g4 g5 g5 m6 inv 1 g4 g6 g6 m7 nnd2 2 g6, g7 g7 m8 inv 1 g7 g8 g8 m9 nnd2 2 g8, d g9 g9 m10 nnd3 3 g6,, d g9 g7, g8, g9 m11 nnd3 3, b, g7 g4, g6, g7 m12 xnor2 5, b g5 g1, g2, g3, g4, g5 m13 nnd4 4, b,, d g9 g4, g6, g7, g8, g9 m14 oi21 3, b, g4 g5 g1, g2, g3, g5 m 3 m 5 m 6 m 7 m 8 m 9 m 10 m 12 m 13 m 14 1 2 3 5 o 1 Note tht the node g 4 is overed by both mthes b d 4 6 7 8 9 o 2 24

Complexity of DAG overing More generl thn unte overing Finding lest ost prime of binte funtion. Even finding fesible solution is NP-omplete (SAT). For unte overing, finding fesible solution is esy. DAG-overing: overing + implition onstrints Given subjet grph, the binte overing provides the ext solution to the tehnology-mpping problem. However, better results my be obtined with different initil deomposition into 2-input NANDS nd inverters Methods to solve the binte overing formultion: Brnh nd bound [Thelen] BDD-bsed [Lin nd Somenzi] Even for moderte-size networks, these re expensive. 25

Optiml Tree Covering by Trees If the subjet DAG nd primitive DAG s re trees, then n effiient lgorithm to find the best over exists Bsed on dynmi progrmming First proposed for optiml ode genertion in ompiler (KEUTZER) 26

Optiml Tree Covering by Trees Prtition subjet grph into forest of trees Cover eh tree optimlly using dynmi progrmming Given: Subjet trees (networks to be mpped) Forest of ptterns (gte librry) Consider node N of subjet tree Reursive Assumption: for ll hildren of N, best ost mth (whih implements the node) is known Cost of lef of the tree is 0. Compute ost of eh pttern tree whih mthes t N, Cost = SUM of best osts of implementing eh input of pttern plus the ost of the pttern Choose lest ost mthing pttern for implementing N 27

Optimum Are Algorithm Algorithm OPTIMAL_AREA_COVER(node) { foreh input of node { OPTIMAL_AREA_COVER(input);// stisfies reurs. ssumption } // Using these, find the best over t node nodere = INFINITY; nodemth = 0; foreh mth t node { re = mthre; foreh pin of mth { re = re + pinre; } if (re < nodere) { nodere = re; nodemth = mth; } } } 28

Tree Covering in Ation 0 0 0 0 NAND2 NAND2 NAND2 AOI22 3xNAND2 AOI22 + NAND2 + INV AOI22 + NAND2 + 2INV NAND2 NAND3 0 INV 0 0 0 NAND3 QUICKLY FINAL COST: 2xNAND3 + AOI22 + INV 29

Complexity of Tree Covering Complexity is ontrolled by finding ll sub-trees of the subjet grph whih re isomorphi to pttern tree. Liner omplexity in both size of subjet tree nd size of olletion of pttern trees 30

Prtitioning the Subjet DAG into Trees Trivil prtition: brek the grph t ll multiple-fnout points leds to no duplition or overlp of ptterns drwbk - sometimes results in mny of smll trees Leds to 3 trees 31

DAG-to-Tree Deomposition Forest of Trees 32

Prtitioning the subjet DAG into trees Single-one prtition: from single output, form lrge tree bk to the primry inputs; mp suessive outputs until they hit mth output formed from mpping previous primry outputs. Duplites some logi (where trees overlp) Produes muh lrger trees, potentilly better re results output output 33

Min-Dely Covering For trees: identil to min-re overing use optiml dely vlues within the dynmi progrmming prdigm For DAGs: if dely does not depend on number of fnouts: use dynmi progrmming s presented for trees leds to optiml solution in polynomil time Combined objetive e.g. pply dely s first riteri, then re s seond ombine with stti timing nlysis to fous on ritil pths 34

Combined Deomposition nd Tehnology Mpping Common Approh: Phse 1: Tehnology independent optimiztion ommit to prtiulr Booln network lgebri deomposition used Phse 2: AND2/INV deomposition ommit to prtiulr deomposition of generl Boolen network using 2-input ANDs nd inverters Phse 3: Tehnology mpping (tree-mpping) 35

Combined Deomposition nd Tehnology Mpping Lehmn Wtnbe Algorithm: Key Ide: Effiiently enode set of AND2/INV deompositions into single struture lled mpping grph Apply modified tree-bsed tehnology mpper while dynmilly performing lgebri logi deomposition on the mpping grph 36

A set of AND2/INV Deompositions f = b n be represented in vrious wys b f b b f f b f 37

Combine them using hoie node b A set of AND2/INV Deompositions b b b 38

A set of AND2/INV Deompositions b b b f These deompositions n be represented more omptly s: b 39

Mpping Grph A Boolen network ontining 4 modifitions: Choie node: hoies on different deompositions Cyli: funtions written in terms of eh other, e.g. inverter hin with n rbitrry length Redued: No two hoie nodes with sme funtion. No two AND2s with sme fnin. (like BDD node shring) Ugtes: just for effiient implementtion - do not expliitly represent hoie nodes nd inverters b b b b ugtes b 40

Tree-mpping on Mpping Grph Grph-Mpping on Trees: Apply dynmi progrmming from primry inputs: find mthes t eh AND2 nd INV, nd retin the ost of best over t eh node mth my ontin hoie nodes the ost t hoie node is the minimum of fnin osts fixed-point itertion on eh yle, until osts of ll the nodes in the yle beome stble Run-time is typilly liner in the size of the mpping grph b b b b AND3 b 41

Exmple: Tree-mpping Dely: best hoie if is lter thn nd b. subjet grph librry pttern grph 42

THE END 43