THE VERILOG? HARDWARE DESCRIPTION LANGUAGE

Similar documents
The Verilog Hardware Description Language, Fifth Edition

The Verilog Hardware Description Language

A Tutorial Introduction 1

The Verilog Hardware Description Language. Fifth Edition

The Verilog Hardware Description Language, Fifth Edition

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

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

ARCHITECTURE AND CAD FOR DEEP-SUBMICRON FPGAs

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

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

Contents. Appendix D Verilog Summary Page 1 of 16

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

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

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Online Verilog Resources

Verilog Essentials Simulation & Synthesis

THE DESIGNER S GUIDE TO VERILOG-AMS

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

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

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

MLR Institute of Technology

Gate level or structural modeling

Energy Efficient Microprocessor Design

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

Topological Structure and Analysis of Interconnection Networks

MULTIMEDIA DATABASE MANAGEMENT SYSTEMS

VERILOG. Deepjyoti Borah, Diwahar Jawahar

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

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

PERFORMANCE ANALYSIS OF REAL-TIME EMBEDDED SOFTWARE

Digital VLSI Design with Verilog

Digital VLSI Design with Verilog

Verilog Tutorial (Structure, Test)

This content has been downloaded from IOPscience. Please scroll down to see the full text.

Advanced Digital Design with the Verilog HDL

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

Modeling Concepts. Introduction

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

Fundamentals of Operating Systems. Fifth Edition

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

Introduction to Digital Design with Verilog HDL

Verilog HDL Introduction

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

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

Introduction to Verilog

Combinational Logic II

Course Topics - Outline

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

Verilog Design Entry, Synthesis, and Behavioral Simulation

The VHDL Handbook. David R. Coelho Vantage Analysis Systems, Inc. Kluwer Academic Publishers. KALA llrporation

101-1 Under-Graduate Project Digital IC Design Flow

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

WIRELESS ATM AND AD-HOC NETWORKS. Protocols and Architectures

Verilog Design Principles

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

Hardware Description Languages (HDLs) Verilog

Chapter 2 Basic Logic Circuits and VHDL Description

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

Computer Science Workbench. Editor: Tosiyasu L. Kunii

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

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers

Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING. Fifth Semester. Subject: VHDL Programming

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis

Digital System Test and Testable Design

UNIT V: SPECIFICATION USING VERILOG HDL

FSM-based Digital Design using Veriiog HDL

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

Verilog Module 1 Introduction and Combinational Logic

Design Using Verilog

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

MINING VERY LARGE DATABASES WITH PARALLEL PROCESSING

Verilog. Verilog for Synthesis

SPECC: SPECIFICATION LANGUAGE AND METHODOLOGY

register:a group of binary cells suitable for holding binary information flip-flops + gates

COMPONENT-ORIENTED PROGRAMMING

Guide to RISC Processors

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Java Quick Syntax Reference. Second Edition. Mikael Olsson

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

Verilog Design Principles

Programming with HDLs

EECS150 - Digital Design Lecture 7 - Computer Aided Design (CAD) - Part II (Logic Simulation) Finite State Machine Review

Scheduling in Distributed Computing Systems Analysis, Design & Models

Course Topics - Outline

Lecture 15: System Modeling and Verilog

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

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

DISSEMINATING SECURITY UPDATES AT INTERNET SCALE

CSE140L: Components and Design Techniques for Digital Systems Lab

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog

EEL 4783: HDL in Digital System Design

HW1 Modeling Concepts

Software Development for SAP R/3

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

Computer Architecture

Essential Series. Springer-Verlag London Ltd.

CSE140L: Components and Design

Transcription:

THE VERILOG? HARDWARE DESCRIPTION LANGUAGE

THE VERILOGf HARDWARE DESCRIPTION LANGUAGE by Donald E. Thomas Carnegie Mellon University and Philip R. Moorby Cadence Design Systems, Inc. SPRINGER SCIENCE+BUSINESS MEDIA, LLC

Library of Congress Cataloging-in-Publication Data Thomas, D.E. (Donald E.), 1951- The Verilog hardware description language / by Donald E. Thomas and Phillip R. Moorby. p. cm. Includes index. ISBN 978-1-4613-6784-0 ISBN 978-1-4615-3992-6 (ebook) DOI 10.1007/978-1-4615-3992-6 1. Verilog (Computer hardware description language) I. Moorby, Phillip R., 1953-. II. Title. TK7885.7.T48 1991 621.39'2~dc20 90-48370 CIP Verilog^ is a registered trade mark of Cadence Design Systems, Inc. Copyright 1991 by Springer Science+Business Media New York Originally published by Kluwer Academic Publishers in 1991 Softcover reprint of the hardcover 1st edition 1991 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, mechanical, photo-copying, recording, or otherwise, without the prior written permission of the publisher, Kluwer Academic Springer Science+Business Media, LLC. Printed on acid-free paper.

