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

Similar documents
Synthesis of Combinational and Sequential Circuits with Verilog

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

Synthesizable Verilog

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

Introduction to Verilog HDL

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

Digital Design with FPGAs. By Neeraj Kulkarni

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

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

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

Chapter 2 Using Hardware Description Language Verilog. Overview

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

Contents. Appendix D Verilog Summary Page 1 of 16

EEL 4783: HDL in Digital System Design

CSE140L: Components and Design Techniques for Digital Systems Lab

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

Introduction to Verilog HDL. Verilog 1

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

Lecture #2: Verilog HDL

Online Verilog Resources

CSE140L: Components and Design

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

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

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

101-1 Under-Graduate Project Digital IC Design Flow

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Programmable Logic Devices Verilog VII CMPE 415

EEL 4783: Hardware/Software Co-design with FPGAs

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis

ECEN 468 Advanced Logic Design

Verilog. Verilog for Synthesis

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016

Introduction to Verilog. Garrison W. Greenwood, Ph.D, P.E.

Chap 6 Introduction to HDL (d)

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

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

Verilog Design Principles

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

Lecture 15: System Modeling and Verilog

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

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

Verilog Tutorial (Structure, Test)

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

VERILOG 2: LANGUAGE BASICS

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

Combinational Logic II

MLR Institute of Technology

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

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Hardware description languages

Introduction to Verilog/System Verilog

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

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

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

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

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

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

VLSI Design 13. Introduction to Verilog

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Introduction. Why Use HDL? Simulation output. Explanation

Verilog HDL Introduction

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

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

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

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Design Using Verilog

Introduction. Purpose. Intended Audience. Conventions. Close

HDLs and SystemVerilog. Digital Computer Design

Verilog introduction. Embedded and Ambient Systems Lab

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

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

Introduction to Digital Design with Verilog HDL

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Combinational Logic Design with Verilog. ECE 152A Winter 2012

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

Hardware Description Language VHDL (1) Introduction

Verilog Module 1 Introduction and Combinational Logic

Hardware description language (HDL)

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

Hardware Description Languages: Verilog

ENGN1640: Design of Computing Systems Topic 02: Lab Foundations

ECE 353 Lab 3 (Verilog Design Approach)

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

Chapter 4. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 4 <1>

Introduction To Verilog Design. Chun-Hung Chou

Under-Graduate Project Logic Design with Behavioral Models

- 1 of 18 - The Verilog Hardware Description Language - A Behavioural View Overview. The Behavioural Model

Register Transfer Level in Verilog: Part I

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

14. Introducton to Verilog

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

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

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

Verilog. Reminder: Lab #1 due tonight! Fall 2008 Lecture 3

Verilog 1 - Fundamentals

Verilog Behavioral Modeling

C-Based Hardware Design

Transcription:

Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two major languages Verilog (IEEE 1364), latest version is Verilog 2001 VHDL Many EDA tools support HDL-based design VHDL vs. Verilog Both recognised standards, widely used Allow flexibility, multiple targets, reuse Similar capabilities VHDL has Ada based syntax Verilog has C based syntax

Requirements of HDLs Must support modeling, simulation, synthesis, verification and testability Support various levels of abstraction: switch, gate, behavioural, algorithmic Model gate delays, concurrency, Should support practical aspects such as testability analysis Structural and behavioural modelling Verilog supports both Structural models: declaration of components (e.g. gates) and their interconnections (e.g. wires) Not well suited for modelling-based simulation and verification Behavioural models: Abstract models of the function and sequence Well matched to simulation for testing Compilation/ Synthesis Libraries/ IP Test/ Verification Compilation/Synthesis: Automates exploration and insertion of implementation details for lower level. System specification System synthesis Hw/Sw/ OS Model simulat./ checkers Behavioral specification Behavior synthesis Cores Hw-Sw cosimulators Libraries/IP: Incorporates pre-designed implementation from lower abstraction level into higher level. RT specification RT synthesis RT components HDL simulators Test/Verification: Ensures correct functionality at each level, thus reducing costly iterations between levels. Logic specification Logic synthesis Gates/ Cells Gate simulators To final implementation

Uses of Verilog in the design process System design and architecture: At a high level, Verilog can model aspects of the complete system Other tools may be better suited for system level modelling Verilog supports abstract behavioural modeling for system analysis and partitioning. Uses of Verilog in the design process Design and synthesis Given an overall system architecture and partitioning is stable one can capture the design Work at many level typically at the register transfer level. Synthesis tools convert RTL to gate level circuits. Large designs require working at high level automation to minimise time to market -> RTL should be synthesizable Uses of Verilog in the design process Simulation and verification Design needs to be simulated and verified Especially true for ASIC designs where implementation in hardware is expensive and requires significant time to convert to H/W Verilog can describe test benches (test vectors and expected results) and support results comparison and analysis.

