Presentation is loading. Please wait.

Presentation is loading. Please wait.

KARTHIK.S Lecturer/ECE S.N.G.C.E

Similar presentations


Presentation on theme: "KARTHIK.S Lecturer/ECE S.N.G.C.E"— Presentation transcript:

1 KARTHIK.S Lecturer/ECE S.N.G.C.E
VERILOG HDL IEEE STD 1364 " It may not take more than one week, if you happen to know at least one programming language". KARTHIK.S Lecturer/ECE S.N.G.C.E Karthik.S S.N.G.C.E

2 CONTENTS Introduction. History of Verilog. Design and Tool Flow.
What is Verilog HDL. Verilog HDL language elements. My First Program in Verilog. Verilog data flow Modeling. Structural Modeling Verilog behavioral modeling. Procedural Timing Controls. Tasks and Function. System Tasks and Functions. Art of writing test benches. Karthik.S S.N.G.C.E

3 Introduction. Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL).
A hardware description Language is a language used to describe a digital system, for example, a microprocessor or a memory or a simple flip-flop. This just means that, by using a HDL one can describe any hardware (digital ) at any level. CONTENTS Karthik.S S.N.G.C.E

4 HISTORY Verilog was started initially as a proprietary hardware modeling language by Gateway Design Automation Inc. around 1984. Verilog simulator was first used beginning in 1985 and was extended substantially through 1987.The implementation was the Verilog simulator sold by Gateway. After many years, new features have been added to Verilog, and new version is called Verilog 2001. CONTENTS Karthik.S S.N.G.C.E

5 INTRODUCTION Typical Design flow Karthik.S S.N.G.C.E

6 SPECIFICATION HIGH LEVEL DESIGN
This is the stage at which we define what are the important parameters of the system/design that you are planning to design. HIGH LEVEL DESIGN This is the stage at which you define various blocks in the design and how they communicate. Example: Microprocessor Karthik.S S.N.G.C.E

7 LOW LEVEL DESIGN RTL CODING
Low level design or Micro design is the phase in which, designer describes how each block is implemented. RTL CODING In RTL coding, Micro Design is converted into Verilog/VHDL code, using synthesizable constructs of the language. Karthik.S S.N.G.C.E

8 SIMULATION Simulation is the process of verifying the functional characteristics of models We use simulators to simulate the Hardware models. To test if the RTL code meets the functional requirements of the specification, see if all the RTL blocks are functionally correct. SYNTHESIS Simulation is the process in which the synthesis tools takes the RTL code to the target technology. It maps RTL codes to the gates & primitives and do minimal amount of timing analysis. Example: Xillinx ISE, QuatrusII. CONTENTS Karthik.S S.N.G.C.E

9 MY Ist PROGRAM If we refer to any text book on programming language it starts with “HELLO WORLD” program. I start with “WELCOME” program. // Design name: Welcome to SNGCE // File name: welcome.v // Coder: Karthik.S module welcome; initial begin $display (“welcome to SNGCE”); end endmodule CONTENTS Karthik.S S.N.G.C.E

10 VERILOG HDL Single language for design & Simulation.
Three types of modeling 1. DATAFLOW 2. STRUCTURAL 3. BEHAVIORAL Built-in primitives & logic functions Built-in data types User defined primitives. Karthik.S S.N.G.C.E

11 BASIC UNIT-MODULE Modules communicates externally with input & output.
A module can be instantiated into other module. Karthik.S S.N.G.C.E

12 EXAMPLE One can describe a simple Flip flop as that in above figure as well as one can describe a complicated designs having 1 million gates. CONTENTS Karthik.S S.N.G.C.E

13 VERILOG SYNTAX Verilog is free-format language. White space can be used freely. Verilog is CASE Sensitive User provided names are called identifiers and should start with a “letter” or “_” example: CONUT_1 Predefined identifiers are called keywords. All keywords are lower case. Example: assign, module, begin, end, etc., Comments- two forms: /* first form*/ & // second form Value set: 1(high), 0(low), X(unknown), Z(high impedance). Karthik.S S.N.G.C.E

14 NUMBER REPRESENTATION
<size><base format><number> Examples: 8'h FF // hex number 8‘d65 // octal number 4'b11 // 4-bit binary number 0011 Karthik.S S.N.G.C.E

15 DATA TYPES Represent abstract data values.
NETS: Connects b/w structural elements. Values comes from it’s drivers Can be used in data flow & structural modeling Default value is Z Example: wire REGISTERS: Represent abstract data values. Values in a register is saved until new value is stored. Default value is X Example: reg CONTENTS Karthik.S S.N.G.C.E

16 DATA FLOW Karthik.S S.N.G.C.E

17 INTRODUCTION Karthik.S S.N.G.C.E

18 DELAYS Karthik.S S.N.G.C.E

19 OPERATORS Karthik.S S.N.G.C.E

20 EXAMPLE module half_adder (sum,cout,a,b,cin); input a, b, cin; output sum, cout; assign sum = a ^ b;// assignment should be done //with <= sign. assign cout = a & b; endmodule Karthik.S S.N.G.C.E

21 EXAMPLE 2 2X1 MUX module mux_2 ( y, s, a, b); input s, a, b; output y; assign y = s?a : b; // if s=0 y=a else y=b endmodule CONTENTS Karthik.S S.N.G.C.E

22 STRUCTURAL Karthik.S S.N.G.C.E

23 GATE LEVEL MODELING Karthik.S S.N.G.C.E

24 4X1 MUX module mux_4 (y,s0,s1,a,b,c,d); input a,b,c,d,s0,s1; output y; not n1(s0bar,s0); // gate instantiation starts here not n2(s1bar,s1); and a1(t0,s0bar,s1bar,a); and a1(t1,s0bar,s1,b); and a1(t2,s0,s1bar,c); and a1(t3,s0,s1,d); or o1(y,t0,t1,t2,t3); endmodule Karthik.S S.N.G.C.E

25 UER DEFINED PRIMITIVES
Module instantiation can be done i.e. module within a module. A 4-bit RCA can be designed using 4 full adders. First a full adder is designed and it is called or instantiated in the RCA Karthik.S S.N.G.C.E

26 EXAMPLE module RCA ( sum, cout, a, b, cin); input [3:0] a, b; output[3:0] sum; input cin; output cout; module fa ( s, cy, x, y, c); input x,y,c; output s, cy; assign s<= x^y^c; assign cy<= (x&y) | (y&c) | (c&x); endmodule Karthik.S S.N.G.C.E

27 Karthik.S S.N.G.C.E CONTENTS


Download ppt "KARTHIK.S Lecturer/ECE S.N.G.C.E"

Similar presentations


Ads by Google