University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.

Slides:



Advertisements
Similar presentations
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Advertisements

ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
CPEN Digital System Design
Table 7.1 Verilog Operators.
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.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Give qualifications of instructors: DAP
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
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.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
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.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
The Multicycle Processor II CPSC 321 Andreas Klappenecker.
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
Verilog Lab This presentation includes some material that is selected from BUCKNELL VERILOG HANDBOOK. Instructor: Dr. Charles Liu Prepared by John Ren.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
ECE 2372 Modern Digital System Design
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Verilog Language Concepts
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
CPEN Digital System Design
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Slide 1 2. Verilog Elements. Slide 2 Why (V)HDL? (VHDL, Verilog etc.), Karen Parnell, Nick Mehta, “Programmable Logic Design Quick Start Handbook”, Xilinx.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
IMPLEMENTATION OF MIPS 64 WITH VERILOG HARDWARE DESIGN LANGUAGE BY PRAMOD MENON CET520 S’03.
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
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
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
Introduction to Verilog
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Introduction to Verilog. Structure of a Verilog Program A Verilog program is structured as a set of modules, which may represent anything from a collection.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
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.
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
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.
Discussion 2: More to discuss
KARTHIK.S Lecturer/ECE S.N.G.C.E
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Computer Architecture and Design Lecture 6
Levels in computer design
Introduction to Digital System and Microprocessor 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.
The Verilog Hardware Description Language
Introduction to Digital IC Design
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

University of Jordan Computer Engineering Department CPE 439: Computer Design Lab

Lab Information Home Page: References: 1- Patterson and Hennessy. Computer Organization & Design: The Hardware/Software Interface, 2nd ed., Morgan Kaufmann, Hennessy and Patterson. Computer Architecture: A Quantitative Approach, 3rd ed., Morgan Kaufmann, S. Palnitkar, Verilog HDL, 2nd Ed., Prentice Hall, 2003.

Grading: - Pre-Lab Reports and In-Lab Performance 20% - Post-Lab Reports 20% - Mid-Term Exam 20% - Final Exam 40% Simulator: Verilogger Pro, from Synapticad INC.

Lab Outline Exp. 0: Overview of Verilog Exp. 1: Introduction to Verilogger Pro Exp. 2: 32-Bit ALU Exp. 3: Register File Exp. 4: Five-Stage Pipeline Datapath ( Arithmetic and Memory Instructions ) Exp. 5: Five-Stage Pipeline Datapath ( Adding Flow Control Instructions ) Exp. 6: Five-Stage Pipeline Datapath ( Solving Data Hazards ) Exp. 7: Direct-Mapped Instruction Cache

Verilog Overview

What is Verilog? It is a Hardware Description Language ( HDL ). Describe a digital system at several levels: - Switch level. - Gate level. - Register Transfer Level ( RTL ). - Behavioral level. Two major HDL languages: - Verilog. - VHDL.

Cont. Verilog is easier to learn and use ( C-like ). Introduced in 1985 by ( Gateway Design Systems ) Now, part of ( Cadence Design Systems ). 1990: OVI ( Open Verilog International ). 1995: IEEE Standard.

Why Use Verilog? Digital systems are highly complex.  schematic is useless ( just connectivity, not functionality ) Describe the system at wide ranges of levels of abstraction. Behavioral Constructs: - Hide implementation details. - Arch. Alternatives through simulations. - Detect design bottlenecks. ( BEFORE DETAILED DESIGN BEGINS ) Automated Tools compile behavioral models to actual circuits.

Lexical Conventions Close to C / C++. Comments: // Single line comment /* multiple lines comments */ Case Sensitive Keywords: - Reserved. - lower case.

Numbers: ’ -Size: No. of bits ( optional ). -Base format:  b: binary  d : decimal  o : octal  h : hexadecimal ( DEFAULT IS DECIMAL ) Examples:

Identifiers: - start with letter or ( _ ). - a combination of letters, digits, ( $ ), and( _ ). - up to 1024 characters.

