Verilog Tutorial (Structure, Test)

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

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

Online Verilog Resources

Introduction to Digital Design with Verilog HDL

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

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

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

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

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

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

UNIT V: SPECIFICATION USING VERILOG HDL

Programmable Logic Devices Verilog VII CMPE 415

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

OVERVIEW: ============================================================ REPLACE

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

Hardware Description Languages (HDLs) Verilog

Brief Introduction of Cell-based Design. Ching-Da Chan CIC/DSD

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

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

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

14. Introducton to Verilog

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

MLR Institute of Technology

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

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

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

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

Lecture 15: System Modeling and Verilog

Synthesizable Verilog

VLSI Design 13. Introduction to Verilog

Gate level or structural modeling

Appendix A GATE-LEVEL DETAILS

Verilog Lecţia 1. Primitive porţi. Primitive porţi de transmisie. Sintaxa generală de instanţiere a porţilor:

14. Introducton to Verilog

101-1 Under-Graduate Project Digital IC Design Flow

Combinational Logic II

Tutorial on Verilog HDL

Graduate Institute of Electronics Engineering, NTU Basic Concept of HDL

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

Contents. Appendix D Verilog Summary Page 1 of 16

Introduction to Verilog

EECS150 - Digital Design Lecture 10 Logic Synthesis

A Tutorial Introduction 1

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

Modeling Concepts. Introduction

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

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

EECS150 - Digital Design Lecture 10 Logic Synthesis

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

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

Introduction to Verilog HDL. Verilog 1

Verilog HDL Introduction

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

Advanced Digital Design with the Verilog HDL

The Verilog Hardware Description Language

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

Course Topics - Outline

Chapter 2a: Structural Modeling

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

EEL 4783: HDL in Digital System Design

Digital Design with FPGAs. By Neeraj Kulkarni

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

CSE140L: Components and Design Techniques for Digital Systems Lab

Design Using Verilog

Hardware Description Language (HDL)

ECEN 468 Advanced Logic Design

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Verilog Design Principles

CSE140L: Components and Design

CSE 2021 Computer Organization. The Basics of Logic Design

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

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

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

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog

Verilog for Combinational Circuits

Introduction to Verilog

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Chapter 2 Using Hardware Description Language Verilog. Overview

REF: Reuse Methodology Manual For System-ON-A-Chip Design, Third Edition 2002 CIC Training Manual Logic Synthesis with Design Compiler, July, 2007

Verilog Design Principles

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

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

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Synthesis of Combinational and Sequential Circuits with Verilog

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

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

Chap 6 Introduction to HDL (d)

Index. B Back-annotation, 507 SDF, 508

The Verilog Golden Reference Guide

Combinational Logic Design with Verilog. ECE 152A Winter 2012

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Chapter 4: Introduction to Logic Design with Verilog. Chapter 4 Copyright 2013 G. Tumbush v1.3

Verilog HDL. Gate-Level Modeling

HDL for Combinational Circuits. ENEL211 Digital Technology

MODELING LANGUAGES AND ABSTRACT MODELS. Giovanni De Micheli Stanford University. Chapter 3 in book, please read it.

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

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

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

Transcription:

Digital Circuit Design and Language Verilog Tutorial (Structure, Test) Chang, Ik Joon Kyunghee University

Hierarchical Design Top-down Design Methodology Bottom-up Design Methodology

Module START Example) END

Module (Example: Full Adder) Module becomes a template for instantiation

Port Declaration and Assignment Rule Input, Output and Inout declaration can be regarded as wire To store data in output, the output port should be declared as reg

Abstraction Modeling Levels in Verilog Behavioral or Algorithmic Level Most upper level Similar to C language Dataflow Level Showing the data flow between registers Gate Level Describing Gate-to-Gate connection Switch Level RTL Level Design = Behavioral + Dataflow

Abstraction Modeling Levels in Verilog Behavioral or Algorithmic Level Most upper level Similar to C language Dataflow Level Showing the data flow between registers Gate Level Describing Gate-to-Gate connection Switch Level RTL Level Design = Behavioral + Dataflow

Gate Level Modeling

Built-in Primitive Built-in Primitive Combinational logic Tri State MOS Gates CMOS Gates Bi-Directional Gates Pull Gates and nand or nor xor xnor buf not bufif0 bufif1 notif0 notif1 nmos pmos rnmos rpmos cmos rcmos tran tranif0 tranif1 rtran rtranif0 rtranif1 pullup pulldown

