Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Universal Verification
Component with the
Incisive Plan-to-Closure
Methodology
Session 2.12
David Long, John Aynsley
and Jonathan Bromley,
Doulos
Slides 2006-7 Doulos Ltd. All rights reserved.
Building a SystemVerilog
Universal Verification Component
CONTENTS
Introduction
System to be Verified
module
module
rom
rom
Bus
module
module
sram
sram
module
module
cpu
cpu
module
module
bus_arbiter
bus_arbiter
module
module
serial_io
serial_io
write
write
clock
clock
enables
enables should
should each
each stay
stay high
high for
for only
only
cycle
cycle
Verification
Verification Plan
Plan
Management (prioritisation, resource utilisation)
RTL
RTL Design
Design
Features
Features
Assertions
Assertions
Coverage
Coverage
Model
Model
Measure
Coverage-centric process
Tests
Tests
Verification
Verification
Environment
Environment
Run
Simulation
Simulation
Copyright
Slides2006-7
2006-7Doulos
DoulosLtd.
Ltd.AllAllrights
rightsreserved.
reserved.
Documents
Documents
Code
Code
The
The NBG
NBG output
output
pin
will
reflect
pin will reflect the
the
status
status of
of the
the
internal
internal FAIL
FAIL
register
register bit
bit
A
checksum
A checksum
calculated
calculated using
using
the
the CCITT-16
CCITT-16
polynomial
polynomial is
is
appended
appended
Back-annotate
coverage
Tests
Coverage Model
program
program test1;
test1;
random_seed
random_seed == ...
...
verif_env(bus_if)
verif_env(bus_if)
covergroup
covergroup ...
...
covergroup...
covergroup...
covergroup...
covergroup...
covergroup
covergroup
cover
cover ...
...
cover
cover ...
...
Tests inspired
by features
program
program test2;
test2;
constraint
constraint {{ ...
... }}
verif_env(bus_if)
verif_env(bus_if)
5:
5: ifif (en)
(en)
5:
q
5: q <=
<= d;
d;
0:
0: else
else
Test program
initial
Test definition
Sequence task calls
env
Config
Protocol check
Coverage
collector
Monitor
BFM interface
Environment contains
multiple UVC modules
Protocol-specific
"Interface UVCs" built
from 1 or more agents
Monitor
BFM module
Interface encapsulates
bus signals
DUT interface
DUT
Slides 2006-7 Doulos Ltd. All rights reserved.
Master Agent
Sequence
driver
Config
Protocol check
Coverage
collector
Monitor
BFM interface
Monitor
BFM module
DUT interface
DUT
Slides 2006-7 Doulos Ltd. All rights reserved.
BFM interface
BFM module
DUT interface
DUT
Transaction Class
class
class ex_bfm_trans_c;
ex_bfm_trans_c;
rand
rand ex_bfm_trans_s
ex_bfm_trans_s tx;
tx;
ex_bfm_trans_c
ex_bfm_trans_c
tx
...
min_delay
max_delay
15
enable_
delay_
constraint
tx_delay_
range
...
int
int
int
int
bit
bit
min_delay;
min_delay;
max_delay;
max_delay;
enable_delay_constraint;
enable_delay_constraint;
Control
constraint
constraint tx_delay_range
tx_delay_range {{
Constraint
if
if (enable_delay_constraint)
(enable_delay_constraint)
tx.delay
tx.delay inside{[min_delay:max_delay]};
inside{[min_delay:max_delay]};
}}
function
function new();
new();
min_delay
min_delay == 1;
1;
...
...
endclass:
endclass: ex_bfm_trans_c
ex_bfm_trans_c
Constructor
Additional constraint
BFM interface
BFM module
...
endtask
endtask
task
task automatic
automatic get
get
(( output
output ex_bfm_trans_c
ex_bfm_trans_c TT );
);
...
DUT interface
DUT
endtask
endtask
task
task automatic
automatic done
done
(( input
input ex_bfm_trans_c
ex_bfm_trans_c TT );
);
...
endtask
endtask
...
Slides 2006-7 Doulos Ltd. All rights reserved.
Sequence
driver
BFM interface
BFM module
DUT interface
DUT
module
module ex_bfm_m
ex_bfm_m ((
ex_bfm_if
ex_bfm_if bfm_if
bfm_if ,,
input
input wire
wire DUT_clk
DUT_clk ,,
...
... );
);
ex_bfm_trans_c
ex_bfm_trans_c trans;
trans;
Interface
DUT signals
initial
initial
forever
forever begin
begin
Blocking
bfm_if.get(
bfm_if.get( trans
trans );
);
drive_transaction(
drive_transaction( trans
trans );
);
bfm_if.done(
bfm_if.done( trans
trans );
);
end
end
task
task drive_transaction
drive_transaction
(( input
input ex_bfm_trans_c
ex_bfm_trans_c TT );
);
...
...
Signal wiggles
Slides 2006-7 Doulos Ltd. All rights reserved.
Monitor
...
... );
);
mem_write:
mem_write: cover
cover property
property ((
@(posedge
@(posedge DUT_clk)
DUT_clk)
first_match(
first_match(
bus_if.wr
bus_if.wr
##1[1:$]
##1[1:$]
bus_if.wack
bus_if.wack ))
)) cover_mem_wr(bus_if.addr,
cover_mem_wr(bus_if.addr, ...);
...);
Called when sequence matches
DUT interface
DUT
property
property after_we;
after_we;
@(posedge
@(posedge bus_if.clk)
bus_if.clk) disable
disable iff
iff
(bus_if.reset)
(bus_if.reset)
bus_if.we
bus_if.we |=>
|=> ((
!bus_if.we
!bus_if.we &&
&& !bus_if.re);
!bus_if.re);
endproperty:
endproperty: after_we
after_we
assert
assert property
property (after_we);
(after_we);
Slides 2006-7 Doulos Ltd. All rights reserved.
Functional Coverage
...
... );
);
ex_trans_fifo
ex_trans_fifo tx();
tx();
Coverage
Collector
Interface "channel"
ex_cov_collector_m
ex_cov_collector_m c1(.trans(tx));
c1(.trans(tx));
Called when sequence matches
Monitor
DUT interface
function
function void
void cover_mem_wr(...);
cover_mem_wr(...);
mem_trans_t
mem_trans_t tdata;
tdata;
...
...
tx.put(tdata);
tx.put(tdata);
Call interface method
endfunction
endfunction
...
...
DUT
Monitor
covergroup
covergroup cov_mem_acc;
cov_mem_acc;
mon_addr:
mon_addr: coverpoint
coverpoint addr_cp
addr_cp {{
bins
bins all[]
all[] == {{ [0:15]
[0:15] };
};
ignore_bins
ignore_bins bad
bad == {0,5,8};
{0,5,8}; }}
...
...
mem_w:
mem_w: cross
cross mon_addr,
mon_addr, mon_rw;
mon_rw;
endgroup
endgroup
cov_mem_acc
cov_mem_acc mem_c
mem_c == new;
new;
DUT interface
DUT
always
always
begin
begin ...
...
Blocking
trans.get(tx);
trans.get(tx);
addr
addr == tx.addr;
tx.addr; ...
...
mem_c.sample();
mem_c.sample();
Slides 2006-7 Doulos Ltd. All rights reserved.
Instance
Test program
initial
program
Randomization, classes
Postponed sampling and updating
Dynamic creation of objects
Master Agent
Sequence
driver
Config
BFM interface
Monitor
BFM module
module, interface
Verilog simulation semantics
Static object hierarchy
DUT interface
DUT
Slides 2006-7 Doulos Ltd. All rights reserved.
Conclusions
Copyright
Slides2006-7
2006-7Doulos
DoulosLtd.
Ltd.AllAllrights
rightsreserved.
reserved.