Program Structure Verilog describes a system as a set of modules. Each module has an interface to other modules. Usually: - Each module is put in a separate file. - One top level module that contains:  Instances of Hardware modules.  Test data. Modules can be specified: - Behaviorally. - Structurally. Modules are different from subroutines in other languages ( never called ).

Physical Data Types Registers ( reg ): - store values reg [ 7 : 0 ] A ; // 8-bit register reg X; // 1-bit register ( flip flop ) Wires ( wire ): - does not store a value - represent physical connections between entities. wire [ 7 : 0 ] A ; wire X ;

reg and wire data objects may have a value of : - 0 : logical zero - 1 : logical one - x : unknown - z : high impedance Registers are initialized to x at the start of simulation. Any wire not connected to something has the value x. How to declare a memory in verilog ?

Operators Binary Arithmetic Operators:

Relational Operators:

Logical Operators:

Bitwise Operators: Unary Reduction Operators ??

Other operators: Concatenation : { A [0], B [1:7] } Shift Left : A = A > Conditional : A = C > D ? B + 3 : B – 2 ;

IF Statement Similar to C/C++. Instead of { }, use begin and end. if ( A == 4 ) begin B = 2; end else begin B = 4; end

Case Statement Similar to C/ C++ No break statements are needed. case ( A ) 1’bz : $display ) “ A is high impedance “); 1’bx : $display ) “ A is unknown“); default : $display ( “A = %b”, A); endcase

Example: NAND Gate module NAND ( in1, in2, out ) ; input in1, in2 ; output out ; assign out = ~ ( in1 & in2 ); // continuous // assignment endmodule

AND Gate module AND ( in1, in2, out ) ; input in1, in2 ; output out ; wire w1; NAND NAND1(in1, in2, w1 ); NAND NAND2 (w1, w1, out ) ; endmodule

Test

output

4-to-1 Multiplexor

Structural Gate-level model module multiplexor4_1(out, in1, in2, in3, in4, cntrl1, cntrl2); output out; input in1, in2, in3, in4, cntrl1, cntrl2; wire notcntlr1, notcntrl2, w, x, y, z; not (notcntrl1, cntrl1); not (notcntrl2, cntrl2); and (w, in1, notcntrl1, notcntrl2); and (x, in2, notcntrl1, cntrl2); and (y, in3, cntrl1, notcntrl2); and (z, in4, cntrl1, cntrl2); or (out, w, x, y, z); endmodule

RTL (dataflow) model module multiplexor4_1(out, in1, in2, in3,in4, cntrl1, cntrl2); output out; input in1, in2, in3, in4, cntrl1, cntrl2; assign out = (in1 & ~cntrl1 & ~cntrl2) | (in2 & ~cntrl1 & cntrl2) | (in3 & cntrl1 & ~cntrl2) | (in4 & cntrl1 & cntrl2); endmodule

Another RTL model module multiplexor4_1(out, in1, in2, in3, in4, cntrl1, cntrl2); output out; input in1, in2, in3, in4, cntrl1, cntrl2; assign out = cntrl1 ? (cntrl2 ? in4 : in3) : (cntrl2 ? in2 : in1); endmodule

Behavioral Model module multiplexor4_1(out, in1, in2, in3, in4, cntrl1, cntrl2); output out; input in1, in2, in3, in4, cntrl1, cntrl2; reg out; or in2 or in3 or in4 or cntrl1 or cntrl2) case ({cntrl1, cntrl2}) 2'b00 : out = in1; 2'b01 : out = in2; 2'b10 : out = in3; 2'b11 : out = in4; endcase endmodule Behavioral code: output out must now be of reg type as it is assigned values in a procedural block.

D - Flip Flop module dflipflop (d, clk, reset,q); input d, clk, reset; output q; reg q; (posedge clk or posedge reset) begin if (reset) begin q <= 0; end else begin q <= d; end endmodule

N-bit shift register