ECE 5775 (Fall 17) High-Level Digital Design Automation. Binary Decision Diagrams Static Timing Analysis

Similar documents
Motivation. CS389L: Automated Logical Reasoning. Lecture 5: Binary Decision Diagrams. Historical Context. Binary Decision Trees

EECS 219C: Formal Methods Binary Decision Diagrams (BDDs) Sanjit A. Seshia EECS, UC Berkeley

Unit 4: Formal Verification

Binary Decision Diagrams (BDD)

Synthesis 1. 1 Figures in this chapter taken from S. H. Gerez, Algorithms for VLSI Design Automation, Wiley, Typeset by FoilTEX 1

Boolean Representations and Combinatorial Equivalence

1/28/2013. Synthesis. The Y-diagram Revisited. Structural Behavioral. More abstract designs Physical. CAD for VLSI 2

ECE 5775 (Fall 17) High-Level Digital Design Automation. Fixed-Point Types Analysis of Algorithms

Advanced VLSI Design Prof. Virendra K. Singh Department of Electrical Engineering Indian Institute of Technology Bombay

Experiment 3: Logic Simplification

Code No: R Set No. 1

ECE260B CSE241A Winter Logic Synthesis

Synthesis of 2-level Logic Heuristic Method. Two Approaches

Behavior models and verification Lecture 6

CS357 Lecture: BDD basics. David Dill

Model Checking I Binary Decision Diagrams

Binary Decision Diagrams

Binary Decision Diagram with Minimum Expected Path Length

Binary Decision Diagrams (BDDs) Pingqiang Zhou ShanghaiTech University

Outcomes. Unit 9. Logic Function Synthesis KARNAUGH MAPS. Implementing Combinational Functions with Karnaugh Maps

Formal Verification. Lecture 7: Introduction to Binary Decision Diagrams (BDDs)

Symbolic Manipulation of Boolean Functions Using a Graphical Representation. Abstract

Combinatorial Algorithms. Unate Covering Binate Covering Graph Coloring Maximum Clique

L3: Representations of functions

Contents. Chapter 3 Combinational Circuits Page 1 of 34

Binary Decision Diagrams

2.6 BOOLEAN FUNCTIONS

Code No: R Set No. 1

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 04. Boolean Expression Simplification and Implementation

QUESTION BANK FOR TEST

Chapter 6: Multilevel Combinational Circuits. Name: Lương Văn Minh No. :

Unit-IV Boolean Algebra

ABC basics (compilation from different articles)

Digital Design. Chapter 4. Principles Of. Simplification of Boolean Functions

Chapter 2 Combinational Logic Circuits

Specifying logic functions

ENGINEERS ACADEMY. 7. Given Boolean theorem. (a) A B A C B C A B A C. (b) AB AC BC AB BC. (c) AB AC BC A B A C B C.

A Relational View of Subgraph Isomorphism

CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey

Homework 3 Handout 19 February 18, 2016

Symbolic Boolean Manipulation with Ordered Binary Decision Diagrams

Final Examination (Open Katz, asynchronous & test notes only, Calculators OK, 3 hours)

CS8803: Advanced Digital Design for Embedded Hardware

Announcements. Chapter 2 - Part 1 1

ECE380 Digital Logic

Lecture 4: Implementation AND, OR, NOT Gates and Complement

Code No: R Set No. 1

Binary Decision Diagrams

Chapter 8: Data Abstractions

Symbolic Model Checking

Karnaugh Maps. Kiril Solovey. Tel-Aviv University, Israel. April 8, Kiril Solovey (TAU) Karnaugh Maps April 8, / 22

ECE260B CSE241A Winter Logic Synthesis

MAT 7003 : Mathematical Foundations. (for Software Engineering) J Paul Gibson, A207.

Breakup Algorithm for Switching Circuit Simplifications

VLSI System Design Part II : Logic Synthesis (1) Oct Feb.2007

B.Tech II Year I Semester (R13) Regular Examinations December 2014 DIGITAL LOGIC DESIGN

CSE241 VLSI Digital Circuits UC San Diego

Last Name Student Number. Last Name Student Number

