L05 – Synthesis 1 6.884 - Spring 2005 02/14/05 Synthesis: Verilog  Gates // 2:1 multiplexer or a or b) begin if (sel) z <= b; else z <= a;

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

Simulation executable (simv)
Combinational Logic.
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Logic Synthesis – 3 Optimization Ahmed Hemani Sources: Synopsys Documentation.
ECE 667 Synthesis and Verification of Digital Systems
ELEN 468 Lecture 151 ELEN 468 Advanced Logic Design Lecture 15 Synthesis of Language Construct I.
ECE Synthesis & Verification - Lecture 8 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Introduction.
Digital System Design by Verilog University of Maryland ENEE408C.
Technology Mapping.
EDA (CS286.5b) Day 2 Covering. Why covering now? Nice/simple cost model problem can be solved well (somewhat clever solution) general/powerful technique.
1 COMP541 State Machines Montek Singh Feb 6, 2007.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 16: March 23, 2009 Covering.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
ELEN 468 Advanced Logic Design
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
Overview Logistics Last lecture Today HW5 due today
1 VLSI CAD Flow: Logic Synthesis, Lecture 13 by Ajay Joshi (Slides by S. Devadas)
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Lecture 12 – Design Procedure.
ECE 2372 Modern Digital System Design
Synthesis Presented by: Ms. Sangeeta L. Mahaddalkar ME(Microelectronics) Sem II Subject: Subject:ASIC Design and FPGA.
Two-Level Simplification Approaches Algebraic Simplification: - algorithm/systematic procedure is not always possible - No method for knowing when the.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
Shantanu Dutt ECE Dept. UIC
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Introduction to State Machine
Module 1.2 Introduction to Verilog
UM EECS 270 Spring 2011 – Taken from Dr.Karem Sakallah Logic Synthesis: From Specs to Circuits Implementation Styles –Random –Regular Optimization Criteria.
2-1 Introduction Gate Logic: Two-Level Simplification Design Example: Two Bit Comparator Block Diagram and Truth Table A 4-Variable K-map for each of the.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
IMPLEMENTATION OF MIPS 64 WITH VERILOG HARDWARE DESIGN LANGUAGE BY PRAMOD MENON CET520 S’03.
ICS 252 Introduction to Computer Design Lecture 12 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.
Technology Mapping. 2 Technology mapping is the phase of logic synthesis when gates are selected from a technology library to implement the circuit. Technology.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
03/31/031 ECE 551: Digital System Design & Synthesis Lecture Set 8 8.1: Miscellaneous Synthesis (In separate file) 8.2: Sequential Synthesis.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 2: September 28, 2005 Covering.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
ASIC Design Methodology
ELEN 468 Advanced Logic Design
Physical Design - 1 Arvind
Hardware Description Languages: Verilog
Behavioral Modeling in Verilog
Combinatorial Logic Design Practices
Chapter 3 – Combinational Logic Design
332:437 Lecture 8 Verilog and Finite State Machines
Sungho Kang Yonsei University
VLSI CAD Flow: Logic Synthesis, Placement and Routing Lecture 5
332:437 Lecture 8 Verilog and Finite State Machines
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

L05 – Synthesis Spring /14/05 Synthesis: Verilog  Gates // 2:1 multiplexer or a or b) begin if (sel) z <= b; else z <= a; end Instruction Memory A D 0 1 mux A B Library Gate

L05 – Synthesis Spring /14/05 Some History... In late 70’s Mead-Covway showed how to lay out transistors systematically to build logic circuits. Tools: Layout editors, for manual design; Design rule checkers, to check for legal layout configurations; Transistor-level simulators; Software generators to create dense transistor layouts; 1980 : Circuits had 100K transistors In 80’s designers moved to the use of gate arrays and standardized cells, pre-characterized modules of circuits, to increase productivity. Tools: To automatically place and route a netlist of cells from a predefined cell library The emphasis in design shifted to gate-level schematic entry and simulation

L05 – Synthesis Spring /14/05 History continued... By late 80’s designers found it very tedious to move a gate-level design from one library to another because libraries could be very different and each required its own optimizations. Tools: Logic Synthesis tools to go from Gate netlists to a standard cell netlist for a given cell library. Powerful optimizations! Simulation tools for gate netlists, RTL; Design and tools for testability, equivalance checking,... IBM and other companies had internal tools that emphasized top down design methodology based on logic synthesis. Two groups of designers came together in 90’s: Those who wanted to quickly simulate their designs expressed in some HDL and those who wanted to map a gate-level design in a variety of standard cell libraries in an optimized manner.

L05 – Synthesis Spring /14/05 Synthesis Tools Idea: once a behavioral model has been finished why not use it to automatically synthesize a logic implementation in much the same way as a compiler generates executable code from a source program? a.k.a. “silicon compilers” 1 infer logic and state elements 2 perform technology-independent optimizations (e.g., logic simplification, state assignment) 3 map elements to the target technology 4 perform technology-dependent optimizations (e.g., multi-level logic optimization, choose gate strengths to achieve speed goals) Synthesis programs process the HDL then

