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

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

Contents. Appendix D Verilog Summary Page 1 of 16

Introduction to Verilog/System Verilog

Verilog Design Principles

HDLs and SystemVerilog. Digital Computer Design

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

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

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

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

Verilog Design Principles

Verilog HDL Introduction

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

Lecture #2: Verilog HDL

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

Online Verilog Resources

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

CSE140L: Components and Design Techniques for Digital Systems Lab

Chap 6 Introduction to HDL (d)

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

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

Introduction to Digital Design with Verilog HDL

CSE140L: Components and Design

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

ECEN 468 Advanced Logic Design

Introduction To Verilog Design. Chun-Hung Chou

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

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

Introduction. Why Use HDL? Simulation output. Explanation

EEL 4783: HDL in Digital System Design

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

VERILOG. Deepjyoti Borah, Diwahar Jawahar

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

Verilog. Verilog for Synthesis

Chapter 2 Using Hardware Description Language Verilog. Overview

Synthesizable Verilog

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

Verilog Module 1 Introduction and Combinational Logic

Spring 2017 EE 3613: Computer Organization Chapter 5: Processor: Datapath & Control - 2 Verilog Tutorial

CSE140L: Components and Design Techniques for Digital Systems Lab. Verilog HDL. Instructor: Mohsen Imani UC San Diego. Source: Eric Crabill, Xilinx

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

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

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

A Tutorial Introduction 1

Digital Design with FPGAs. By Neeraj Kulkarni

Digital Design (VIMIAA01) Introduction to the Verilog HDL

Lab #1. Topics. 3. Introduction to Verilog 2/8/ Programmable logic. 2. Design Flow. 3. Verilog --- A Hardware Description Language

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

Verilog Hardware Description Language ROOM: B405

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

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

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

VERILOG 2: LANGUAGE BASICS

EECS150 - Digital Design Lecture 10 Logic Synthesis

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

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

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

ENGN1640: Design of Computing Systems Topic 02: Lab Foundations

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

Verilog introduction. Embedded and Ambient Systems Lab

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

Introduction to Verilog HDL

Hardware Description Language VHDL (1) Introduction

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

Chap 3. Modeling structure & basic concept of Verilog HDL

Programmable Logic Devices Verilog VII CMPE 415

EEL 4783: Hardware/Software Co-design with FPGAs

Combinational Logic II

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

yamin/

Synthesis of Combinational and Sequential Circuits with Verilog

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

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

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

ECE 353 Lab 3 (Verilog Design Approach)

Design Using Verilog

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

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

CS6710 Tool Suite. Verilog is the Key Tool

The Verilog Hardware Description Language

Chapter 3: Dataflow Modeling

EECS150 - Digital Design Lecture 10 Logic Synthesis

Hardware Description Languages: Verilog

Brief Introduction to Verilog HDL (Part 1)

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

Lecture 15: System Modeling and Verilog

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

Veriolog Overview. CS/EE 3710 Fall 2010

Verilog Behavioral Modeling

Hardware description languages

EECS 470 Lab 1. Verilog: Hardware Description Language

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

Course Topics - Outline

LANGUAGE CONSTRUCTS AND CONVENTIONS IN VERILOG

Introduction to Verilog HDL. Verilog 1

Hardware description language (HDL)

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

Verilog Dataflow Modeling

EECS 470 Lab 1. Verilog: Hardware Description Language

Transcription:

Verilog Radek Pelánek and Šimon Řeřucha

Contents 1 Computer Aided Design 2 Basic Syntax 3 Gate Level Modeling 4 Behavioral Modeling

Computer Aided Design

Hardware Description Languages (HDL) Verilog C like VHDL (VHSIC hardware description language) Pascal like many others (less supported), e.g. AHDL (Altera HDL)

Specification, Simulation, Synthesis Aims of hardware description languages (HDLs) Specification original aim of HDLs Simulation i.e. executable specifications Synthesis later added Note: not everything what can be specified can be synthetized

Structural vs Behavioral Modeling structural modeling functionality and structure of the circuit call out the specific hardware behavioral modeling only the functionality, no structure synthesis tool creates correct logic

Levels of Abstraction Verilog can be used at four levels of abstraction: algorithmic level like C code with if, case, loop statements register transfer level registers connected by boolean equations gate level interconnected by and, nor, etc. switch level MOS trasistors inside gates

Verilog Tutorials Many tutorials available on-line, see e.g., Introduction to Verilog (Peter M. Nyasulu) Verilog Tutorial (Deepak Kumar Tala) This presentation: main ideas and principles (not a technical documentation)

