1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.

Slides:



Advertisements
Similar presentations
1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Advertisements

Simulation executable (simv)
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Chap. 6 Dataflow Modeling
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
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.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Workshop Topics - Outline
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
B. RAMAMURTHY Hardware Description Language 8/2/
RTL Coding tips Lecture 7,8 Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock.
Chap. 3 Basic Concepts. 2 Basic Concepts Lexical Conventions Data Types System Tasks and Compiler Directives Summary.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Lecture Note on Verilog, Course # , EE, NTU, C.H Tsai Basic Logic Design with Verilog TA: Chen-han Tsai.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
ECE 2372 Modern Digital System Design
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction to Verilog Syntax Spring.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction.
Workshop Topics - Outline
COE 405 Introduction to Logic Design with Verilog
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Verilog Language Concepts
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Digital System Design Introduction to Verilog ® HDL Maziar Goudarzi.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CH71 Chapter 7 Hardware Description Language (HDL) By Taweesak Reungpeerakul.
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Use of HDLs in Teaching of Computer Hardware Courses Zvonko Vranesic and Stephen Brown University of Toronto.
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
M.Mohajjel. Continuous Assignments Continuously Drive a value onto a net Left hand side must be net Right hand side registers nets function calls Keyword.
Sharif University of Technology Department of Computer Engineering Verilog ® HDL Basic Concepts Alireza Ejlali.
© 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.
Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Digital System Design Verilog ® HDL Dataflow Modeling Maziar Goudarzi.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Hardware Description Languages: Verilog
KARTHIK.S Lecturer/ECE S.N.G.C.E
Supplement on Verilog adder examples
Lecture 2 Supplement Verilog-01
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Chapter 4 Combinational Logic
Behavioral Modeling in Verilog
Chapter 3: Dataflow Modeling
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
COE 202 Introduction to Verilog
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Supplement on Verilog adder examples
Introduction to Verilog® HDL
EEE2243 Digital System Design Chapter 1: Verilog HDL (Combinational) by Muhazam Mustapha, February 2012.
Verilog HDL Basic Syntax
Verilog for Testbenches
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System Workshop 5 - Data types A Workshop 6 - Data types B Workshop 7 - Operators Workshop 8 - Signed arithmetic Workshop 9 - Behavioral modeling A Workshop 10 - Behavioral modeling B Workshop 11 - Behavioral modeling C Workshop 12 - Data flow modeling Workshop 13 - Coding Styles

2 Verilog Value Set 4 value logic system: 0represents low logic level or false condition 1represents high logic level or true condition Xrepresents unknown logic level Zrepresents high impedance logic level Note: x and z have limited use for synthesis

3 Four-valued Logic System Logical operators work on three-valued logic (0, 1, X) 01XZ XXX0XXXZ0XXX01XZ XXX0XXXZ0XXX Output 0 if one input is 0 Output X if both inputs are gibberish in1 in2 out in1 in2

4 The Power of Verilog: Integer Arithmetic Verilog’s built-in arithmetic makes a 32-bit adder easy: module add32 (a, b, sum) ; input [31:0] a, b ; output wire [31:0] sum ; assign sum = a + b ; endmodule A 32-bit adder with carry-in and carry-out: module add32_carry (a, b, cin, sum, cout) ; input [31:0] a, b ; input cin ; output wire [31:0] sum ; output wire cout ; assign {cout, sum} = a + b + cin ; // Concatenation endmodule

5 Quiz – Practice Practice writing the following numbers: 1. Decimal number 123 as a sized 8-bit number in binary. Use _ for readability. 8’b0111_ ’hX -4’d2 4’d14 ’h A 16-bit hexadecimal unknown number with all x’s. 4. An unsized hex number A 4-bit negative 2 in decimal. Write the 2’s complement for this number.

6 Quiz – Practice cont. Are the following legal strings? If not, write the correct strings. a. “this is a string ‘displaying the % sign” Not-legal, string must be contained on a single line Not-legal, includes \n = new line Legal b. “out = in1 + in2” c. “Please ring the bell \007” d. “This is a backslash \ character\n”

7 Quiz – Practice cont. Are these legal identifiers? Legal Not-legal, starts with a digit (number) Not-legal, starts with a $ sign a. system1 b. 1reg c. $latch d. exec$

8 Quiz – Practice cont. Declare the following variables in Verilog: a. An 8-bit vector net called a_in wire [7:0] a_in ; reg [31:0] address ; address = 32’d3 ; integer count ; b. A 32-bit storage register called address. Bit 31 must be the MSB (Little- Endian). c. Set the value of the register to a 32-bit decimal number equal to 3 d. An integer called count // integer = 32bits register

9 Quiz – Practice cont. e. A time variable called snap_shot // time = 64bits register integer delays[0:19] ; reg [63:0] MEM[0:255] ; parameter cache_size = 512 ; time snap_shot ; f. An-array called delays. Array contains 20 elements of the type integer g. A memory MEM containing 256 words of 64 bits each h. A parameter cache_size equal to 512 // a constant value declared within a module

10 CPU Address Bus Buffer Example module addr_buff(addr, abus, wr) ; input [31:0] addr ; input wr ; output [31:0] abus ; assign abus = (wr)? addr : 32’bZ ; endmodule module addr_buff_tb ; // test bench reg [31:0] addr ; reg wr ; wire [31:0] abus ; addr_buff UUT(addr, a_bus, wr) ; // UUT instantiation initial begin addr = 32’hAAAAAAAA ; wr = 0 ; #1 wr = 1 ; #1 addr = 32’h ; #1 wr = 0 ; #1 $finish ; end endmodule 3’S addr abus wr

11 CPU Address Bus Buffer Simulation Simulation results

12 CPU Data Bus Buffer Example module data_buff(dout, control, dbus) ; input [31:0] dout ; // write data input wr ; inout [31:0] dbus ; assign dbus = (control)? dout : 32’bZ ; endmodule module data_buff_tb ; // test bench reg [31:0] dout, Dbus ; // Dbus – data from external memory reg control ; wire [31:0] dbus ; data_buff UUT(dout, wr, dbus) ; // UUT instantiation initial begin dout = 32’hAAAAAAAA ; control = 0 ; Dbus = 32’h ; #1 control = 1 ; Dbus = 32’hZ ; #1 dout = 32’h ; #1 control = 0 ; Dbus = 32’h ; #1 $finish ; end endmodule 3’S dout dbus Read data wr

13 CPU Data Bus Buffer Simulation Simulation results