What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Similar documents
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

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

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

The Verilog Hardware Description Language

Introduction to Verilog HDL. Verilog 1

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

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

ECEN 468 Advanced Digital System Design

Synthesizable Verilog

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

Tutorial on Verilog HDL

Verilog Tutorial (Structure, Test)

101-1 Under-Graduate Project Digital IC Design Flow

VLSI Design 13. Introduction to Verilog

Synthesis of Combinational and Sequential Circuits with Verilog

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

Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL. Variables and Logic Value Set. Data Types. Why use an HDL?

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Design Using Verilog

EECS150 - Digital Design Lecture 10 Logic Synthesis

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

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

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

EECS150 - Digital Design Lecture 10 Logic Synthesis

Don t expect to be able to write and debug your code during the lab session.

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Verilog Hardware Description Language ROOM: B405

CSE140L: Components and Design Techniques for Digital Systems Lab

Digital Design with FPGAs. By Neeraj Kulkarni

C-Based Hardware Design

CSE140L: Components and Design

14. Introducton to Verilog

EEL 4783: HDL in Digital System Design

CMSC 611: Advanced Computer Architecture

Lecture 15: System Modeling and Verilog

14. Introducton to Verilog

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

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

Online Verilog Resources

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

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

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

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

Introduction to Verilog

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

Hardware Synthesis. References

Graphics: Alexandra Nolte, Gesine Marwedel, Universität Dortmund. RTL Synthesis

ECE U530 Digital Hardware Synthesis. Programming Assignments

Concepts of Digital Design Introduction to Verilog

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

