ECE 667 - Synthesis & Verification - Lecture 0 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Boolean.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Advertisements

Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Boolean Functions and Circuits.
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Chapter 2 Logic Circuits.
CS357 Lecture: BDD basics David Dill 1. 2 BDDs (Boolean/binary decision diagrams) BDDs are a very successful representation for Boolean functions. A BDD.
ECE Synthesis & Verification 1 ECE 667 Synthesis and Verification of Digital Systems Formal Verification Combinational Equivalence Checking.
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
ECE Synthesis & Verification 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits Introduction to Logic Synthesis.
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?
ECE 667 Synthesis and Verification of Digital Systems
ECE 331 – Digital System Design
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
ECE Synthesis & Verification - Lecture 8 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Introduction.
Spring 07, Feb 13 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Binary Decision Diagrams Vishwani D. Agrawal James.
DATE-2002TED1 Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
ECE Synthesis & Verification - Lecture 18 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Word-level.
Boolean Functions and their Representations
A New Approach to Structural Analysis and Transformation of Networks Alan Mishchenko November 29, 1999.
ECE Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
ECE 667 Synthesis & Verification - BDD 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Binary Decision Diagrams (BDD)
 2000 M. CiesielskiPTL Synthesis1 Synthesis for Pass Transistor Logic Maciej Ciesielski Dept. of Electrical & Computer Engineering University of Massachusetts,
ECE 667 Synthesis and Verification of Digital Systems
CS150 Newton5.2.1 Outline mLast time: ÜImplementation of logic functions: TTL, CMOS ÜDelay models: Transition time, propagation delay ÜHazards and "Glitches"
IT University of Copenhagen Lecture 8: Binary Decision Diagrams 1. Classical Boolean expression representations 2. If-then-else Normal Form (INF) 3. Binary.
By Tariq Bashir Ahmad Taylor Expansion Diagrams (TED) Adapted from the paper M. Ciesielski, P. Kalla, Z. Zeng, B. Rouzeyre,”Taylor Expansion Diagrams:
Propositional Calculus Math Foundations of Computer Science.
Chapter 2: Boolean Algebra and Logic Functions
ECE Synthesis & Verification - Lecture 8 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Multi-level.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Binary Decision Diagrams (BDDs)
CS 267: Automated Verification Lecture 6: Binary Decision Diagrams Instructor: Tevfik Bultan.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
UM EECS 270 Spring 2011 – Taken from Dr.Karem Sakallah Logic Synthesis: From Specs to Circuits Implementation Styles –Random –Regular Optimization Criteria.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
Technology Mapping. 2 Technology mapping is the phase of logic synthesis when gates are selected from a technology library to implement the circuit. Technology.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Multi-Level Logic Synthesis.
BDDs1 Binary Tree Representation The recursive Shannon expansion corresponds to a binary tree Example: Each path from the root to a leaf corresponds to.
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect10: Two-level Logic Minimization.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
Lecture 3: Incompletely Specified Functions and K Maps
Chapter 2: Boolean Algebra and Logic Functions
Delay Optimization using SOP Balancing
ECE 331 – Digital System Design
Logic Synthesis CNF Satisfiability.
ECE 667 Synthesis and Verification of Digital Systems
Propositional Calculus: Boolean Algebra and Simplification
Lecture 3: Incompletely Specified Functions and K Maps
SAT-Based Area Recovery in Technology Mapping
NP-Completeness Proofs
Alan Mishchenko University of California, Berkeley
Binary Decision Diagrams
Chapter 2 Introduction to Logic Circuits
ECE 667 Synthesis and Verification of Digital Systems
Introduction to Logic Synthesis
A logic function f in n inputs x1, x2, ...xn and
Technology Mapping I based on tree covering
Delay Optimization using SOP Balancing
A logic function f in n inputs x1, x2, ...xn and
SAT-based Methods: Logic Synthesis and Technology Mapping
Lecture 3: Incompletely Specified Functions and K Maps
Presentation transcript:

ECE Synthesis & Verification - Lecture 0 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Boolean Functions and Circuits Slides adopted (with permission) from A. Kuehlmann, UC Berkeley 2003

module example(clk, a, b, c, d, f, g, h) input clk, a, b, c, d, e, f; output g, h; reg g, h; clk) begin g = a | b; if (d) begin if (c) h = a&~h; else h = b; if (f) g = c; else a^b; end else if (c) h = 1; else h ^b; end endmodule Specification d a b e f c 0 h g clk Logic Extraction Synthesis Flow a multi-stage process Technology-Independent Optimization f g0 h1 a c e g1 h3 h5 H G b d Technology-Dependent Mapping f d b e a c clk h H G g

