The Verilog Hardware Description Language

Similar documents
A Tutorial Introduction 1

The Verilog Hardware Description Language, Fifth Edition

The Verilog Hardware Description Language. Fifth Edition

THE VERILOG? HARDWARE DESCRIPTION LANGUAGE

The Verilog Hardware Description Language, Fifth Edition

Verilog HDL. A Guide to Digital Design and Synthesis. Samir Palnitkar. SunSoft Press A Prentice Hall Title

VERILOG QUICKSTART. Second Edition. A Practical Guide to Simulation and Synthesis in Verilog

Digital VLSI Design with Verilog

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Verilog Essentials Simulation & Synthesis

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

Synthesizable Verilog

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

MLR Institute of Technology

FSM-based Digital Design using Veriiog HDL

Online Verilog Resources

VERILOG QUICKSTART. James M. Lee Cadence Design Systems, Inc. SPRINGER SCIENCE+BUSINESS MEDIA, LLC

Verilog Tutorial (Structure, Test)

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis

Schematic design. Gate level design. 0 EDA (Electronic Design Assistance) 0 Classical design. 0 Computer based language

Contents. Appendix D Verilog Summary Page 1 of 16

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

CSE140L: Components and Design Techniques for Digital Systems Lab

CSE140L: Components and Design

Programmable Logic Devices Verilog VII CMPE 415

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

EECS 427 Lecture 14: Verilog HDL Reading: Many handouts/references. EECS 427 W07 Lecture 14 1

Digital System Design with SystemVerilog

EEL 4783: HDL in Digital System Design

Verilog. Like VHDL, Verilog HDL is like a programming language but:

Verilog Tutorial. Verilog Fundamentals. Originally designers used manual translation + bread boards for verification

Verilog Tutorial 9/28/2015. Verilog Fundamentals. Originally designers used manual translation + bread boards for verification

Verilog HDL Introduction

Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

SystemVerilog For Design Second Edition

Course Topics - Outline

Introduction to Verilog design. Design flow (from the book) Hierarchical Design. Lecture 2

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Introduction to Digital Design with Verilog HDL

Introduction to Verilog design. Design flow (from the book)

VERILOG. Deepjyoti Borah, Diwahar Jawahar

Behavioral Modeling and Timing Constraints

CSE241 VLSI Digital Circuits Winter Recitation 1: RTL Coding in Verilog

Quick Introduction to SystemVerilog: Sequental Logic

Verilog for High Performance

Why Should I Learn This Language? VLSI HDL. Verilog-2

430 Index. D flip-flop, from nands, 189, 191, 192 D flip-flop, verilog, 37

RIZALAFANDE CHE ISMAIL TKT. 3, BLOK A, PPK MIKRO-e KOMPLEKS PENGAJIAN KUKUM. SYNTHESIS OF COMBINATIONAL LOGIC (Chapter 8)

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Lecture 15: System Modeling and Verilog

P-1/P-105. Samir Palnitkar. Prentice-Hall, Inc. INSTRUCTOR : CHING-LUNG SU.

Hardware Description Languages (HDLs) Verilog

Modeling Concepts. Introduction

ECEN 468 Advanced Logic Design

Sunburst Design - Verilog-2001 Design & Best Coding Practices by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Nikhil Gupta. FPGA Challenge Takneek 2012

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

CAD for VLSI Design - I. Lecture 21 V. Kamakoti and Shankar Balachandran

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

UNIT V: SPECIFICATION USING VERILOG HDL

EITF35: Introduction to Structured VLSI Design

Verilog for Synthesis Ing. Pullini Antonio

Synthesis of Combinational and Sequential Circuits with Verilog

Behavioral Modeling and Timing Constraints

Register Transfer Level in Verilog: Part I

Advanced Digital Design with the Verilog HDL

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

Digital Integrated Circuits

VHDL for Synthesis. Course Description. Course Duration. Goals

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2

ECE 551: Digital System *

Chap 6 Introduction to HDL (d)

IT T35 Digital system desigm y - ii /s - iii

Course Topics - Outline

HIERARCHICAL DESIGN. RTL Hardware Design by P. Chu. Chapter 13 1

Outline HIERARCHICAL DESIGN. 1. Introduction. Benefits of hierarchical design

