30
Verilog HDL: A solution for Everybody By, A nil K umar Ram Rakhyani (akram@)

Verilog Tutorial (1)

Embed Size (px)

DESCRIPTION

Verilog tutorial

Citation preview

Page 1: Verilog Tutorial (1)

Verilog HDL:A solution for

EverybodyBy,

Anil Kumar Ram Rakhyani (akram@)

Page 2: Verilog Tutorial (1)

Traditional Design approaches

Gate Level DesignSchematic Design

Page 3: Verilog Tutorial (1)

Where is the problem?

System specification is behavioral

Manual Translation of design in Boolean equations

Handling of large Complex Designs

Can we still use SPICE for simulating Digital circuits?

Page 4: Verilog Tutorial (1)

Advancements over the years

© Intel 4004 Processor

Introduced in 1971 2300 Transistors 108 KHz Clock

© Intel P4 Processor Introduced in 2000 40 Million Transistors 1.5GHz Clock

Page 5: Verilog Tutorial (1)

System Design Pyramid

Page 6: Verilog Tutorial (1)

History:

Need: a simple, intuitive and effective way of describing digital circuits for modeling, simulation and analysis.

Developed in 1984-85 by Philip Moorby In 1990 Cadence opened the language to the

public Standardization of language by IEEE in 1995

Page 7: Verilog Tutorial (1)

A Match between Verilog & VHDL

Page 8: Verilog Tutorial (1)

A Match between Verilog & VHDL(con.)

Page 9: Verilog Tutorial (1)

Top-Down Design Approach

Page 10: Verilog Tutorial (1)

Definition of Module

Interface: port and parameter declaration

Body: Internal part of module

Add-ons (optional)

Page 11: Verilog Tutorial (1)

Some points to remember

The name of Module

Comments in Verilog One line comment (// ………….) Block Comment (/*…………….*/)

Description of Module (optional but suggested)

Page 12: Verilog Tutorial (1)

Description of Module

Page 13: Verilog Tutorial (1)

The Module Interface

Port List

Port Declaration

Page 14: Verilog Tutorial (1)

One language, Many Coding Style

Page 15: Verilog Tutorial (1)

One language, Many Coding Style (contd.)

Page 16: Verilog Tutorial (1)

One language, Many Coding Style (contd.)

Page 17: Verilog Tutorial (1)

Structural style: Verilog Code

Page 18: Verilog Tutorial (1)

Dataflow style: Verilog Code

Page 19: Verilog Tutorial (1)

Behavioral style: Verilog Code

Page 20: Verilog Tutorial (1)

Data Values and Representation Four Data value

Data representation Type Binary 6’b100101 Hex 6’h25

Page 21: Verilog Tutorial (1)

Class of Signals

Nets: physical connection between hardware elements

Registers: Store value even if disconnected

Page 22: Verilog Tutorial (1)

Nets

wire/tri wand/triand wor/trior Supply0,supply1,

tri0,tri1,trireg

Page 23: Verilog Tutorial (1)

Specifications of Ports

Page 24: Verilog Tutorial (1)

Registered Output

Page 25: Verilog Tutorial (1)

Delay Statement

Page 26: Verilog Tutorial (1)

Parameter

Page 27: Verilog Tutorial (1)

Test Benchmodule main;reg a, b, c; wire sum, carry;

fulladder add(a,b,c,sum,carry);initialbegin a = 0; b = 0; c = 0; #5 a = 0; b = 1; c = 0; #5 a = 1; b = 0; c = 1; #5 a = 1; b = 1; c = 1; #5endendmodule

Page 28: Verilog Tutorial (1)

Memory Operation

reg [31:0] register_file [0:7];

wire [31:0] rf_bus;

wire r2b4;

assign rf_bus = register_file [2];

assign r2b4 = rf_bus[4];

Can’t use register_file[2][4] for assigning value to variable r2b4

Page 29: Verilog Tutorial (1)

Some main points to remember Verilog is concurrent

Think while writing your program.

Blocking and Non-blocking Code

Page 30: Verilog Tutorial (1)

References:

Evita_verilog Tutorial, www.aldec.com

http://www.asic-world.com/verilog/