R10. II B. Tech I Semester, Supplementary Examinations, May

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

Philadelphia University Student Name: Student Number:

PROGRAMMABLE LOGIC DEVICES

CSE 417 Branch & Bound (pt 4) Branch & Bound

Representations of Terms Representations of Boolean Networks

Graphs. Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

ECE 5775 High-Level Digital Design Automation Fall Fixed-Point Types Analysis of Algorithms

Introduction. The Quine-McCluskey Method Handout 5 January 24, CSEE E6861y Prof. Steven Nowick

(Refer Slide Time 5:19)

Logic Synthesis and Verification

VLSI Logic Test, Validation and Verification Lecture 7 Properties & Applications of Binary Decision Diagrams

Chapter 3. Gate-Level Minimization. Outlines

Literal Cost F = BD + A B C + A C D F = BD + A B C + A BD + AB C F = (A + B)(A + D)(B + C + D )( B + C + D) L = 10

ON AN OPTIMIZATION TECHNIQUE USING BINARY DECISION DIAGRAM

Graph-Based Algorithms for Boolean Function Manipulation

Design of Framework for Logic Synthesis Engine

Giovanni De Micheli. Integrated Systems Centre EPF Lausanne

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY

POWR IP PZ1/17

Chapter 2 Combinational

Boolean Logic CS.352.F12

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

Gate Level Minimization Map Method

Slide Set 5. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Chapter 9 Graph Algorithms

EECS 270 Midterm Exam

Lecture 5. Chapter 2: Sections 4-7

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

McGILL UNIVERSITY Electrical and Computer Engineering Department MIDTERM EXAM

Chapter 6. Logic Design Optimization Chapter 6

Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits


Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

UNIT II. Circuit minimization

Solving Boolean Equations with BDDs and Clause Forms. Gert Smolka

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Digital Logic. Copyright By NODIA & COMPANY

L4: Binary Decision Diagrams. Reading material

Question Total Possible Test Score Total 100

Network Reliability Computation by using Different Binary Decision Diagrams

CSE 140: Logic Minimization Lecture

Transcription:

ECE 5775 (Fall 17) High-Level Digital Design Automation Binary Decision Diagrams Static Timing Analysis

Announcements Start early on Lab 1 (CORDIC design) Fixed-point design should not have usage of DSP48s Course survey Queson Unfamiliar Comfortable Experienced Digital design with Verilog or VHDL 15.79% 3 25.58% 11 30.77% 8 C/C++ programming 10.53% 2 20.93% 9 42.31% 11 Python programming 10.53% 2 32.56% 14 23.08% 6 Combinatorial opmizaon algorithms 63.16% 12 20.93% 9 3.85% 1 1

Review: Quantization for Fixed-Point Types Write down the value of y in decimal after the assignment for each of the following cases (1) ap_fixed<4, 2> x = -0.25; ap_fixed<3, 1, AP_TRN, AP_WRAP> y = x; (2) ap_fixed<4, 2> x = 0.25; ap_fixed<3, 3, AP_TRN> y = x; 2

Review: Graph Connectivity Paths A path is a any sequence of edges that connect two vertices A simple path never goes through any vertex more than once Connectivity A graph is connected if there is there is a path between any two vertices Any subgraph that is connected can be referred to as a connected component A directed graph is strongly connected if there is always a directed path between vertices 3

Trees and DAGs A cycle is a path starting and ending at the same vertex. A cycle in which no vertex is repeated other than the starting vertex is said to be a simple cycle An undirected graph with no cycles is a tree if it is connected, or a forest otherwise A directed tree is a directed graph which would be a tree if the directions on the edges were ignored A directed graph with no directed cycles is said to be a directed acyclic graph (DAG) 4

Examples Directed graphs with cycles Directed acyclic graph (DAG) a b c d f g a b c d f g e e Tree a b c d e f g h i j k 5

Topological Sort A topological sort (or order) of a directed graph is an ordering of nodes where all edges go from an earlier vertex (left) to a later vertex (right) Feasible if and only if the subject graph is a DAG a b a b d c c d 6