A Brief Introduction to Verilog Hardware Definition Language (HDL)

N-input EX-NOR gate. N-output inverter. N-input NOR gate

Programming with HDLs

V1 - VHDL Language. FPGA Programming with VHDL and Simulation (through the training Xilinx, Lattice or Actel FPGA are targeted) Objectives

RTL HARDWARE DESIGN USING VHDL. Coding for Efficiency, Portability, and Scalability. PONG P. CHU Cleveland State University

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Verilog HDL. Testing & Verification Dept. of Computer Science & Engg,, IIT Kharagpur

THE DESIGNER'S GUIDE TO VERILOG-AMS First Edition June 2004

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Introduction to Verilog

Problem Set 3 Solutions

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Control in Digital Systems

Verilog Design Entry, Synthesis, and Behavioral Simulation

Transcription:

Donald Thomas Philip Moorby The Verilog Hardware Description Language Fifth Edition 4y Spri nnger

Preface From the Old to the New Acknowledgments xv xvii xxi 1 Verilog A Tutorial Introduction Getting Started 2 A Structural Description 2 Simulating the binarytoeseg Driver 4 Creating Ports For the Module 7 Creating a Testbench For a Module 8 Behavioral Modeling of Combinational Circuits 11 Procedural Models 12 Rules for Synthesizing Combinational Circuits 13 Procedural Modeling of Clocked Sequential Circuits 14 Modeling Finite State Machines 15 Rules for Synthesizing Sequential Systems 18 Non-Blocking Assignment ("<=") 19 Module Hierarchy 21 The Counter 21 A Clock for the System 21 Tying the Whole Circuit Together 22 Tying Behavioral and Structural Models Together 25 Summary 27 Exercises 28 2 Logic Synthesis 35 Overview of Synthesis 35 Register-Transfer Level Systems 35 Disclaimer 36 Combinational Logic Using Gates and Continuous Assign 37 Procedural Statements to Specify Combinational Logic 40 The Basics 40

viii The Verilog Hardware Description Language Complications Inferred Latches 42 Using Case Statements 43 Specifying Don't Care Situations 44 Procedural Loop Constructs 46 Inferring Sequential Elements 48 Latch Inferences 48 Flip Flop Inferences 50 Summary 52 Inferring Tri-State Devices 52 Describing Finite State Machines 53 An Example of a Finite State Machine 53 An Alternate Approach to FSM Specification 56 Finite State Machine and Datapath 58 A Simple Computation 58 A Datapath For Our System 58 Details of the Functional Datapath Modules 60 Wiring the Datapath Together 61 Specifying the FSM 63 Summary on Logic Synthesis 66 Exercises 68 3 Behavioral Modeling 73 Process Model 73 If Then Else 75 Where Does The ELSE Belong? 80 The Conditional Operator 81 Loops 82 Four Basic Loop Statements 82 Exiting Loops on Exceptional Conditions 85 Multi-way Branching 86 If-Else-If 86 Case 86 Comparison of Case and If-Else-If 89 Casez and Casex. 90 Functions and Tasks 91 Tasks 93 Functions 97 A Structural View 100 Rules of Scope and Hierarchical Names 102 Rules of Scope 102 Hierarchical Names 105

Summary 106 Exercises 106 4 Concurrent Processes 109 Concurrent Processes 109 Events 111 Event Control Statement 112 Named Events 113 The Wait Statement 116 A Complete Producer-Consumer Handshake 117 Comparison of the Wait and While Statements 120 Comparison of Wait and Event Control Statements 121 A Concurrent Process Example 122 A Simple Pipelined Processor 128 The Basic Processor 128 Synchronization Between Pipestages 130 Disabling Named Blocks 132 Intra-Assignment Control and Timing Events 134 Procedural Continuous Assignment 136 Sequential and Parallel Blocks 138 Exercises 140 5 Module Hierarchy 143 Module Instantiation and Port Specifications 143 Parameters 146 Arrays of Instances 150 Generate Blocks 151 Exercises 154

