verilog modelling and types of modellings

37 views 51 slides Aug 28, 2024
Slide 1
Slide 1 of 51
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51

About This Presentation

“A stick diagram is a cartoon of a layout.”
The designer draws a freehand sketch of a layout, using colored lines to represent the various
process layers such as diffusion, metal and polysilicon. Where polysilicon crosses diffusion,
transistors are created and where metal wires join diffusion or...


Slide Content

Samir Palnıtkar

is in behavioral modeling
Other statements can appear only inside th
blocks:
always and Initial rept
flow

Both blocks begin

initial
> Starts at zero simulation time

»executes only once during a simulation
> All initial blocks executed concurrently at
time 0)

> begin-end is used to build initial blocks
(similar to {-} in C)

» Used mainly for initialization, monitoring
and waveforms and other processes that
must be executed only once during the
entire simulation run

Ir. ra
EEE/CSC-273

multiple:
neea Ton

endmodule

Example-7.1 : initi

nent E
i= 1490;
= lot;
x = 1/00;
b)= 1/0;

"bi;

always

ation time
ously In a looping

ea
ock of activity that | ish
sly in a digital circuit

ised to, build initial block
in O)

n ©)

Y

Procedural Assignment

a procedural assignment
of the following:
| or time register variable or a memory

Blocking) assignments

tia block

ssignmen En
> Use blocking statements to build
combinational logic block

Non-blocking assignments

> Allows scheduling of assignments without
blocking) execution of the statements that
follow in a sequential block

> A” <= * operator is used to specify non-

blocking assignments
» Executed last in the time step in which they
are scheduled, that is, after all the blocking
assignments in that time step are executed
» Use non-blocking statements to build
Sequential loaic block

nple

module dummy;

nteger count;

(Ail behavioral) emenis must beinside
//Dont mix blocking and non-blocking sta
initié

ent with delay (@time 15)

[ (@tim

$monitor(s

Application of non-blocking
assignments

> They are use

concurrent dat

a met ps to model
that take ola

alter a common eve

» Disadvant
performal

tion in the simu
in memory

n-blocking a

Begin

At each positive edge of clock following) si

non-blocki

ions are exect

Ihe order in which the write operations are exec!

important.

- 7.5 ; non-blocking statements to elimin:
On Ie WwWo eonetirron: always blocksiwiihrblockIng

@(posedge clock),

bs

ways @(posedge

ion 27 TWO Concurrent always blocks with nonnlock:
ements:

s @(posedge clock)

by

Ways @(posedge clock),

f non-blockin

lways @(posedge clock)
begin
Read OpeTranion

Of Gint-WanG-Side Expressions ii)

ANTE Operation)

///ASsign) Values oí temporary Variables to left-hand-side variables:

lemp_b;

temp_a;

Timing Control for Simulation

> lí no timing control statement,
simulation time does not advancı

Delay based timing control
Event based timing control

based timing control

e duration between when!

tne
3 encountered) and when It Is

# <number>

#<identifier>

# (minimum: typical:

maximum)

Example

Regular delay contro).

when the
Encountered

1 AO JUN its,
Ol

Minimum
1/3

1e right of
gnment operator

3101 x and at the |= 0) evaliiate x.
Walt SMe Units tO assign Value toy

with) temporany Variables and reguiar a

[always or
same

A IS
on time,

zero delay contro!

zero delay contro)

control

an event... 2

ange in the value of a register or a net

[control
rol

+ ar event contre
= Named) event control

= Event or un

=

le valu
legative tra nsiti

Ver SiGiiall Clock

ion ( 0 to 1, x of zZ,

Ver signal clock
(1 to 0, xt

event OR control

> Transition on any one of multiple signals or events

always @(reset or clock or D)
begin
it(reset)
q = 10;
else ¡f(clock)

q= D;

Level sensitive

yeti is level sen: Ena
= Waits for

block Is

always
wait (count_enable) #20 count = count + 1;

ANNO MOS CONLINUEUSIY

= queued < MAX_Q_ DEPTH)

number_queued

Types

[Execute ski

if (alu_control
X + Z;

ui control

rol signal”)

// lock of statement

(pression and ihe
equal bit width, th

At h the widest Ban,

imple 7.14 : multiple
nodule mi

ROT
output out
nput iO,
nput si, sO;

reg out;

or SO or i0 or i2 or i
x ih) Of; como)

Switch k

control sig)

endmodule

eg) outdo,

any)

Example 7.15 tatement with x and z continue.

module stimulus;

IN, S

$monitor($time
OUTO, OU
initia

beg

Le
Loops
Ops

ession>)
Man
y logic
Xpress

module counter;

integer count;

xed number of times
a number (constant, variable, signal value)
Î alue evaluated only when

ment and alsplay/c

ning const
o gen

ple 7.20)

tements are processe: the order they are specifiec
y/ever r to the simulation time when the
VIOUS ste the block completed execution

= Example

//MuUstravion) iz Sequential block without delay,

xample 7

z= %b, w= %b\n", x, y, Z, W);

// complet

// Completes at simu
// Competes at; simu
// complet i

D.

Parallel blocks

>

Blocs with) d

kg
CS,

#20 w = {y, x};

end)

endmodule

Named Block

ed, i.e. their execution can be

avale i iat

9) Count

6'b 0010_0000_0001 ;
begin: block1 he main n while is named block:

Example (traffic signal controller)

venlos description

I 7 Al
Ip
8
= GOeESC
les
A
0)
: tive
E
aa

age)

Verilog description (cont...)

Verilog

entry = %b",

Verilog description (Stimulus)