Example module toplevel(clock,reset,flop1); input clock; input reset; output flop1; reg flop1; reg flop2; always @(posedge reset or posedge clock) if (reset) begin flop1 <= 0; flop2 <= 1; end else begin flop1 <= flop2; flop2 <= flop1; end endmodule

Lexical Conventions Similar to C programming language: white space just a separator case sensitive; keywords are lower case identifiers start with alphabetic or underscore character, may contain numbers comments: /* multiline */ // singleline

Numbers sized (default 32) radix: binary (b), octal (o), decimal (d), hexadecimal (h) (default decimal) syntax:[size] [radix][value] underscore may be used for readability real numbers: decimal ([value].[value]) or scientific notation ([mantissa]e[exponent]) negative numbers: minus sign before the size; internally represented in 2s complement

Numbers: Examples syntax stored as description 1 00000000 00000000 00000000 00000001 unsized 32 bit 8 haa 10101010 sized hex 32 hdead BEEF 11011110 10101101 10111110 11101111 sized hex 6 b10 0011 100011 sized binary

Operators Similar to C programming language, priorities usuall (see documentation): arithmetics: +, -, *, /, %,... relational: <, >, ==,... logical:!, &&, bit operators:, &,,... reduction operators (unary): &,,... conditional:? : concatenation ({,}), shift operators (<<, >>)

Four Valued Logic 0 1 z the high impedance output of tri-state gate; a real electrical effect x unknown; not a real value, used in simulator as a debuging aid

Data Types nets structural connections between components wire interconnecting wire, no special function tri0, tri1, trireg, supply0,... registers represent variables used to store data; it does not represent a physical (hardware) register reg unsigned variable integer signed var 32 bits real double precision floating point

Bus Declarations Syntax: data-type[msb:lsb] name; Examples: wire [15:0] in, out; reg [7:0] tmp;

Modules modules building blocks design hierarchy instantiating modules in other modules in Quartus you can mix verilog modules with other modules specified in other formalisms (schematic, VHDL,...)

Ports communication between module and its environment all but top-level modules have ports ports can be associated by order or names port types: input, output, inout ports are by default wire

Module Structure module modulename(portlist); port declarations datatype declarations circuit functionality timing specification endmodule timing specification is for simulation

Parameterized Modules module shift_n(it, out); input [7:0] it; output[7:0] out; parameter n = 2; // default value assign out = (it << n); endmodule //instantiations wire [7:0] in1, out1, out2; shift_n shft2(in1, ou1); shift_n #(3) shft3(in1, ou2);

Gate Primitives and, nand, or, nor, xor, xnor n-input gates examples: and u1(out, in1, in2); xor (out, in1, in2, in3); names not mandatory

Gate Primitives: Example module myxor(input a, b, output x) and g1(p1, a, ~b), g2(p2, ~a, b); or (x, p1, p2); endmodule

Continuous Assignment: Example abstractly models combinatorial hardware driving values onto nets syntax: assign lhs = rhs; always active, if any input changes, the assign statement is reevaluated

Continuous Assignment: Example module fulladder(input a, b, cin, output s, cout) assign s = a ^ b ^ cin, cout = (a & b) (b & cin) (a & cin); endmodule

Procedural Blocks initial block always block evaluated at the beginning of simulation variable initialization not supported for synthesis continuously evaluated all always block in a module execute simultaneously blocks of statements: begin, end keywords

Waiting delay: #delay event control: @(list of events); statement is executed only after one specified events occur; events are: change of variable, posedge, negedge wait: wait (condition); waits until the condition evaluates to true

Example module up_counter(out, enable, clk, reset) output [7:0] out; input enable, clk, reset; reg [7:0] out; always @(posedge clk) if (reset) out <= 8 b0 ; else if (enable) out <= out + 1; endmodule

Procedural Assignments blocking (=) sequential evaluation use for combinatorial procedures non-blocking (<=) parallel evaluation assignment done after all right hand sides evaluated use for always @(posedge clk)... type procedures Do not mix = and <= in one block.

Conditional Statement, Loops Very similar to C programming language: if... else for while forever repeat

Case Statement case: mutlipath branch, comparison to constant default block casex, casez variants: may include z, x,? in constant (don t cares)

Case: Example always @(a or b or c or d or sel) begin case (sel) 2 b00: mux_out = a; 2 b01: mux_out = b; 2 b10: mux_out = c; 2 b11: mux_out = d; endcase

Casez: Example casez (d) 3 b1??: b = 2 b11; 3 b01?: b = 2 b10; default: b = 2 b00; endcase

Other Features functions tasks ( procedures in programing languages)