The Verilog Hardware Description Language 6 Logic Level Modeling T 57 Introduction 157 Logic Gates and Nets 158 Modeling Using Primitive Logic Gates 159 Four-Level Logic Values 162 Nets 163 A Logic Level Example 166 Continuous Assignment 171 Behavioral Modeling of Combinational Circuits 172 Net and Continuous Assign Declarations 174 A Mixed Behavioral/Structural Example 176 Logic Delay Modeling 180 A Gate Level Modeling Example 181 Gate and Net Delays 182 Specifying Time Units 185 Minimum, Typical, and Maximum Delays 186 Delay Paths Across a Module 187 Summary of Assignment Statements 189 Summary 190 Exercises 191 7 Cycle-Accurate Specification 195 Cycle-Accurate Behavioral Descriptions 195 Specification Approach 195 A Few Notes 197 Cycle-Accurate Specification 198 Inputs and Outputs of an Always Block 198 Input/Output Relationships of an Always Block 199 Specifying the Reset Function 202 Mealy/Moore Machine Specifications 203 A Complex Control Specification 204 Data and Control Path Trade-offs 204 Introduction to Behavioral Synthesis 209 Summary 210

8 Advanced Timing 2T1 Verflog Timing Models 211 Basic Model of a Simulator 214 Gate Level Simulation 215 Towards a More General Model 215 Scheduling Behavioral Models 218 Non-Deterministic Behavior of the Simulation Algorithm 220 Near a Black Hole 221 It's a Concurrent Language 223 Non-Blocking Procedural Assignments 226 Contrasting Blocking and Non-Blocking Assignments 226 Prevalent Usage of the Non-Blocking Assignment 227 Extending the Event-Driven Scheduling Algorithm 228 Illustrating Non-Blocking Assignments 231 Summary 233 Exercises 234 9 User-Defined Primitives 239 Combinational Primitives 240 Basic Features of User-Defined Primitives 240 Describing Combinational Logic Circuits 242 Sequential Primitives 243 Level-Sensitive Primitives 244 Edge-Sensitive Primitives 244 Shorthand Notation 246 Mixed Level- and Edge-Sensitive Primitives 246 Summary 249 Exercises 249

xii The Verilog Hardware Description Language 10 Switch Level Modeling 251 A Dynamic MOS Shift Register Example 251 Switch Level Modeling 256 Strength Modeling 256 Strength Definitions 259 An Example Using Strengths 260 Resistive MOS Gates 262 Ambiguous Strengths 263 Illustrations of Ambiguous Strengths 264 The Underlying Calculations 265 The minisim Example 270 Overview 270 The minisim Source 271 Simulation Results 280 Summary 281 Exercises 281 11 Projects 283 Modeling Power Dissipation 283 Modeling Power Dissipation 284 What to do 284 Steps 285 A Floppy Disk Controller 286 Introduction 286 Disk Format 287 Function Descriptions 288 Reality Sets In... 291 Everything You Always Wanted to Know about CRC's 291 Supporting Verilog Modules 292 Appendix A: Tutorial Questions and Discussion 293 Structural Descriptions 293 Testbench Modules 303 Combinational Circuits Using always 303

Sequential Circuits 305 Hierarchical Descriptions 308 Appendix B: Lexical Conventions 309 White Space and Comments 309 Operators 310 Numbers 310 Strings 311 Identifiers, System Names, and Keywords 312 Appendix C: Verilog Operators 315 Table of Operators 315 Operator Precedence 320 Operator Truth Tables 321 Expression Bit Lengths 322 Appendix D: Verilog Gate Types 323 Logic Gates 323 BUF and NOT Gates 325 BUFIF and NOTIF Gates 326 MOS Gates 327 Bidirectional Gates 328 CMOS Gates 328 Pullup and Pulldown Gates 328 Appendix E: Registers, Memories, Integers, and Time 329 Registers 329 Memories 330 Integers and Times 331 Appendix F: System Tasks and Functions 333 Display and Write Tasks 333 Continuous Monitoring 334 Strobed Monitoring 335 File Output 335 Simulation Time 336 Stop and Finish 336 Random 336 Reading Data From Disk Files 337 Appendix G: Formal Syntax Definition 339 Tutorial Guide to Formal Syntax Specification 339

xiv The Verilog Hardware Description Language Source text 343 Declarations 346 Primitive instances 351 Module and generated instantiation 353 UDP declaration and instantiation 355 Behavioral statements 355 Specify section 359 Expressions 365 General 370 Index 373