User-Defined Primitive (UDP) primitive UDP_02467 (D, A, B, C); output D; input A, B, C; // Truth table for D = f (A, B, C) =??(0, 2, 4, 6, 7); table // A B C : D 0 0 0 : 1; 0 0 1 : 0; 0 1 0 : 1; 0 1 1 : 0; 1 0 0 : 1; 1 0 1 : 0; 1 1 0 : 1; 1 1 1 : 1; endtable endprimitive Truth table UDP can be defined using a truth table

Example: Gate Level Modeling - butif0 #(5) a1(out, i1, i2) // rising, falling and turn-off delay = 5 - butif0 #(4, 6) a1(out, i1, i2) // rising=4, falling=6, turn-off=4 - burif0 #(3,4,5) a1(out, i1, i2) // rising=4, falling=6, turn-off=5 - and #(4:5:6) a1(out, i1, i2) // min : typical : max delay = 4 : 5 : 6 Delay operator will be removed in logic synthesis For logic simulation, min/typical/max delay should be selected

Gate-level Example: 4-bit RCA module half_adder (output S, C, input x, y); xor (S, x, y); and (C, x, y); endmodule module full_adder (output S, C, input x, y, z); wire S1, C1, C2; half_adder HA1 (S1, C1, x, y); half_adder HA2 (S, C2, S1, z); or G1 (C, C2, C1); endmodule module ripple_carry_4_bit_adder ( output [3: 0] Sum, output C4, input [3:0] A, B, input C0); wire C1, C2, C3; // Intermediate carries // Instantiate chain of full adders full_adder FA0 (Sum[0], C1, A[0], B[0], C0), FA1 (Sum[1], C2, A[1], B[1], C1), FA2 (Sum[2], C3, A[2], B[2], C2), FA3 (Sum[3], C4, A[3], B[3], C3); endmodule

Abstraction Modeling Levels in Verilog Behavioral or Algorithmic Level Most upper level Similar to C language Dataflow Level Showing the data flow between registers Gate Level Describing Gate-to-Gate connection Switch Level RTL Level Design = Behavioral + Dataflow

Dataflow Level Modeling Using Continuous Assignment or Operator Continuous Assignment ex. assign #10 out = in1 & in2 //delay 10 t.u. for input change

Example: Dataflow Level Modeling // 4:1 Multiplexer using dataflow level modeling module mux4_to_1 (out, in, sel); // I/O port declaration output out; input [3:0] in; input [1:0] sel; wire out; wire [3:0] in; wire [1:0] sel; assign out = (~sel[1] & ~sel[0] & in[0]) (~sel[1] & sel[0] & in[1]) (sel[1] & ~sel[0] & in[2]) (sel[1] & sel[0] & in[3]) endmodule

Abstraction Modeling Levels in Verilog Behavioral or Algorithmic Level Most upper level Similar to C language Dataflow Level Showing the data flow between registers Gate Level Describing Gate-to-Gate connection Switch Level RTL Level Design = Behavioral + Dataflow

Procedure What is procedure? Can be expressed in two types of statements: initial or always Every procedure is executed in parallel initial statement They execute only once always statement They execute forever until the simulation is completed Module can contain any number of procedures

Procedure: initial statement

Procedure: always statement

Procedural Assignment

Example: Blocking vs. Non-blocking Assignment always @ (posedge clock) a = b; always @ (posedge clock) b = a; What is the first? Race Condition always @ (posedge clock) a <= b; always @ (posedge clock) b <= a; always @ (posedge clock) begin temp_a = a; temp_b = b; a = temp_b; b = temp_a; end

Timing Control: Delay-based (using # )

Example: Delay-based Timing Control In the following Verilog Code, tell the simulation time of (a), (b), (c), (d) and (e). reg x, y, p, a, b, c, d; initial begin initial end #30 c = 1 b0; // (e) x = 1 b0; #5 y = 1 b1; // (a) fork #10 p = x; //(b) begin #20 a = x; // (c) b = y; // (d) end join

Timing Control: Event-based (using @ ) event OR control regular event control (positive-edge) regular event control (negative-edge) What is named event control?

Timing Control: Level-sensitive (using wait ) always wait (count_table) #20 count = count + 1; If count_table ==1, increase count by 20 t.u. else, no action

Procedural Statement: If

Procedural Statement: Case

Procedural Statement: For

Procedural Statement: While

Procedural Statement: Repeat

Procedural Statement: Forever

Test Bench For Functional Verification instantiation 32 Test bench : Applying stimulus to test HDL and observe its response In the test module, no input and output reg-inputs, wire-output

Test Bench for Functional Verification 2-to-1 Multiplexer

System Task

Display and Monitor String Format

HDL Example: D-Latch & D Flip-Flop

HDL Example: T and J-K Flip-Flop T Flip-Flop using D Flip-Flop J-K Flip-Flop using D Flip-Flop