Professional Documents
Culture Documents
CRV SW Limited
BFM CRV SW SW Driver C/SWSilicon
Block Level Functionality
Functionality Simple Functionality Bringup
Functional Minimal Boot
Block to Block Bring Up Tests Bring Up Tests
Bugs Code
Coverage Constraint
& Analysis Solver
Protocol Template
Debug Generators
Pass
Tape out!
???
Debug Debug
Fail testbench RTL code
Self-checking
random environment
development time
Time
Phases of Verification
Start with fully random environment. Continue with more
and more focused guided tests
Goal
% Coverage
Difficult to reach
Corner-case
Verification
Time
Build verification
environment
Typical Testbench Architecture
SystemVerilog testbench structure
Testcase
Testcase
Testcase Collection of testcases
Testcase
Creates
random Coverage
Test
transactions
Sequencer Sequencer
Self Check
Process Reacts to
transactions transactions
Driver Monitor Monitor Driver
Interface
DUT RTL
UVM Testbench Architecture
Test Entry Program
Test
Test
Layer Environment
Master Agent Slave Agent
Container
Layer
Coverage
Sequencer Sequencer
Scoreboard
Transaction
Layer
Driver Monitor Monitor Driver
Physical
Layer
Harness Module
UVM Encourages Encapsulate for Reuse
Structure should be architected for reuse
Test instantiates
the environment Top Level Harness
and modifies the
environment on a Test
testcase by
testcase basis
Environment
Agents, coverage Master Agent Slave Agent
and scoreboard Coverage
should be
encapsulated in Sequencer Scoreboard Sequencer
an environment
Sequencer, driver
and monitor Bus Bus
associated with an Driver Monitor Monitor
Driver
interface should be
encapsulated as
an agent for that
interface DUT
UVM Structure is Scalable
Agents are the building blocks across test/projects
Program
Test
Environment
Scoreboard
Slave Agent
Slave Agent
Master Agent Passive Slave Agent
A Coverage Sequencer
g Sequencer
Sequencer e Scoreboard Sequencer
n
t
Bus
Bus Driver
MonitorDriver
Driver Monitor Monitor Monitor Driver
Monitor
DUTB
DUTB
DUTB
DUTA DUTB
Structural Support in UVM
Structural & Behavioral
uvm_component
uvm_test Top Level Harness
uvm_env
uvm_agent Test
uvm_sequencer
uvm_driver Environment
uvm_monitor
uvm_scoreboard Master Agent Slave Agent
Coverage
Communication Sequencer Sequencer
uvm_*_port Scoreboard
uvm_*_socket
Data
Driver Bus Bus Driver
uvm_sequence_item Monitor Monitor
DUT
Typical UVM Usage scenarios
UVM based Constrained Random Verification (CRV) for
RTL Block/IP Verification using
UVM based VIPs with Constrained Random tests
Usage of standard 3rd Party UVM VIPs in IP/Subsystem
Verification
Generating SoC Block Traffic
IP verification using Re-use of IP level testbench at
SOC/System level
UVM VIPs as peripherals
UVM VIPs as passive monitors
Reuse of UVM Register layer from block to SOC level
Sequencer Monitor
Refer to existing
coverage object no
Driver Monitor
need to do rewrites
Low-level transactions of coverpoints or
Driver Monitor covergroups
Block-level transactions
Driver Monitor
DUT
UVM Constrained Random Verification
Quick tracing of sequences through phases and sequencers
Enables Next-Generation VIP
Architecture
Customization Coverage
Time to 1st Test
User Configuration
Sequence Configuration
Verification
Collection Creator Creation GUI
Plan
Built-in test plan
Sequence Collection
Testbench Protocol
Test Plan Time to Verify
Native Native SystemVerilog
Protocol VIP
SystemVerilog No wrappers
Configuration Coverage
Up to 4x faster
Database
Sequencer Time to Debug
Protocol-aware debug
Virtual Sequencer
Native UVM
Performance Validation for AXI Protocol Using UVM testbench
Measure bus bandwidth based on traffic profiles
Specification
System Verification
Architects Engineers
Performance Constraints
Performance Analysis
User sets
Performance constraints
Recording interval
Registration using UVM callbacks
UVM_ERROR for violation
Dynamically Configurable
Prints Performance Summary
************************************************************************
PERFORMANCE REPORT FOR MASTER 0:
************************************************************************
================================================
=================================================
Metric Compliance Checking
Visualize Performance Data in Graphs/charts/spreadsheets
Performance constraints can be fed into spreadsheets/EDA tools for checking
performance data
TCL
TCL File:
Apply
CSV File: CSV
Constraint Editor:
Architecture Exploration, TLM Verification, leveraging System C reference
models
Ref
Function
==?
Command DUT
HDL
Testbench
SystemVerilog
RTL
Hardware verification
Test bench
TLM = golden model
Represents key architectural components of
hardware platform
Simulates much faster than RTL 25
TLM-2.0 across SV and SC
Tool-specific mechanism
Not part of UVM
VCS: TLI-4
Open Source: UVM-Connect
SystemVerilog SystemC
Copy across
at method call
and return
Methodology Overview : How does it
Also Work from SC to work Data Pkt is user-
UVM direction defined/TLM2.0 Generic
Payload
TLI Adaptor
TLI bind function for connecting the SC
intiator/target with TLI adaptor
initiator/socket
Sequence
Data
Type converter
Function SystemC
model
UVM Testbench
Architecture
System Software
SoC
Test Cases CPU
Scenarios DUT ISS Periph Periph Transactor
Prototype Self-Check
System System
Mem Ctrl
IO IO
RTL
(Sub)-System
Monitor
Driver
RTL
Flash
Camera USB
Mem
DUT System/Device
A A
Interconnect
CPU B ISS B
C C
TLM-2.0
RTL & Fast Models
Speed and accuracy tradeoff
RTL full cycle accuracy
TLM transaction accuracy
Some intermediate points also available (consider ROI)
Model TLM TLM RTL RTL RTL
Virtualizer Co-Sim Co-Sim Backdoor
Speed Fast Fast Slow Slow/Med Slow
Interconnect
VIP
ISS B
C
Co-Simulation: Virtualizer TLM & RTL
Pin
USB USB VIP
ARM IFC
Trace Log FastModel
ARM Memory
Trace Log FastModel Model ELF
(TLM) (TLM) File
TLM/RTL Co-Simulation
Transaction level accuracy
Fast until RTL is touched
Minimal RTL to maintain speed
Minimal design changes, only when RTL is inserted
Co-Simulation: TLM & RTL
Ethernet Eth VIP
ARM
Pin
Trace Log FastModel
(TLM) IFC
USB USB VIP
Soc Fabric
ARM
FastModel
Pin Memory ELF
Trace Log
(TLM) IFC Model File
TLM/RTL Co-Simulation
Transaction level accuracy
Mostly RTL
Simulation performance similar magnitude range as RTL
simulation speed,
Design change required to add Pin Interfaces/Adapters
Protocol-Agnostic Tests
Test written using Generic Payload
Can work on any bus
Test Sequence Test Sequence
GP DUT GP DUT
layer layer
A X
AHB AXI
AHB
AXI
B VIP B VIP
VIP VIP
C Z
SoC A SoC B
VIP ARCHITECTURE FOR TLM GP
AMBA Sequences in SV
Snoop request
reactive sequence
AMBA
snoop
Tests request req
sequence
SNOOP rsp
Sequencer
AMBA
Sequences req
rsp Driver
Sequencer
AMBA Transactions
GP-Based Sequences in SV
Snoop request
reactive sequence
GP
snoop
Tests request req
sequence
SNOOP rsp
Sequencer
GP to AMBA
layering sequence
GP GP-to-AMBA
Sequences Layering req
req
rsp
GP rsp Driver
Sequencer Sequencer
uvm_tlm_generic_payload
+ AMBA Transactions
svt_amba_pv_extension
SystemC-Based Tests
Snoop request
b_snoop reactive sequence
To
FastModel b_fwd snoop
request req
sequence
SNOOP rsp
Sequencer
GP to AMBA
layering sequence
Directed GP GP-to-AMBA
Sequence Layering req
req
rsp
GP rsp Driver
Sequencer Sequencer
uvm_tlm_generic_payload
+ AMBA Transactions
svt_amba_pv_extension
FastModel Connection
b_snoop
UVMconnect / TLI-4
AMBA-PV
Bridge b_fwd AXI-to-GP
Layering
SNOOP
ARM Code Sequencer
FastModel Memory
One GP
Sequence
AMBA-PV
Slave
GP
Sequencer
SystemC SystemVerilog
UVM Transaction Debug
Library- VIP-
PLI task-
Embedded Embedded C function
based
Recording Recording API
API
Interface Interface
Verification Platform
FSDB
Trans, Attributes,
Relations
Transaction Debug Apps
Enhancing Post Process Testbench Debug
Sequencer
Transactions
TLM Port
Transactions
User Messages
System
Messages
Browser
Sync and
D&D
SV Testbench
Unified UVM+C
Stimulus/ Compare
Register Model
Sequences Output
C++ Testbench
Implementing a Unified Model
The standard UVM RAL(Register Abstraction Layer)
models the registers and memories of the Design
Under Test(DUT) in System Verilog(SV)
A C-model of the design exists and has a C++ based
environment. The APIs provided allow access of the
register fields and memories in the SV-RAL model
from the application level C code
The RAL-SV model can be updated from the C side or
the SV testbench. Any updates in the RAL-SV model
from the SV side are reflected in the C side
Introduction to RAL-C++ interface
Allows firmware and application-level code to be
developed and debugged in VCS
Preserve abstraction offered by the RAL
Hide physical address, field positions
Provides C++ API to access RAL components
Fields, Registers
Two versions of the RAL C++ API can be
generated
Interface to RAL model using DPI
Stand-alone C++ code targeted to S/W
RAL C API
Interrupts or
Unmodified
transition requests
C C SV
Firmware VCS
C Code Cosim API Low-Power
DPI Tests
RTL DUT
gcc Spec
.o Embedded
SW Application level code can now be verified
against a simulation and then used,
unmodified, in the final application
Execution timeline
Execution non concurrent unlike code
Rest of Simulation frozen when C code is running
Entire execution in C is in 0 time in the simulation timeline
Polling strategy can impact overall performance
Interrupt driven service strategy more ideal
Using UVM for mixed-AMS SOC
verification
D D A D
D A
D D
D D
D A
D D
D D
Basic Usage
System SPICE or
Electrical Real conversion Verilog r2e
Verilog-AMS
real Electrical
Asynchronous analog events
System SPICE or
AMS toggle coverage Verilog e2r
Verilog-AMS
real Electrical
Intermediate usage
AMS SystemVerilog assertions 0.6V
top.ev +Tol
AMS SystemVerilog testbench VDD=1.8V Vref
top.vref -Tol
AMS Checker Library
SystemVerilog Real Number Modeling
Easy XMR read access to internal analog Easy XMR write access to internal analog
signal voltage and current signal voltage.
$snps_get_volt(anode) $snps_force_volt(anode,val|real)
$snps_get_port_current(anode) $snps_release_volt(anode)
anode: full hierarchical analog node name anode: full hierarchical analog node name
val|real: absolute value or real variable
Example: Example:
real r; real r;
always @(posedge clk) initial
$snps_force_volt(top.i1.ctl,0.0);
r <=$snps_get_volt(top.i1.ctl);
Automatic insertion of a2d connect models Automatic insertion of d2a connect models
between SystemVerilog and SPICE. between SystemVerilog and SPICE.
User can re-define the threshold User can re-define the threshold
Example: Example:
reg rst_reg;
assign verilog_wire = assign top.i1.i2.x1.rst = rst_reg;
top.i1.i2.x1.clk; initial begin
initial begin ...
rst_reg = 1'b0;
verilog_reg = #5 rst_reg = 1'b1;
top.i1.i2.x1.strb; ...
... end
Asynchronous Analog Events
System SPICE or System SPICE or
Verilog event event
Verilog-AMS Verilog Verilog-AMS
event Electrical event Electrical
$snps_cross(aexpr[,dir[,time $snps_above(aexpr[,time_tol
_tol [,expr_tol]]]); [,expr_tol]]]);
aexpr: analog expression based on aexpr: analog expression based on
system function system function
Example: Example:
always always
@(snps_cross($snps_get_volt( @(snps_above($snps_get_volt(
top.i1.ctl)0.6,1)) top.i1.ctl)0.6))
begin begin
$display(Signal ctl is raising $display(Signal ctl is above
above 0.6V); 0.6V);
Instantiation of Analog DUT &
Testbench
DUT and testbench are instantiated and connected using SV
interface
VCS automatically inserts necessary e2r and r2e models
Common
synchronous module tb;
interface logic clk=1'b0;
ana_comp_if ana_if(clk);
SV Testbench
ana_test tst(ana_if);
always @(snps_cross($snps_get_volt(top.ev)0.6,1))
Asynchronous assert(top.vref.analog_node <= 1.8)
immediate else $error("Node is greater than VDD");
assertion of
analog node
0.6V
top.ev
VDD=1.8V
top.vref.analog_node
Node is greater
than VDD
AMS Testbench Checkers
SV interface containing
the Clock generator module test;
ana_vref_if ana_if();
spice_clk_ref ckref(ana_if.clk_out);
Clock generator
instance sv_ams_frequency_checker#(-2.25,+2.25, 2.5E6)
freq_meas = new(Freq Meas", "0", 0,
ana_if.clk_out);
Checks:
initial begin
Vmax=2.25V, @(posedge rst); // Wait end of reset
Vmin=-2.25V saw_freq_meas.start_xactor();
F=2.5MHz #2000 saw_freq_meas.stop_xactor();
Tolerance: +-1.0% saw_freq_meas.set_params(-1.8, +1.8, 2.5E6);
saw_freq_meas.start_xactor();
endmodule
Start/stop frequency
checking
Change vmin,
vmax Restart frequency
checking
AMS Testbench Checkers
Checkers
Vmin Vmin
UVM AMS Verification of A+D SoC
TEST
CHECK
Coverage
D
A D ...
D
D A D
class my_env extends uvm_component;
...
DUT sv_ams_sine_voltage_gen#(-1.0, +1.0, 1.0E6) sGen_IN;
AMS TB contain
analog blocks Sine Voltage function void build_phase(uvm_phase phase);
Gen super.build_phase(phase);
Vmax=1.0V, uvm_resource_db#(virtual ams_src_if)::
Vmin=-1.0V set("*", "uvm_ams_src_if", aif, this);
F=1.0MHz sGen_IN = sv_ams_sine_voltage_gen#
(-1.0, +1.0, 1.0E6)::type_id::create("sine", this);
Construct sin
endfunction
Wave generator.
Default is auto-run
throughout
run_phase()
Other use:
Verifying Analog IP before SoC
integration
Testcase
Coverage
Checkers
Self Chk
sv_ams_real
DUT
~ (Analog IP) ~
sv_ams_voltage
components
Enabling an UVM Testbench for
simulation acceleration
Testcase
COVERGROUPS
Coverage Collector
Reactive
Sequences
Scoreboard/Checker Sequences
Interface
Interface
Monitor Monitor
DUT
Sequencer
Sequencer
Driver Driver
Environment Transformations for TBA
UVM UVM
TLM
UVM _SC
TLM Verification Verification Plans Base Classes
SoC
VIPs &
DesignerTestbench
SPICE RTL Assertions Constraints
Scenarios
AMS-Testbench
UVM UVM UVM UVM
Low Power
AMS Digital Coverage UVM UVM-LP AMS
Debug UVM VIP
Verification Verification Analysis Base Classes Base Classes Base Classes
UVM
SCEMI/HAL
Synthesis Eqv. Chk P&R UVM Native SV transactors
FPGA Prototyping,
Emulation,
STA Physical
Gate Sim
Verification
Complete UVM Ecosystem
Coverage Constraint
& Analysis Solver
Protocol Template
Debug Generators