332 437 Lecture 7 Verilog Hardware Description Language

  • Slides: 19
Download presentation
332: 437 Lecture 7 Verilog Hardware Description Language Basics n n n Motivation for

332: 437 Lecture 7 Verilog Hardware Description Language Basics n n n Motivation for Hardware Description Language Tool flow FPGA Design Methodology and Synthesis § Logic Synthesis Problems n Summary Material from The Verilog Hardware Description Language, by Thomas and Moorby, Kluwer Academic Publishers, VHDL for Programmable Logic, by Kevin Skahill, Addison Wesley Longman. 11/1/2020 Bushnell: Digital Systems Design Lecture 7 1

Motivation Now possible to automatically design hardware using a computer program (Synopsys design_analyzer) Translate

Motivation Now possible to automatically design hardware using a computer program (Synopsys design_analyzer) Translate high-level hardware description language (Verilog or VHDL) automatically into logic gates Massive saving of time for hardware design Widely used at all electronics companies Problem: Resulting hardware design is not always good Designer must check the design to determine its quality If unacceptable, redesign manually using K-maps and lower-level hardware synthesis tools Example: NJ company went out of business because they used a bad design created with VHDL Too many logic gates, too slow, too expensive 11/1/2020 Bushnell: Digital Systems Design Lecture 7 2

Synopsys System at Rutgers Industrial Cost: 50 licenses X $1 million / license =

Synopsys System at Rutgers Industrial Cost: 50 licenses X $1 million / license = $50 million University Cost: 3 X $5000 = $15000 Tools used in DSD: design_analyzer: Translates Verilog into logic gates vcs – Verilog behavioral and logic simulator Good check to make certain that design_analyzer correctly created the logic Many other tools are in the tool suite 11/1/2020 Bushnell: Digital Systems Design Lecture 7 3

Verilog Language Concurrent hardware description language Expresses parallelism in the hardware DO NOT code

Verilog Language Concurrent hardware description language Expresses parallelism in the hardware DO NOT code Verilog like a C or FORTRAN program Serializes the hardware operations Leads to a BIG increase in the amount of the hardware design_analyzer adds interlock logic gates to make sure that the hardware runs serially -- unnecessary 11/1/2020 Bushnell: Digital Systems Design Lecture 7 4

Choice of Hardware Description Language VHDL Used in all Dept. of Defense (Do. D)

Choice of Hardware Description Language VHDL Used in all Dept. of Defense (Do. D) military system designs Used throughout Europe, Japan, and IBM Has problems with type conversions between Boolean and arithmetic Verilog Preferred in the commercial electronics industry Best for converting data types between bit vector and arithmetic notations Best for configuring large designs produced by large design teams Best for describing low-level logic (more concise) Reality: Probably need to know both languages Impossible to say which is better – matter of taste 11/1/2020 Bushnell: Digital Systems Design Lecture 7 5

Shortcomings of Verilog or VHDL 1. You lose some control of defining the gate-level

Shortcomings of Verilog or VHDL 1. You lose some control of defining the gate-level circuit implementation You don’t have time to do that, anyway 2. Logic synthesized by the Verilog compiler is sometimes inefficient A real problem – Must learn to “explain” the design to the compiler in the “right” way to get maximum hardware parallelism, which leads to the best design 3. Quality of synthesis varies from tool to tool: Use Synopsys for high quality – used at Intel, IBM, Agere, everywhere – knowing this helps you get a job 11/1/2020 Bushnell: Digital Systems Design Lecture 7 6

Activities of Design at Levels of Design Synopsys Design Analyzer ARCHITECTURE & BEHAVIORAL REGISTER

Activities of Design at Levels of Design Synopsys Design Analyzer ARCHITECTURE & BEHAVIORAL REGISTER TRANSFER – Verilog/VHDL Cadence Verilog-XL LOGIC Synopsys Behavioral Simulation Synopsys Logic Sim. SWITCH LEVEL SPICE and CIRCUIT (TRANSISTORS) Cadence Spectre Cadence LAYOUT & TEST PATTERNS Layout. Plus FABRICATION LINE 11/1/2020 Bushnell: Digital Systems Design Lecture 7 7

Design Activities Implemented by complex Computer-Aided Design programs You must know how to parameterize

Design Activities Implemented by complex Computer-Aided Design programs You must know how to parameterize these correctly to get correct results Estimation – Estimate likely design parameters Synthesis – Translate design into lower level of representation Simulation – Mimic design behavior at level of representation to see if it is correct Analysis – Analyze design parameters at a level 11/1/2020 Bushnell: Digital Systems Design Lecture 7 8

Fitting and Routing Fitting – Fit logic produced by synthesis, place it onto a