VERILOG HDL. (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Chapter 2 Using Hardware Description Language Verilog. Overview

Lecture 1: Introduction Course arrangements Recap of basic digital design concepts EDA tool demonstration

Verilog 1 - Fundamentals

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

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

Verilog For Computer Design

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Hardware Description Language VHDL (1) Introduction

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

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Lecture #2: Verilog HDL

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

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

DIGITAL SYSTEM DESIGN

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

VHDL. Chapter 1 Introduction to VHDL. Course Objectives Affected. Outline

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Department of Computer Science and Electrical Engineering. Intro to Verilog II

Hardware Description Languages: Verilog

Hardware description languages

ECE 4514 Digital Design II. Spring Lecture 2: Hierarchical Design

Chap 6 Introduction to HDL (d)

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

Lecture 32: SystemVerilog

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

Digital Design with SystemVerilog

Chapter 4 :: Topics. Introduction. SystemVerilog. Hardware description language (HDL): allows designer to specify logic function only.

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

A Brief Introduction to Verilog Hardware Definition Language (HDL)

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

COE 405 Design Methodology Based on VHDL

תכן חומרה בשפת VERILOG הפקולטה להנדסה

VERILOG HDL. 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Lecture 3 Introduction to VHDL

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

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

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

Verilog Design Principles

Lab 3 Verilog Simulation Mapping

Chapter 2 Basic Logic Circuits and VHDL Description

HDLs and SystemVerilog. Digital Computer Design

Transcription:

What is Verilog HDL? Lecture 1: Verilog HDL Introduction Verilog Hardware Description Language(HDL)? A high-level computer language can model, represent and simulate digital design Hardware concurrency Parallel Activity Flow Semantics for Signal Value and Time Design examples using Verilog HDL Intel Pentium, AMD K5, K6, Atheon, ARM7, etc Thousands of ASIC designs using Verilog HDL 1 2 What is VHDL? Requirements Basic Design Methodology VHDL represents another high level language for digital system design. In this course we study Verilog HDL reason: used more often in electronic and computer industry programming style is very similar to C programming language RTL Model Synthesize Gate-level Model Simulate Simulate Test Bench ASIC or FPGA Place & Route 3 Timing Model Simulate 4 1

Modeling Digital Systems Domains and Levels of Modeling Verilog HDL is for writing models of a system Reasons for modeling requirements specification documentation testing using simulation formal verification synthesis Goal most reliable design process, with minimum cost and time avoid design errors! high level of abstraction low level of abstraction 5 6 Domains and Levels of Modeling Domains and Levels of Modeling Algorithm (behavioral) Processor-Memory Switch Register-Transfer Language Boolean Equation Differential Equation Register-Transfer Gate Transistor 7 8 2

Domains and Levels of Modeling Polygons Sticks Standard Cells Floor Plan 9 Verilog HDL Models HDL model specifies the relationship between input signals and output signals HDL uses special constructs to describe hardware concurrency, parallel activity flow, time delays and waveforms Verilog code for a AND gate module and_gate(y, x1, x2); input x1, x2; output y; and(y, x1, x2); 10 Verilog Examples Verilog Example: A D Flip Flop module Add_half (sum, c_out, a, b); output sum, c_out; input a, b; wire c_out_bar; xor G1 (sum, a, b); nand G2 (c_out_bar, a, b); not G3 (c_out, c_out_bar); * the instance name of Verilog primitives is optional. 11 module Flip_Flop (q, data_in, clk, rst); input data_in, clk, rst; output q; reg q; always @ (posedge clk) begin if (rst = = 1) q = 0; else q = data_in; 12 3

Verilog Example: behavioral model module adder_4_rtl (a, b, c_in, sum, c_out); output [3:0] sum; output c_out; input [3:0] a, b; input c_in; assign {c_out, sum} = a + b + c_in; 13 Verilog Example: Models models Are built from gate primitives and/or other modules They describe the circuit using logic gates much as you would see in an implementation of a circuit. You could describe your assignment1 circuit this way Identify Gate instances, wire names, delay from a or b to f. a b sel f module mux (f, a, b, sel); output f; input a, b, sel; and #5 g1 (f1, a, nsel), g2 (f2, b, sel); or #5 g3 (f, f1, f2); not g4 (nsel, sel); 14 Verilog Example: Gate-Level Models Need to model the gate s: Function Delay Function Generally, HDLs have built-in gate-level primitives Verilog has NAND, NOR, AND, OR, XOR, XNOR, BUF, NOT, and some others The gates operate on input values producing an output value typical Verilog gate instantiation is: How to build and test a module Construct a test bench for your design Develop your hierarchical system within a module that has input and output ports (called design here) Develop a separate module to generate tests for the module ( test ) Connect these together within another module ( testbench ) optional many and #delay instance-name (out, in1, in2, in3, ); 15 16 4

Another view of this module testbench (); wire l, m, n; design d (l, m, n); test t (l, m); //monitor and display module test (q, r); output q, r; module design (a, b, c); input a, b; output c; //drive the outputs with signals 3 chunks of verilog, one for each of: TESTBENCH is the final piece of hardware which connect DESIGN with TEST so the inputs generated go to the design you want to test... Another piece of hardware, called TEST, to generate interesting inputs Your hardware called DESIGN 17 18 Verilog Examples Module testadd generated inputs for module halfadd and displayed changes. Module halfadd was the design module tbench; wire su, co, a, b; halfadd testadd ad(su, co, a, b); tb(a, b, su, co); module halfadd (sum, cout, a, b); output sum, cout; input a, b; xor #2 and #2 (sum, a, b); (cout, a, b); module testadd(a, b, sum, cout); input sum, cout; output a, b; reg a, b; $monitor ($time,, a=%b, b=%b, sum=%b, cout=%b, a, b, sum, cout); a = 0; b = 0; #10 b = 1; #10 a = 1; #10 b = 0; #10 $finish; 19 It s the test generator $monitor prints its string when executed. after that, the string is printed when one of the listed values changes. only one monitor can be active at any time prints at of current simulation time The test module module testadd(a, b, sum, cout); input sum, cout; output a, b; reg a, b; $monitor ($time,, a=%b, b=%b, sum=%b, cout=%b, a, b, sum, cout); a = 0; b = 0; #10 b = 1; #10 a = 1; #10 b = 0; #10 $finish; 20 5

Function of this tester at time zero, print values and set a=b=0 after 10 time units, set b=1 after another 10, set a=1 after another 10 set b=0 then another 10 and finish The test module (continued) module testadd(a, b, sum, cout); input sum, cout; output a, b; reg a, b; $monitor ($time,, a=%b, b=%b, sum=%b, cout=%b, a, b, sum, cout); a = 0; b = 0; #10 b = 1; #10 a = 1; #10 b = 0; #10 $finish; 21 $monitor give it a list of variables. When one of them changes, it prints the information. Can only have one of these active at a time. e.g. $monitor ($time,,, a=%b, b=%b, sum=%b, cout=%b,a, b, sum, cout); extra commas print a spaces The above will print: 2 a=0, b=0, sum=0, cout=0<return> $display() sort of like printf() $display ( Hello, world %h, hexvalue) %b is binary (also, %h, %d and others) display contents of data item called hexvalue using hex digits (0-9,A-F) newline automatically included 22 vs Behavioral Models model Just specifies primitive gates and wires i.e., the structure of a logical netlist You basically know how to do this now. Behavioral model More like a procedure in a programming language Still specify a module in Verilog with inputs and outputs......but inside the module you write code to tell what you want to have happen, NOT what gates to connect to make it happen i.e., you specify the behavior you want, not the structure to do it module ripple_adder (A, B, carry_in, carry_out, Out); input A, B, carry_in; output Out, carry_out; assign {carry_out, Out} = A + B + carry_in Why use behavioral models For testbench modules to test structural designs For high-level specs to drive logic synthesis tools 23 24 6

Summary Model hardware at different levels of abstraction Mix different levels of abstraction in description and simulation Able to model hardware concurrency Support Hierarchical decomposition Availability of ASIC Foundry Support 25 7