Uses of Verilog in the design process Test cases must have sufficient coverage Generation of test benches is difficult and time consuming Simulation is used to verify that design meets specifications. Typically two levels Functional simulation tests RTL logic. This is fast and can allow for rapid and extensive testing of function. Gate level timing simulation verifies timing specifications but is time intensive Verilog for design synthesis Verilog originally designed for event-driven logic simulation and support high level behavioural and structural modelling Models can be synthesised or transformed in to gate or transistor level logic circuits; HDL based synthesis is widely used in modern design But for automated synthesis only a subset of the language is currently used Not all Verilog constructs are synthesizable (can be automatically or efficiently converted to hardware) Code style for synthesis differs from coding style in computer software programs

Typically design at the RTL level of abstraction as lowest level of abstraction is used for functional simulation Synthesised to gate level for use by the CAD tools Levels of abstraction for design entry Switch level (typically too detailed) Gate level entry (used for detailed design) Truth table entry (not common) Boolean equations or register transfer level Most common with current technology Higher level behavioural and algorithmic modelling for abstract design and verification increasingly supported for synthesis. Verilog Language

Structural models Basic building block is the module Modules can declare instances of other modules and connect them together Structural elements can be A number of primitive elements (n-input and, nand, or, nor, xor, xnor gates plus tristate variants) Library modules User defined modules e.g. structural modeling with primitives Module Add_half(sum, c_out, a, b) input a,b; output c_out, sum; xor(sum, a, b); and(c_out,a,b); Endmodule; Add_half a(s,c,x,y); // use Modules define functionality of a component and ports 3 types of ports input output bi-directional (inout) Begins with keyword module ends with endmodule

When instantiating the module, ports must be consistent with order in the declaration Option use formal names explicitly Add_half(.b (x),.a (y),.sum (s),.c_out (co)); Verilog names and parameters are case sensitive Indentifiers are alphanumeric, can t start with $ or a digit. There is a set of reserved words. // a single line comment /* multiline comment */ Data types for synthesis Wire a connection or bus between ports Module inputs are typically wires Tri is similar to wire (a net) but tri-state Reg Used for data that must be stored Module outputs are usually reg Results of procedural statements

Vectors e.g. sum[3:0] lowest four bits of sum Declararations input [7:0] x, y; reg [7:0] x, y; // array reg s; // single bit wire [7:0] my_bus; // a bus Literals Format <SIZE><BASE><VALUE> Size is number of bits Base is binary ( b), octal ( o), decimal ( d) and hex ( h) e.g. 2 b10 4 hf (4 b1111) 4 b11xx 4 valued logic. Verilog supports four different values for signals 0 1 x don t care, initial state of registers in simulation z high-impedance Also support for open-collector and emitter follower outputs

Operators Arithmetic: +, -, /, *, % Comparative: >, <, >=, <= Logical:!, &&,, = =,!=, = = =,! = = Bitwise: ~, &,, ^ Shift: >>, << Conditional:? Concatenation { } A = 1; B =0; Then {A, B} is 10 Verilog hardware design is usually a combination of behavioural modelling with some structural elements Other modules can be instantiated and connected with nets (wire, tri ) Behavioural modeling based on concurrent, event-triggered processes Always blocks Based on triggering event Change state of reg variables

Assign statement associates a net with registers and other nets All assign statements are executed concurrently (with each other and with any always statements) Useful for datapath operations assign data = a & b; Procedural (or sequential) statements Always statement contains procedural statements conditioned on an event Can be used for combinational and sequential logic always @(posedge clk or clr) begin end always @(A or B) Part after the @ known as sensitivity list, specify a signal or transition) Assignments inside a always statement (or initial for simulations) are known as procedural assignments. LHS of procedural assignment must be a register variable (not wire) Two types blocking and non-blocking

Blocking Each statement is evaluated in order using current values of the RHS variables B =!A; C = B; If A and B both are 0 at start of assign statement then both B and C will be 1 after this statement Non-blocking Executes sequentially but using values of the RHS variable that existed at the start of the always block Effectively executed concurrently B <=!A; C <= B; If A and B both are 0 at start of assign statement then B will be 1 and C will be 0 Non-blocking statements typically used for sequential circuits where all flip-flops change state synchronously Blocking statements for combinational circuits

Procedural constructs if-then-else if (C == 1) begin statements.. end else begin statements.. end Be careful, spurious latches can be synthesised. Make sure you specify else part. Can be nested or paired as else if case case (X) begin 2 b00: A = 2 b10; 2 b10: A = 2 b11; default: A = 2 b00; endcase Be careful, spurious latches can be synthesised. Make sure you specify default or all options. casex and casez allow for don t care and tristate Lots of other constructs fork, join, initial, for useful for modeling but not usually supported for synthesis