Fitting and Routing Fitting – Fit logic produced by synthesis, place it onto a particular programmable logic device, transforming the logic as needed Place & Route – Place logic in a particular combinational Logic Block on an FPGA, such that the wiring delay between the block and others is acceptable Must place critical circuit portions together to minimize wiring delays Propagation delay of signals depends significantly on routing delay 11/1/2020 Bushnell: Digital Systems Design Lecture 7 9

Design Verification Can simulate the placed & routed device with fairly realistic logic gate

Design Verification Can simulate the placed & routed device with fairly realistic logic gate delays Use Synopsys Prime. Time static timing analyzer Simulation always essential to verify correct design behavior Can avoid making application-specific integrated circuits (ASICs), burning field-programmable gate arrays (FPGAs), or making full-custom chips that do not work Must simulate at both behavioral and logic levels Behavioral simulation finds logic errors Logic simulation verifies that Synopsys designed logic correctly 11/1/2020 Bushnell: Digital Systems Design Lecture 7 10

FPGA Modern Design Methodology always mumble blah gates, … Synthesis Synthesizable Verilog y og

FPGA Modern Design Methodology always mumble blah gates, … Synthesis Synthesizable Verilog y og l no ing h c pp e T Ma Place and Route LE 1 LE 2 Logic Elements in FPGA Chip 11/1/2020 Bushnell: Digital Systems Design Lecture 7 11

What’s a Logic Element (LE)? A mux selects which element of memory to send

What’s a Logic Element (LE)? A mux selects which element of memory to send to output Arbitrary programmable Boolean function of K inputs K=4 in our particular example. Usually see K=3, 4, 5 in real FPGAs It has a memory — you download to the memory to program the device You also program connections between these Logical Elements Synthesis tool partitions logic into groups of 5 -input functions 11/1/2020 Really just a 1 -bit memory Bushnell: Digital Systems Design Lecture 7 12

What Do We Mean by “Synthesis”? Logic synthesis A program that “designs” logic from

What Do We Mean by “Synthesis”? Logic synthesis A program that “designs” logic from abstract descriptions of the logic takes constraints (e. g. size, speed) uses a library (e. g. 3 -input gates) How? You write an “abstract” Verilog description of the logic The synthesis tool provides alternative implementations constraints Verilog blah synthesis or … library 11/1/2020 Bushnell: Digital Systems Design Lecture 7 13

An Example What’s cool? You type the left, synthesis gives you the gates It

An Example What’s cool? You type the left, synthesis gives you the gates It used a different library than you did. (2 -input gates only) One description suffices for a variety of alternate implementations! . . . but this assumes you know a gate level implementation — that’s not an “abstract” Verilog description. module gate (f, a, b, c); output f; input a, b, c; and A (a 1, a, b, c), B (a 2, a, ~b, ~c), C (a 3, ~a, o 1); or D (o 1, b, c), E (f, a 1, a 2, a 3); endmodule 11/1/2020 a b f c Bushnell: Digital Systems Design Lecture 7 14

What Do We Want Here…? Goal To specify a combination ckt, inputs->outputs… … in

What Do We Want Here…? Goal To specify a combination ckt, inputs->outputs… … in a form of Verilog that synthesis tools will correctly read … and then use to make the right logic And. . . We know the function we want, and can specify in C-like form. . . … but we don’t now the exact gates (nor logic elements); we want the tool to figure this out. A B Combinational Logic F C 11/1/2020 Bushnell: Digital Systems Design Lecture 7 15

Synthesis and Libraries Synopsys can synthesize hardware for the components in a wide variety

Synthesis and Libraries Synopsys can synthesize hardware for the components in a wide variety of libraries, as well as for complex programmable logic devices (CPLDs) and field-programmable gate arrays (FPGAs) 11/1/2020 Bushnell: Digital Systems Design Lecture 7 16

Problems with Automatic Logic Synthesis Verilog synthesis may frequently interpret code differently from Verilog

Problems with Automatic Logic Synthesis Verilog synthesis may frequently interpret code differently from Verilog simulation Unneeded Logic May Not Be Detected 11/1/2020 Both circuits are equivalent Bushnell: Digital Systems Design Lecture 7 17

Ease of Synthesis Depends on Description Form Easier to synthesize 11/1/2020 Bushnell: Digital Systems

Ease of Synthesis Depends on Description Form Easier to synthesize 11/1/2020 Bushnell: Digital Systems Design Lecture 7 18

Summary Motivation for Hardware Description Language FPGA Design Methodology and Synthesis Logic Synthesis Problems

Summary Motivation for Hardware Description Language FPGA Design Methodology and Synthesis Logic Synthesis Problems Tool flow 11/1/2020 Bushnell: Digital Systems Design Lecture 7 19