To Sandie and Teresa, and John and Holland, and Jill.

Table of Contents Preface... ]([[I Ackn.owledgements... X\T 1. Verilog A Tutorial Introduction... 1 1.1 Describing Digital Systems... 1 1.2 Getting Started... 2 1.2.1 A Structural Description... 2 1.2.2 Simulating the NAND Latch....4 1.3 Module Hierarchy... 7 1.3.1 The Counter... 8 1.3.2 Components of the Counter... 10 1.3.3 A Clock for the System... 11 1.3.4 Tying the Whole Circuit Together... 12 1.4 Behavioral Modeling... 14 1.4.1 A Behavioral Model of the m16 Counter....14 1.4.2 Mixing Structure and Behavior... 16 1.4.3 Assignment Statements... 21 1.4.4 Mixing Behavioral and Structural Descriptions... 22 1.5 Summary... 23 1.6 Exercises... 23 2. Behavioral Modeling Constructs... 25 2.1 Process Model... 25 2.2 If-Then-Else... 26 2.2.1 Where Does The ELSE Belong?... 31

VUl 2.2.2 The Conditional Operator... 32 2.3 Loops... 33 2.3.1 Four Basic Loop Statements... 33 2.3.2 Exiting Loops on Exceptional Conditions... 36 2.4 Multi-way branching... 37 2.4.1 If-Else-If... 37 2.4.2 Case... 38 2.4.3 Comparison of Case and If-Else-If... 4O 2.4.4 CaseZ and CaseX... 41 2.5 Functions and Tasks... 42 2.5.1 Tasks... 43 2.5.2 Functions... 45 2.5.3 A Structural View....47 2.6 Summary... 49 2.7 Exercises... 49 3. Concu.rrent Process Statements... 51 3.1 Concurrent Processes... 51 3.2 Events... 53 3.2.1 Event Control Statement... 53 3.2.2 Named Events... 55 3.2.3 An Example of Hierarchical Names... 58 3.3 The Wait Statement..... 58 3.3.1 A Complete Producer-Consumer Handshake... 60 3.3.2 Comparison of the Wait and While Statements... 64 3.3.3 Comparison of Wait and Event Control Statements... "... 65 3.4 Disabling Named Blocks... 65 3.5 Quasi-continuous assignment... 67 3.6 Sequential and Parallel Blocks... 69 3.7 Exercises... 70 4. Ingic!...evel Modelin.g... '7J 4.1 Introduction... 73 4.2 Logic Gates and Nets... 74 4.2.1 Modeling Using Primitive Logic Gates... 74 4.2.2 Four-Level Logic Values... 77 4.2.3 Nets... 78 4.2.4 Module Port Specifications... 81 4.3 Continuous Assignment... 82 4.3.1 Behavioral Modeling of Combinational Circuits... 83 4.3.2 Net and Continuous Assign Declarations... 85 4.4 Parameterized Definitions... 87 4.5 Logic Delay Modeling... 89

ix 4.5.1 A Gate Level Modeling Example... 89 4.5.2 Gate and Net Delays... 91 4.5.3 Minimum, Typical, and Maximum Delays... 93 4.6 Delay Paths Across a Module... 94 4.7 Summary... 96 4.8 Exercises... 96 5. Defining Gate Level Primitives... m 5.1 Combinational Primitives... 99 5.1.1 Basic Features of User-Defined Primitives... 99 5.1.2 Describing Combinational Logic Circuits... 101 5.2 Level- and Edge-Sensitive Sequential Primitives... 103 5.2.1 Level-Sensitive Primitives... 104 5.2.2 Edge-Sensitive Primitives... 104 5.3 Shorthand Notation... 105 5.4 Mixed Level- and Edge-Sensitive Primitives... 107 5.5 Summary... 110 5.6 Exercises... 110 6. S'Witch. ~ v Mod.eling e l... 113 6.1 A Dynamic MOS Shift Register Example... 113 6.2 Switch Level Modeling... 118 6.2.1 Strength Modeling... 118 6.2.2 Strength Definitions... 121 6.2.3 An Example Using Strengths... 123 6.2.4 Resistive MOS Gates... 124 6.3 Ambiguous Strengths... 126 6.3.1 Illustrations of Ambiguous Strengths... 127 6.3.2 The Underlying Calculations... 128 6.4 Summary... 133 6.5 Exercises... 133 7. ".lwo ~ Examples e... 135 7.1 The minisim Example... 135 7.1.1 Overview... 135 7.1.2 The minisim Source... 136 7.1.3 Simulation Results... 144 7.2 The 8251A Example... 146 7.2.1 Overview... 146 7.2.2 The 8251ASource... 146 7.3 Exercises... 168 Appendix A ~ x i Conventions c a l... l69

x A.1 White Space and Comments... 169 A.2 Operators... 169 A.3 Numbers... 170 A.4 Strings... 171 A.5 Identifiers, System Names, and Keywords... 172 Appendix B. Verilog Operators... 175 B.1 Table of Operators... 175 B.2 Operator Precedence... 179 B.3 Operator Truth Tables... 180 B.3.1 Bitwise AND... 180 B.3.2 Bitwise OR... 181 B.3.3 Bitwise XOR...,. 181 B.3.4 Bitwise XNOR... 181 B.4 Expression Bit Lengths... 182 Appendix C. Verilog Gate 'JYpes... 183 C.1 Logic Gates... 183 C.2 BUF and NOT Gates... 185 C.3 BUFIF and NOTIF Gates... 185 C.4 MOS Gates... 187 C.5 Bidirectional Gates... 188 C.6 CMOS Gates... l88 C.7 Pu11up and Pu11down Gates... 188 Appendix D. Registers, Memories, Integers, and Time.. 189 D.1 Registers... 189 D.2 Memories... 190 D.3 Integers and Times... 190 Appendix E. System Tasks and Functions... 193 E.1 Display and Write Tasks... 193 E.2 Continuous Monitoring... 194 E.3 Strobed Monitoring... 195 E.4 File Output... 195 E.5 Simulation Time... 196 E.6 Stop and Finish... 196 E.7 Random... 197 Appendix F. Formal Syntax Definition... 199 F.1 Source Text... 200 F.2 Declarations... 203

Xl F.3 Primitive Instances... 205 F.4 Module Instantiations... 206 F.5 Behavioral Statements... 207 F.6 Specify Section... 209 F.7 Expressions... 212 F.B General... 214 1 I l ( l ~ l C ~ 1 ~

Preface The Verilog language is a hardware description language which provides a means of specifying a digital system at a wide range of levels of abstraction. The language supports the early conceptual stages of design with its behavioral level of abstraction, and the later implementation stages with its structural level of abstraction. The language provides hierarchical constructs, allowing the designer to control the complexity of a description. Verilog was originally designed in the winter of 1983/84 as a proprietary verification/simulation product. Since then, several other proprietary analysis tools have been developed around the language, including a fault simulator and a timing analyzer; the language being instrumental in providing consistency across these tools. Now, the language is openly available for any tool to read and write. This book introduces the language. It is sometimes difficult to separate the language from the simulator tool because the dynamic aspects of the language are defined by the way the simulator works. Where possible, we have stayed away from simulator-specific details and concentrated on design specification, but have included enough information to be able to have working executable models. The book takes a tutorial approach to presenting the language. Indeed, we start with a tutorial introduction which presents, via examples, the major features of the language. We then continue with a more complete discussion of the language constructs. Numerous examples are provided to allow the reader to easily learn (and re-

XIV The Verilog Hardware Description Language learn!) by example. Finally, in the appendix we provide a formal description of the language. Overall, our approach is to provide a means of learning by observing the examples, and doing the exercises. We have provided a set of exercises to stimulate thought while reading the book. It is strongly recommended that you try the exercises as early as possible with the aid of the Verilog simulator. Or, if you have your own designs, or some from a data book, try them out too. The examples shown in the book are available in electronic form from Cadence Design Systems, Inc. by sending a request to receive the examples to the e-mail address.. thomasmoorbybook@cadence.com... The book assumes a knowledge of introductory logic design and software programming. As such, the book is of use to practicing integrated circuit design engineers, and undergraduate and graduate electrical or computer engineering students. The tutorial introduction provides enough information for students in an introductory logic design course to make simple use of logic simulation as part of their laboratory experience. The rest of the book could then be used in upper level logic design and architecture courses. The book is organized into seven chapters and six appendicies. We start with the tutorial introduction to the language in chapter 1. Chapters 2 and 3 present the language's behavioral modeling constructs. Chapters 4 and 5 then present logic level modeling, and chapter 6 presents the more advanced topic of switch level modeling. Finally, chapter 7 shows sizable examples of the use of the language. The appendicies are reserved for the dryer topics typically found in a language manual. Read them at your own risk. D. E. Thomas P. R. Moorby

Acknowledgements The authors would like to acknowledge the many people in Cadence Design Systems, Inc. and the customers of the Verilog-based products who have contributed to the continuing development of the Verilog language. In particular, the authors would like to thank Leigh Brady for her help in reviewing the manuscript.