ECE Synthesis & Verification - Lecture 0 4 What is Logic Synthesis? D XY Given:Finite-State Machine F(X,Y,Z,, ) where: X: Input alphabet Y: Output alphabet Z: Set of internal states : X x Z Z (next state function, Boolean) : X x Z Y (output function, Boolean) Target:Circuit C(G, W) where: G: set of circuit components  g {Boolean gates, flip-flops, etc} W: set of wires connecting G

ECE Synthesis & Verification - Lecture 0 5 The Boolean Space B n B = { 0,1}, B 2 = {0,1} X {0,1} = {00, 01, 10, 11} B0B0B0B0 B1B1B1B1 B2B2B2B2 Karnaugh Maps:Boolean Cubes: B3B3B3B3 B4B4B4B4

ECE Synthesis & Verification - Lecture 0 6 Boolean Functions x2x2 x1x1

ECE Synthesis & Verification - Lecture 0 7 Boolean Functions Literal x 1 represents the logic function f, where f = {x| x 1 = 1} Literal x 1 represents the logic function g where g = {x| x 1 = 0} x1x1 x3x3 x2x2 f = x 1 x1x1 x2x2 x3x3 Notation: x’ = x

ECE Synthesis & Verification - Lecture 0 8 Set of Boolean Functions There are 2 n vertices in input space B n There are 2 2 n distinct logic functions. – –Each subset of vertices is a distinct logic function: f  B n x 1 x 2 x  x1x1 x2x2 x3x3 Truth Table or Function Table :

ECE Synthesis & Verification - Lecture 0 9 Boolean Operations - AND, OR, COMPLEMENT Given two Boolean functions : f : B n  B g : B n  B The AND operation h = f  g is defined as h = {x | f(x)=1  g(x)=1} The OR operation h = f  g is defined as h = {x | f(x)=1  g(x)=1} The COMPLEMENT operation h = ^f (or f’ ) is defined as h = {x | f(x) = 0}

ECE Synthesis & Verification - Lecture 0 10 Cofactor and Quantification Given a Boolean function: f : B n  B, with the input variables (x 1,x 2,…,x i,…,x n ) The Positive Cofactor h = f xi is defined as h = {x | f(x 1,x 2,…,1,…,x n )=1} The Negative Cofactor h = f xi is defined as h = {x | f(x 1,x 2,…,0,…,x n )=1} The Existential Quantification of function h w.r.t variable x i, h =  x i f is: h = {x | f(x 1,x 2,…,0,…,x n )=1  f(x 1,x 2,…,1,…,x n )=1} The Universal Quantification of function h w.r.t variable x i, h =  x i f is: h = {x | f(x 1,x 2,…,0,…,x n )=1  f(x 1,x 2,…,1,…,x n )=1}

ECE Synthesis & Verification - Lecture 0 11 Representation of Boolean Functions We need representations for Boolean Functions for two reasons: – –to represent and manipulate the actual circuit we are “synthesizing” – –as mechanism to do efficient Boolean reasoning Forms to represent Boolean Functions – –Truth table – –List of cubes: Sum of Products, Disjunctive Normal Form (DNF) – –List of conjuncts: Product of Sums, Conjunctive Normal Form (CNF) – –Boolean formula – –Binary Decision Tree, Binary Decision Diagram – –Circuit (network of Boolean primitives) Canonicity – which forms are canonical?

ECE Synthesis & Verification - Lecture 0 12 Truth Table Truth table (Function Table):Truth table (Function Table): The truth table of a function f : B n  B is a tabulation of its values at each of the 2 n vertices of B n. (all mintems) Example: f = a’b’c’d + a’b’cd + a’bc’d + ab’c’d + ab’cd + abc’d + abcd’ + abcd (Notation for complement: a’ = a ) The truth table representation is - intractable for large n - canonical Canonical means that if two functions are the same, then the canonical representations of each are isomorphic (identical). abcd f