L05 – Synthesis Spring /14/05 Simulation vs Synthesis In a HDL like Verilog or VHDL not every thing that can be simulated can be synthesized. There is a difference between simulation and synthesis semantics. Simulation semantics are based on sequential execution of the program with some notion of concurrent synchronous processes. Not all such programs can be synthesized. It is not easy to specify the synthesizable subset of an HDL 1 infer logic and state elements 2 perform technology-independent optimizations (e.g., logic simplification, state assignment) 3 map elements to the target technology 4 perform technology-dependent optimizations (e.g., multi-level logic optimization, choose gate strengths to achieve speed goals) So in today’s lecture we will gloss over 1, briefly discuss 2 and emphasize 3 and 4.

L05 – Synthesis Spring /14/05 Logic Synthesis assign z = (a & b) | c; a b c a b c z z 1 0 b a sel z b a z // dataflow assign z = sel ? a : b;

L05 – Synthesis Spring /14/05 Logic Synthesis (II) full adder y[0]x[0] sum[0] 0 full adder y[1]x[1] full adder y[2]x[2] full adder y[3]x[3] sum[1] sum[2] sum[3] cout wire [3:0] x,y,sum; wire cout; assign {cout,sum} = x + y; As a default + is implemented as a ripple carry editor

L05 – Synthesis Spring /14/05 Logic Synthesis (III) word[1] word[0] word[2] word[3] parity module parity(in,p); parameter WIDTH = 2; // default width is 2 input [WIDTH-1 : 0] in; output p; // simple approach: assign p = ^in; // here's another, more general approach reg p; begin: loop integer i; reg parity = 0; for (i = 0; i < WIDTH; i = i + 1) parity = parity ^ in[i]; p <= parity; end endmodule … wire [3:0] word; wire parity; parity #(4) ecc(word,parity); // specify WIDTH = 4 XOR with “0” input has been optimized away…

L05 – Synthesis Spring /14/05 Synthesis of Sequential Logic reg q; // D-latch or d) begin if (g) q <= d; end DQ d q g reg q; // this time we mean it! // D-register clk) begin q <= d; end DQ d q clk G If q were simply a combinational function of d, the synthesizer could just create the appropriate combinational logic. But since there are times when the always block executes but q isn’t assigned (e.g., when g = 0), the synthesizer has to arrange to remember the value of “old” value q even if d is changing  it will infer the need for a storage element (latch, register, …). Sometimes this inference happens even when you don’t mean it to – you have to be careful to always ensure an assignment happens each time through the block if you don’t want storage elements to appear in your design.

L05 – Synthesis Spring /14/05 Sequential Logic (II) reg q; // register with asynchronous clear clk or negedge reset) begin if (!reset) // reset is active low q <= 0; else // implicit posedge clk q <= d; end // warning! async inputs are dangerous! // there’s a race between them and the // rising edge of clk. DQ d q clk reset reg q; // register with synchronous clear clk) begin if (!reset) // reset is active low q <= 0; else q <= d; end DQ d q clk reset

L05 – Synthesis Spring /14/05 Technology-independent* optimizations Two-level boolean minimization: based on the assumption that reducing the number of product terms in an equation and reducing the size of each product term will result in a smaller/faster implementation. Optimizing finite state machines: look for equivalent FSMs (i.e., FSMs that produce the same outputs given the same sequence of inputs) that have fewer states. Choosing FSM state encodings that minimize implementation area (= size of state storage + size of logic to implement next state and output functions). * None of these operations is completely isolated from the target technology. But experience has shown that it’s advantageous to reduce the size of the problem as much as possible before starting the technology-dependent optimizations. In some places (e.g. the ratio of the size of storage elements to the size logic gates) our assumptions will be valid for several generations of the technology.

L05 – Synthesis Spring /14/05 Two-Level Boolean Minimization Two-level representation for a multiple-output Boolean function: - Sum-of-products Optimization criteria: - number of product terms - number of literals - a combination of both Minimization steps for a given function: 1.Generate the set of prime product-terms for the function 2.Select a minimum set of prime terms to cover the function. State-of-the-art logic minimization algorithms are all based onthe Quine-McCluskey method and follow the above two steps.

L05 – Synthesis Spring /14/05 Prime Term Generation Express your Boolean function using 0-terms (product terms with no don’t care care entries). Include only those entries where the output of the function is 1 (label each entry with it’s decimal equivalent). W X Y Z label Look for pairs of 0-terms that differ in only one bit position and merge them in a 1-term (i.e., a term that has exactly one ‘–’ entry). 8, 9,10, ,11,14, terms: 3-terms: none! Label unmerged terms: these terms are prime! 0, , , , , , , , , , [A] [B] [C] [D] [E] Example due to Srini Devadas Next 1-terms are examined in pairs to see if the can be merged into 2-terms, etc. Mark k-terms that get merged into (k+1) terms so we can discard them later. 1-terms: 0-terms:

L05 – Synthesis Spring /14/05 Prime Term Table An “X” in the prime term table in row R and column C signifies that the 0-term corresponding to row R is contained by the prime corresponding to column C. A B C D E 0000 X X X X X.. X X X X X X X X. X Each row with a single X signifies an essential prime term since any prime implementation will have to include that prime term because the corresponding 0-term is not contained in any other prime. A is essential B is essential D is essential E is essential In this example the essential primes “cover” all the 0-terms. Goal: select the minimum set of primes (columns) such that there is at least one “X” in every row. This is the classical minimum covering problem.

L05 – Synthesis Spring /14/05 Dominated Columns 1. Prime table 2. Table with A selected 3. Table with B & H removed A B C D E F G H B C D E F G H C D E F G 0000 X X 0101 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X... C dominates B, G dominates H C dominates B, G dominates H C is essential G is essential Selecting C and G shows that only E is needed to complete the cover Some functions may not have essential primes (Fig. 1), so make arbitrary selection of first prime in cover, say A (Fig. 2). A column U of a prime term table dominates V if U contains every row contained in V. Delete the dominated columns (Fig. 3). This gives a prime cover of {A, C, E, G}. Now backtrack to our choice of A and explore a different (arbitrary) first choice; repeat, remembering minimum cover found during search.

L05 – Synthesis Spring /14/05 The Quine-McCluskey Method The input to the procedure is the prime term table T. 1. Delete the dominated primes (columns) in T. Detect essential primes in T by checking to see if any 0-term is contained by a single prime. Add these essential primes to the selected set. Repeat until no new essential primes are detected. 2. If the size of the selected set of primes equals or exceeds the best solution thus far return from this level of recursion. If there are no elements left to be contained, declare the selected set as the best solution recorded thus far. 3. Heuristically select a prime. 4. Add the chosen prime to the selected set and create a new table by deleting the prime and all 0- terms that are contained by this prime in the original table. Set T to this new table and go to Step 1. Then, create a new table by deleting the chosen prime from the original table without adding it to the selected set. No 0-terms are deleted from the original table. Set T to new table and go to Step 1. The good news: this technique generalizes to multi-output functions (see the QM handout on the website for details). The bad news: the search time grows as 2^(2^N) where N is the number of inputs. So most modern minimization systems use heuristics to make dramatic reductions in the processing time.

L05 – Synthesis Spring /14/05 Mapping to target technology Once we’ve minimized the logic equations, the next step is mapping each equation to the gates in our target gate library. Popular approach: DAG covering (K. Keutzer)

L05 – Synthesis Spring /14/05 Mapping Example Example due to Kurt Keutzer Problem statement: find an “optimal” mapping of this circuit: Into this library:

L05 – Synthesis Spring /14/05 DAG Covering Represent input netlist in normal form (“subject DAG”). Represent each library gate in normal form (“primitive DAGs”). Goal: find a minimum cost covering of the subject DAG by the primitive DAGs. If the subject and primitive DAGs are trees, there is an efficient algorithm (dynamic programming) for finding the optimum cover. So: partition subject DAG into a forest of trees (each gate with fanout > 1 becomes root of a new tree), generate optimal solutions for each tree, stitch solutions together. 2-input NAND gates + inverters

L05 – Synthesis Spring /14/05 Primitive DAGs for library gates

L05 – Synthesis Spring /14/05 Possible Covers Hmmm. Seems promising but is there a systematic and efficient way to arrive at the optimal answer?

L05 – Synthesis Spring /14/05 Use dynamic programming! Principle of optimality: Optimal cover for a tree consists of a best match at the root of the tree plus the optimal cover for the sub-trees starting at each input of the match. Best cover for this match uses best covers for P & Z X Y Z Best cover for this match uses best covers for P, X & Y P Complexity: To determine the optimal cover for a tree we only need to consider a best-cost match at the root of the tree (constant time in the number of matched cells), plus the optimal cover for the subtrees starting at each input to the match (constant time in the fanin of each match)  O(N) Complexity: To determine the optimal cover for a tree we only need to consider a best-cost match at the root of the tree (constant time in the number of matched cells), plus the optimal cover for the subtrees starting at each input to the match (constant time in the fanin of each match)  O(N)

L05 – Synthesis Spring /14/05 Optimal tree covering example

L05 – Synthesis Spring /14/05 Example (II)

L05 – Synthesis Spring /14/05 Example (III) Yes Regis, this is our final answer. This matches our earlier intuitive cover, but accomplished systematically. Refinements: timing optimization incorporating load-dependent delays, optimization for low power.

L05 – Synthesis Spring /14/05 Technology-dependent optimizations Additional library components: more complex cells may be slower but will reduce area for logic off the critical path. Load buffering: adding buffers/inverters to improve load- induced delays along the critical path Resizing: Resize transistors in gates along critical path Retiming: change placement of latches/registers to minimize overall cycle time Increase routability over/through cells: reduce routing congestion. Logic SynthesisPlace & route Verilog Gate netlist Mask HDL  logic map to target library optimize speed, area create floorplan blocks place cells in block route interconnect optimize (iterate!) You are here!