Documente Academic
Documente Profesional
Documente Cultură
by
Mark Litterick
Verification Consultant
Verilab GmbH, Munich, Germany
Sponsored By:
Introduction
Motivation
inconsistent SVA setup across clients & projects
many protocols where adaptive SVA required
SVA encapsulation in UVM
why, what & where?
Techniques for making SVA configuration-aware
why & how?
Techniques for making SVA phase-aware
automatically self-configuring SVA checks
initial build and dynamic run-time configuration
2 of 19
Sponsored By:
ENV
All checks belong to UVC
UVC
SVA
C S D
VIF
M
VIF
4 of 19
Sponsored By:
5 of 19
Sponsored By:
SVA Interface
config db
VIF
config_db::get config_db::set
ENV TESTBENCH
UVC MODULE this interface is required
AGENT I/F for UVC-DUT signals
M VIF D VIF +SVA
... but what about SVA?
DUT
OTHER AGENTS
OTHER
I/F
OTHER UVCS
6 of 19
Sponsored By:
SVA Encapsulation
interface my_interface;
Lines of Code
// local signal definitions
// modport declarations
// clocking blocks Signal
// bus-functional methods Connections
SVA Checks
// support code for SVA
// property definitions
// assertion statements
SVA checks create clutter
endinterface
in interface construct
7 of 19
Sponsored By:
Interface in Interface
interface my_interface; I/F interface my_sva_checker(
// local signals SVA // signal ports
logic CLK; input logic CLK,
logic REQ; input logic REQ,
logic ACK; input logic ACK,
logic [7:0] DATA; input logic [7:0] DATA
logic OTHER; );
... // support code
// modports, etc. // properties
... implicit instantiation // assertions
// protocol checker endinterface
my_sva_checker
sva_checker(.*);
ports have same name as interface signals
endinterface (but can be a subset)
SVA Configuration
UVC TESTBENCH MODULE
AGENT
C INTERFACE
MON VIF
C SVA C
C DUT
interface my_sva_checker(...);
CONTROL
// control knobs KNOBS
bit checks_enable = 1; No class variables inside
// config object CONFIG concurrent assertions
my_config cfg; FIELDS
// local variables for SVA
class variables are
my_speed_enum cfg_speed_mode;
int unsigned cfg_max_value;
allowed in support code
bit cfg_data_en;
// properties and assertions... Interface is not a
// update local vars from cfg... phased component
endinterface
when is config class built?
9 of 19
Sponsored By:
Method API
TESTBENCH MODULE
UVC INTERFACE
AGENT
C SVA C
MON VIF
C DUT
C
10 of 19
Sponsored By:
Interface Methods
interface my_sva_checker(...); INTERFACE
...
MON
function void set_config VIF
SVA C
(my_config cfg);
cfg_speed_mode = cfg.speed_mode; C
cfg_max_value = cfg.max_value;
cfg_data_en = cfg.data_en;
endfunction required fields well encapsulated
function void set_checks_enable
internal SVA details well hidden
(bit en);
checks_enable = en; interface my_interface;
endfunction ...
...
function void set_config(my_config cfg);
endinterface sva_checker.set_config(cfg);
endfunction
function void set_checks_enable(bit en);
user API via VIF methods sva_checker.set_checks_enable(en);
endfunction
...
endinterface
11 of 19
Sponsored By:
12 of 19
Sponsored By:
call set_config
via virtual interface
must be PASSIVE component when update required
13 of 19
Sponsored By:
Phase-Aware Interface
TESTBENCH MODULE
UVC INTERFACE
AGENT
C SVA C
MON VIF
C DUT
C
14 of 19
Sponsored By:
SVA C CLASS
locally declared class can see
all local variables in interface
interface my_sva_checker(...);
// declare local variables (cfg, checks_enabled, etc.)
...
class checker_phaser extends uvm_component;
// use local variables (cfg, checks_enabled, etc.)
// use UVM phases (build, connect, run, etc.)
endclass
// construct unique instance of phaser class
// (at the top-level under uvm_top)
checker_phaser m_phase = new($psprintf("%m.m_phase"));
endinterface
unique name required for multiple instances
Parallel Phases
UVM_TOP
UVM phases run in parallel
ENV SVA UVM phase
CLASS CLASS
16 of 19
Sponsored By:
Conclusion
Practical suggestions for SVA encapsulation
basic encapsulation inside interface
Demonstrated solutions for configuration-aware SVA
API with demands on UVC class
phase-aware SVA checker with embedded class
Successfully used in both OVM and UVM projects
Validated with multiple tools in different clients
mark.litterick@verilab.com
19 of 19