Agenda Graph algorithms applied to two EDA problems Binary decision diagrams Static timing analysis [source: Alberto Sangiovanni-Vincentelli s keynote at ICCAD 2012] 7

Example: Boolean Voting Function A Boolean voting function An n-ary Boolean function evaluates to 1 if 50% or more ( "# n / 2$% ) of its inputs are set to 1 Examples: f(0,0) = 0 f(0,1) = 1 f(0,0,1) = 0 f(1,0,1) = 1 How to formally represent this function? Truth table Karnaugh map Sum of Products (SOP) f (x 1, x 2,..., x n ) 8

Ideal Representation of a Boolean Function We hope to find a representation with the following characteristics Compact (in terms of size) Efficient to compute the output with the given inputs and efficient to manipulate and modify Ideally, a canonical representation A unique form for equivalent functions under certain conditions 9

Truth Table x y z f 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Truth table is canonical But 2 n table entries are required! Canonical SOP (4 minterms): xyz + xy z + xyz + x yz 10

Karnaugh Map and SOP z 0 xy 00 01 11 10 0 0 1 0 1 0 1 1 1 Minimized SOP (3 terms): xy + xz + yz Note: K-map only handles up to 6 inputs What about n inputs? (esp. where n is large) 11

Boolean Voting Function: Exponential Growth Rate of SOP An n-input voting function has at least C(n, n/2) prime implicants Growth rate of C(n, k) in terms of n For k=1, C(n,1) = n For k=2, C(n,2) = n(n-1)/2 For k=3, C(n,3) = n(n-1)(n-2)/6 n! For k=n/2, C(n, n/2) = (involves [(n / 2)!] 2 Θ(2n n 0.5 ) Stirling formula) 12

An Alternative: Binary Decision Diagrams One of the most cited papers in CS/CE One of the only really fundamental data structures that came out in the last twenty-five years Donald Knuth, 2008 13

Truth Table, Shannon Expansion, and Decision Tree x=0 x=1 x y z f 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 f = x' f x=0 + x f x=1 y=0 y=1 z y x 00010111 0001 0111 00 01 01 11 0 0 0 1 0 1 1 1 Nonterminal node in orange Follow dashed line for value 0 Follow solid line for value 1 Terminal (leaf) node in green Function value determined by leaf values 14

Reduction Rule #1 Merge equivalent leaves 1 1 1 00010111 00010111 0001 0111 0001 0111 00 01 01 11 00 01 01 11 0 0 0 1 0 1 1 1 0 1 15

Reduction Rule #2 Remove redundant tests For a node v, left(v) = right(v) 00010111 11 1 1 00010111 0001 0111 0001 0111 00 01 01 11 01 01 0 1 0 1 16

Reduction Rule #3 Merge isomorphic nodes 01 01 01 0 1 0 1 00010111 00010111 0001 0111 0001 0111 01 01 01 0 1 0 1 17

The Reduction Algorithm Recursively determine an identifier (id) for each node, starting from leaves; nodes with the same IDs are merged If id(left(v)) = id(right(v)), then id(v) = id(left(v)) If id(left(v)) = id(left(u)) and id(right(v)) = id(right(u)), then id(v) = id(u) 00010111 id=6 id=4 id=5 0001 0111 id=1 id=3 id=3 id=2 00 01 01 11 00010111 0001 0111 01 id=3 id=6 id=4 id=5 0 0 0 1 0 1 1 1 id=1 id=1 id=1 id=2 id=1 id=2 id=2 id=2 0 1 id=1 id=2 18

BDD Construction BDDs are usually directly constructed bottom up, avoiding the reduction step One approach is using a hash table called unique table, which contains the IDs of the Boolean functions whose BDDs have been constructed A new function is added if its associated ID is not already in the unique table 19

BDDs History Proposed by Lee 1959, Akers 1976 Idea of representing Boolean function as a rooted DAG with a decision at each vertex Popularized by Bryant 1986 Further restrictions + efficient algorithms to make a useful data structure (ROBDD) BDD = ROBDD since then 20

ROBDDs Reduced and Ordered (ROBDD) Directed acyclic graph (DAG) Two children per node Two terminals 0, 1 Ordered: Co-factoring variables (splitting variables) always follow the same order along all paths x 1 < x 2 < x 3 < < x n Reduced: Any node with two identical children is removed (rule #2) Two nodes with isomorphic BDDs are merged (rules #1 and #3) y x z y 0 1 3-input voting function in BDD form 21

More on Variable Ordering Follow a total ordering to variables e.g., x < y < z Variables must appear in the same ascending order along all paths x x y y z y z x 22

Canonical Representation ROBDD is a canonical representation of Boolean functions Given the same variable order, two functions equivalent if and only if they have the same BDD form 0 unique unsatisifable function 1 unique tautology 23

Compactness 8-input voting function in BDD with 20 nonterminal vertices In contrast to 70 prime implicants in SOP form Diagram generated by www.cs.uc.edu/~weaversa/bdd_visualizer.html 24

More Virtues of BDDs There are many, but to list a few more: Can represent an exponential number of paths with a DAG x Can evaluate an n-ary Boolean function in at most n steps By tracing paths to the 1 node, we can count or enumerate all solutions to equation f = 1 Every BDD node (not just root) represent some Boolean function in a canonical way A BDD can be multi-rooted representing multiple Boolean functions sharing subgraphs y y z 0 1 25

BDD Limitations NP-hard problem to construct the optimal order for a given BDD No efficient BDD exists for some functions regardless of the order f = ab+cd under two different variable orders a b c a c Existing heuristics work reasonably well on many combinational functions from real circuits Lots of research in ordering algorithms 0 c d a<b<c< d 1 Same function, two different orderings, different graphs 0 d b a<c<b< d 1 b 26

Static Timing Analysis In circuit graphs, static timing analysis (STA) refers to the problem of finding the delays from the input pins of the circuit (esp. nodes) to each gate In sequential circuits, flip-flop (FF) input acts as output pin, FF output acts as input pin Max delay of the output pins determines clock period Critical path is a path with max delay among all paths Two important terms Required time: The time that the data signal needs to arrive at certain endpoint on a path to ensure the timing is met Arrival time: The time that the data signal actually arrives at certain endpoint on a path 27

STA: Arrival Times Assumptions All inputs arrive at time 0 All gate delays = 1ns (di = 1); all wire delays = 0 Questions: Arrival time (AT) of each gate output? Minimum clock period? AT i = max j Îpred(i) {AT j } + d i 0 0 0 0 0 1 1 2 2 3 1 4 5 3 4 5 Gates are visited in a topological order 28

STA: Required Times Assumptions All inputs arrive at time 0 All gate delays = 1ns (di = 1); all wire delays = 0 Clock period = 5ns (200MHz frequency) Question: Required time (RT) of each gate output in order to meet the clock period? 0 0 0 3 3 1 1 2 2 3 4 RT i = min j Îsucc(i) {RT j d j } 4 5 5 5 5 Gates are visited in a reverse topological order 29

More on Static Timing Analysis In addition to the arrival time and required time of each node, we are interested in knowing the slack (= RT - AT) of each node / edge Negative slacks indicate unsatisfied timing constraints Positive slacks often present opportunities for additional (area/power) optimization Node on the critical path have zero slacks 30

STA: Slacks Assumptions: All inputs arrive at time 0 All gate delays = 1ns, wire delay = 0 Clock period = 5ns Question: What is the maximum slowdown of each gate without violating timing? Slack i = RT i AT i 0-0=0 0-0=0 1-1=0 2-2=0 3-3=0 5-3=2 4-4=0 5-4=1 1-1=0 0-0=0 2-2=0 5-5=0 5-5=0 3-0=3 3-0=3 4-1=3 31

Summary Graph algorithms are applicable to a wide range of EDA problems Neatly capture the circuit topology DAG is an important class of directed graph and will be used frequently in this class 32

Before Next Class Start early on CORDIC design! Next lecture: Front-end compilation and CDFG 33

Acknowledgements These slides contain/adapt materials from / developed by Prof. Randal Bryant (CMU) 34