ECE Synthesis & Verification - Lecture 0 13 Boolean Formula A Boolean formula is defined as an expression with the following syntax: formula ::= ‘(‘ formula ‘)’ | |formula “+” formula(OR operator) |formula “  ” formula(AND operator) | ^ formula(complement) Example: f = (x 1  x 2 ) + (x 3 ) + ^^(x 4  (^x 1 )) typically the “  ” is omitted and the ‘(‘ and ‘^’ are simply reduced by priority, e.g. f = x 1 x 2 + x 3 + x 4 ^x 1

ECE Synthesis & Verification - Lecture 0 14 Cubes A cube is defined as the product (AND) of a set of literal functions (“conjunction” of literals). Example: C = x 1 x’ 2 x 3 represents the following function f = (x 1 =1)(x 2 =0)(x 3 =1) x1x1 x2x2 x3x3 c = x 1 x1x1 x2x2 x3x3 f = x 1 x 2 x1x1 x2x2 x3x3 f = x 1 x 2 x 3

ECE Synthesis & Verification - Lecture 0 15 Cubes If C  f, C a cube, then C is an implicant of f. If C  B n, and C has k literals, then |C| covers 2 n-k vertices. Example: C = xy  B 3 k = 2, n = 3 => |C| = 2 = C = {100, 101} In an n-dimensional Boolean space B n, an implicant with n literals is a minterm.

ECE Synthesis & Verification - Lecture 0 16 List of Cubes Sum of Products (SOP) A function can be represented by a sum of cubes (products): f = ab + ac + bc Since each cube is a product of literals, this is a “sum of products” (SOP) representation A SOP can be thought of as a set of cubes F F = {ab, ac, bc} A set of cubes that represents f is called a cover of f. F 1 ={ab, ac, bc} and F 2 ={abc, abc, abc, abc} are covers of f = ab + ac + bc.

ECE Synthesis & Verification - Lecture 0 17 Binary Decision Diagram (BDD) f = ab+a’c+a’bd 1 0 c a bb cc d 0 1 c+bd b root node c+d d Graph representation of a Boolean function - vertices represent decision nodes for variables - two children represent the two subfunctions f(x = 0) and f(x = 1) (cofactors) - restrictions on ordering and reduction rules can make a BDD representation canonical

ECE Synthesis & Verification - Lecture 0 18 Boolean Circuits (Networks) Used for two main purposes – –as representation for Boolean reasoning engine – –as target structure for logic implementation which gets restructured in a series of logic synthesis steps until result is acceptable Efficient representation for most Boolean problems we have in CAD – –memory complexity is same as the size of circuits we are actually building Close to input representation and output representation in logic synthesis

ECE Synthesis & Verification - Lecture 0 19 Definitions – fanin, fanout, support Definition: A Boolean circuit is a directed graph C(G,N) where G are the gates and N  G  G is the set of directed edges (nets) connecting the gates. Some of the vertices are designated: Inputs: I  G Outputs: O  G, I  O =  Each gate g is assigned a Boolean function f g which computes the output of the gate in terms of its inputs.

ECE Synthesis & Verification - Lecture 0 20 Definitions – fanin, fanout, support The fanin FI(g) of a gate g are all predecessor vertices of g: FI(g) = {g’ | (g’,g)  N} The fanout FO(g) of a gate g are all successor vertices of g: FO(g) = {g’ | (g,g’)  N} The cone CONE(g) of a gate g is the transitive fanin of g and g itself. The support SUPPORT(g) of a gate g are all inputs in its cone: SUPPORT(g) = CONE(g)  I

ECE Synthesis & Verification - Lecture 0 21 Example – Boolean network I O FI(6) = {2,4} FO(6) = {7,9} CONE(6) = {1,2,4,6} SUPPORT(6) = {1,2}

ECE Synthesis & Verification - Lecture 0 22 Circuit Function Circuit functions are defined recursively: If G is implemented using physical gates that have positive (bounded) delays for their evaluation, the computation of h g depends in general on those delays. Definition: A circuit C is called combinational if for each input assignment of C for t  the evaluation of h g for all outputs is independent of the internal state of C. Proposition: A circuit C is combinational if it is acyclic.

ECE Synthesis & Verification - Lecture 0 23 SAT and Tautology Tautology: – –Find an assignment to the inputs that evaluate a given vertex to “0”. SAT : – –Find an assignment to the inputs that evaluate a given vertex to “1”. – –Identical to Tautology on the inverted vertex SAT on circuits is identical to the justification part in ATPG – –First half of ATPG: justify a particular circuit vertex to “1” – –Second half of ATPG (propagate a potential change to an output) can be easily formulated as SAT (will be covered later) – –Basic SAT algorithms: – –branch and bound algorithm as seen before branching on the assignments of primary inputs only (Podem algorithm) branching on the assignments of all vertices (more efficient)

ECE Synthesis & Verification - Lecture 0 24 Circuit Representations For general circuit manipulation (e.g. synthesis): Vertices have an arbitrary number of inputs and outputs Vertices can represent any Boolean function stored in different ways, such as: – –other circuits (hierarchical representation) – –Truth tables or cube representation (e.g. SIS system) – –Boolean expressions read from a library description – –BDDs (e.g BDS system) Data structure allow very general mechanisms for insertion and deletion of vertices, pins (connections to vertices), and nets – –general but far too slow for Boolean reasoning

ECE Synthesis & Verification - Lecture 0 25 Circuit Representations For efficient Boolean reasoning (e.g. a SAT engine): Circuits are non-canonical – –computational effort is in the “checking part” of the reasoning engine (in contrast to BDDs) Vertices have fixed number of inputs (e.g. two) Vertex function is stored as label, well defined set of possible function labels (e.g. OR, AND,OR) on-the-fly compaction of circuit structure – –allows incremental, subsequent reasoning on multiple problems

ECE Synthesis & Verification - Lecture 0 26 Boolean Reasoning Engine Engine Interface: void INIT() void QUIT() Edge VAR() Edge AND(Edge p1, Edge p2) Edge NOT(Edge p1) Edge OR(Edge p1 Edge p2)... int SAT(Edge p1) Engine application : - traverse problem data structure and build Boolean problem using the interface - call SAT to make decision Engine Implementation:... External reference pointers attached to application data structures

ECE Synthesis & Verification - Lecture 0 27 Basic Approaches Boolean reasoning engines need:Boolean reasoning engines need: –a mechanism to build a data structure that represents the problem –a decision procedure to decide about SAT or UNSAT Fundamental trade-offFundamental trade-off –canonical data structure data structure uniquely represents functiondata structure uniquely represents function decision procedure is trivial (e.g., just pointer comparison)decision procedure is trivial (e.g., just pointer comparison) example: Reduced Ordered Binary Decision Diagramsexample: Reduced Ordered Binary Decision Diagrams Problem: Size of data structure is in general exponentialProblem: Size of data structure is in general exponential –non-canonical data structure systematic search for satisfying assignmentsystematic search for satisfying assignment size of data structure is linearsize of data structure is linear Problem: decision may take an exponential amount of timeProblem: decision may take an exponential amount of time

ECE Synthesis & Verification - Lecture 0 28 AND-INVERTER Circuits Base data structure uses two-input AND function for vertices and INVERTER attributes at the edges (individual bit) – –use De’Morgan’s law to convert OR operation etc. Hash table to identify and reuse structurally isomorphic circuits f g g f Means complement

ECE Synthesis & Verification - Lecture 0 29 Data Representation Vertex : – –pointers (integer indices) to left and right child and fanout vertices – –collision chain pointer – –other data Edge: – –pointer or index into array – –one bit to represent inversion Global hash table holds each vertex to identify isomorphic structures Garbage collection to regularly free un-referenced vertices

ECE Synthesis & Verification - Lecture 0 30 Data Representation 0456 left right next fanout 1345 … … … …. 0 1 hash value left pointer right pointer next in collision chain array of fanout pointers complement bits Constant One Vertex zero one Hash Table 0456 left right next fanout 0 0

ECE Synthesis & Verification - Lecture 0 31 Hash Table Algorithm HASH_LOOKUP(Edge p1, Edge p2) { index = HASH_FUNCTION(p1,p2) p = &hash_table[index] while(p != NULL) { if(p->left == p1 && p->right == p2) return p; p = p->next; } return NULL; } Tricks: - keep collision chain sorted by the address (or index) of p - that reduces the search through the list by 1/2 - use memory locations (or array indices) in topological order of circuit - that results in better cache performance

ECE Synthesis & Verification - Lecture 0 32 Basic Construction Operations Algorithm AND(Edge p1,Edge p2){ if(p1 == const1) return p2 if(p2 == const1) return p1 if(p1 == p2) return p1 if(p1 == ^p2) return const0 if(p1 == const0 || p2 == const0) return const0 if(RANK(p1) > RANK(p2)) SWAP(p1,p2) if((p = HASH_LOOKUP(p1,p2)) return p return CREATE_AND_VERTEX(p1,p2); }

ECE Synthesis & Verification - Lecture 0 33 Basic Construction Operations Algorithm OR(Edge p1,Edge p2){ return (NOT(AND(NOT(p1),NOT(p2)))) } Algorithm NOT(Edge p) { return TOOGLE_COMPLEMENT_BIT(p) }

ECE Synthesis & Verification - Lecture 0 34 Cofactor Operation Algorithm POSITIVE_COFACTOR(Edge p,Edge v){ if((c = GET_COFACTOR(p)) == NULL) { if(p == v) { if(IS_INVERTED(v)) return const0 else return const1 } left = POSITIVE_COFACTOR(p->left, v) right = POSITIVE_COFACTOR(p->right, v) if(IS_INVERTED(p)) return NOT(AND(left,right)) else return AND(left,right) SET_COFACTOR(p,c); } return c; } - similar algorithm for NEGATIVE_COFACTOR - existential and universal quantification build from AND, OR and COFACTORS Question: What is the complexity of the circuits resulting from quantification?