Verilog HDL Tutorial Winter 2003

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Verilog.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
1 Pertemuan 9 Verilog HDL Matakuliah: H0362/Very Large Scale Integrated Circuits Tahun: 2005 Versi: versi/01.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Verilog Lab This presentation includes some material that is selected from BUCKNELL VERILOG HANDBOOK. Instructor: Dr. Charles Liu Prepared by John Ren.
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
Hardware Design Environment Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
CH71 Chapter 7 Hardware Description Language (HDL) By Taweesak Reungpeerakul.
Module 1.2 Introduction to Verilog
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Brief Verilog.
February 6, 2009http://csg.csail.mit.edu/6.375/L02-1 Verilog 1 - Fundamentals Complex Digital Systems Arvind February 6, 2009 FA module adder( input.
Chapter 2: Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 2-1 Chapter 2a: Structural Modeling.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Introduction to ASIC flow and Verilog HDL
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
An Introduction to Verilog: Transitioning from VHDL
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
University of Maryland Baltimore County Department of Computer Science and Electrical Engineering   CMPE 212 Laboratory (Discussion 2) Hasibul Hasan
Discussion 2: More to discuss
Verilog Introduction Fall
KARTHIK.S Lecturer/ECE S.N.G.C.E
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Behavioral Modeling in Verilog
OUTLINE Introduction Basics of the Verilog Language
Introduction To Verilog-HDL
Levels in computer design
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Chapters 4 – Part3: Verilog – Part 1
The Verilog Hardware Description Language
The Verilog Hardware Description Language
Introduction to Digital IC Design
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Verilog HDL Tutorial Winter 2003 University of Washington ACME Lab Brigette Huang 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Tutorial Outline Introduction Circuit Modeling Gate-level Modeling Data-level Modeling Behavioral Modeling Testing & Simulation 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Introduction What is Verilog HDL? Verilog HDL is a Hardware Description Language that can be used to model a digital system at many levels of abstraction: Algorithmic-level Gate-level Switch-level 12/7/2018 Brigette Huang - Autumn 2002

Where can we use Verilog HDL? Verilog is designed for circuit verification and simulation, for timing analysis, for test analysis (testability analysis and fault grading) and for logic synthesis. For example, before you get to the structural level of your design, you want to make sure the logical paths of your design is faultless and meets the spec. 12/7/2018 Brigette Huang - Autumn 2002

Basic Procedure of Using Verilogger Preparation – always create a new folder in C drive. c:/documents and settings your_login_name your_project_folder Start – all programs –synaptiCAD - Verilogger pro 6.5 Editor – new HDL file – write your code – save as filename.v in your project folder Project – add HDL files – choose the file you just saved Project – save HDL project – save it in the your project folder too. We will continue after we finishing the modeling section….. 12/7/2018 Brigette Huang - Autumn 2002

Basic Syntax of a Module Module module_name (port_list); Declarations: input, output, wire, parameter….. System Modeling: describe the system in gate-level, data-flow, or behavioral style… endmodule 12/7/2018 Brigette Huang - Autumn 2002

Basic Module Construction // Compute the logical AND and OR of inputs A and B. module AND_OR(andOut, orOut, A, B); output andOut, orOut; input A, B;   and TheAndGate (andOut, A, B); or TheOrGate (orOut, A, B); endmodule Comments is: //….. Module = functions in C++ Syntax of module declarations is : Module yourcircuitname(output1, output2 ….., input1, input2….); Declaration of in/output variables, and wires, register, param…. input A,B,C,D,E; output[2:0] Dog, Cat; wire Cow[2:0]; 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Gate-Level Modeling Systems structure can be described using Build-in gates or pre-built modules. Basic syntax is : gate-type #delay instance1_name(outputs.., inputs.. ), : instance6_name(outputs.., inputs.. ); pre-built module module_instance1(output…,inputs..); 12/7/2018 Brigette Huang - Autumn 2002

The Built-in Primitive Gates Multiple-input gates: and, nand, or, nor, xor, xnor xor xor1(out, inA, inB, inC); Multiple-output gates: buf, not not inverter1(fanout1, fanout2, in); Tristate gates: bufif0, bufif1, notif0, notif1 bufif0 tbuffer1(out, in, control); 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Gate Delays Syntax: #(Tplh, Tphl) Examples: nor #10 Tplh =Tphl=10 time units nor #(3,5) Tplh=3, Tphl=5 nor #(2:3:4, 5) Tplh=(min2,typ3,max4) 12/7/2018 Brigette Huang - Autumn 2002

Example: A 4 to1 Multiplexer 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Simple Example module Mux4_1 (Z, D,S); output Z; input [3:0] D; input [1:0] S; wire S0b, S1b, T0, T1, T2, T3; not #5 inv0(S0b, S[0]), inv1(S1b, S[1]); and #10 and0(T0, D[0], S1b, S0b), and1(T1, D[1], S1b, S[0]), and2(T2, D[2], S[1], S0b), and3(T3, D[3], S[0], S[1]); or #10 or1(Z, T0,T1,T2,T3); endmodule 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Data-flow Modeling The basic mechanism used to model a design in the dataflow style is the continuous assignment. In a continuous assignment, a value is assigned to a net. Syntax: assign #delay LHS_net = RHS_expression; 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Example: 2 to 4 Decoder 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Example module Decoder 2_4(A,B,EN,Z); Input A,B,EN; output [0:3] Z; wire Ab, Bb; assign #1 Ab=~A; assign #1 Bb=~B; assign #2 Z[0]=~(Ab & Bb & EN); assign #2 Z[1]=~(Ab & B & EN); assign #2 Z[2]=~(A & Bb & EN); assign #2 Z[3]=~(A & B & EN); endmodule 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Behavioral Modeling The behavior of a design is described using procedural constructs. These are: Initial statement: This statement executes only once. Always statement: this statement always executes in a loop forever….. Only register data type can be assigned a value in either of these statements. 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 Always Statement Syntax: always #timing_control procedural_statement Procedural statement is one of : Blocking Procedural_assignment always @ (A or B or Cin) begin T1=A & B; T2=B & Cin; T3=A & Cin; Cout=T1 | T2 | T3; end T1 assignment is occurs first, then T2, then T3…. Always statement begins execution at time 0 and executes repeatedly. 12/7/2018 Brigette Huang - Autumn 2002

Procedural statements Conditional_statement always @(posedge clk or posedge reset) if ( Sum <60) begin Grade = C; Total_C=Total_C +1; end else if (Sum<75) Grade = B; else Grade = A; 12/7/2018 Brigette Huang - Autumn 2002

Procedural statements Case_statement always @(Time ==7) case(Day) Tue: Pocket-Money = 6; Mon, Wed: Pocket_Money = 2; Fri, Sat, Sun: Pocket_Money = 7; default: Pocket_Money= 0; endcase 12/7/2018 Brigette Huang - Autumn 2002

Let’s look at a file to review what we have learned today….. 12/7/2018 Brigette Huang - Autumn 2002

Brigette Huang - Autumn 2002 References Couple of good verilog books here: A Verilog HDL Primer by J. Bhasker Verilog HDL: A Guide to Digital Design and Synthesis by Samir Palnitkar Special thanks to Professor Peckol and Professor Hauck for their support and the tutorial documents they provided….. 12/7/2018 Brigette Huang - Autumn 2002