Professional Documents
Culture Documents
Module 5 UVM Testbench
Module 5 UVM Testbench
What is Methodology?
.❖ Best practices by verification experts
l
• The primary advantage is that the methodology specifies and lays out a set of
guidelines to be followed for creation of verification testbenches.
• This will ensure testbench uniformity between different verification teams,
cross-compatability between IP and standalone environment integration,
flexibility and ease of maintaining testbenches.
• For example, there can be many different ways to implement display messages
and control verbosity with different settings such as warning, error and debug.
• In UVM, the underlying reporting mechanism has been standardized and made
available so that engineers can instead focus on the most important part of their
job which is design verification.
• Another example is that the sequencer-driver handshake mechanism is taken
care of under the hood so that only stimulus needs to be written.
• This saves quite a lot of time in setting up a testbench structure since the
foundation itself is well defined.
How does UVM help ?
• The idea behind UVM is to enhance flexibility and reuse code so that the same testbench
can be configured in different ways to build different components, and provide different
stimulus.
• These new user defined configuration classes are recommended to be derived from
uvm_object .
• For example, a configuration class object can be built to have certain settings that define
how the testbench environment has to be built.
UVM Sequence
❖ component hierarchy,
❖ configuration database,
which enable the user to create virtually any structure for the
testbench.
Features of uvm_component Class
❖ hierarchy searching,
❖ phasing,
❖ configuration,
❖ reporting,
❖ factory,
❖ transaction recording
UVM Building Blocks
.
l
UVM UVM
UVM env
Components test
UVM Testbench
.
l
UVM Test
Sequences
UVM Environment
UVM Agent
UVM
Sequencer UVM Agent Design
UVM
Under Test
UVM
Scoreboard Environment ( DUT )
UVM
Config/Factory Environment
Overrides
UVM Testbench Architecture
Module TOP
UVM Test
UVM Env
Agent [0]
Sequencer Config
Config Interface
Sequencer [0]
Scoreboard 0
Scoreboard 0 Driver Driver
MonitorMonitor
Agent [1]
Config
Config Interface
Sequencer
Sequencer
[1]
Scoreboard 1
Scoreboard 1 Driver Driver
MonitorMonitor
➢ Instantiate
● Design under Test (DUT) module
● UVM Test class
➢ Dynamically Instantiate
● UVM Test
➢ Advantage
● compiled once
● run with many different tests.
UVM Test
----------------------
endclass
➢ So uvm_test is a component.
UVM Environment
Agent/UVC
Mem Controller Agent DUT
Component
Repository
UVM
UVM Driver
Sequencer Memory
Controller
UVM Monitor
Peripheral Agent
UVM
UVM Driver
Sequencer
Peripheral
UVM Monitor
UVM Environment
----------------------
endclass
➢ So uvm_env is a component.
UVM Environment (Example)
➢ UVM Agent
● Encapsulated, Ready to use, Configurable components
● Reusable - plug and play
Sequence
UVM Agent
UVM
UVM Driver
Sequencer
DUT
UVM Monitor interface
UVM Agent
● Sequencer
■ Manage stimulus flow
■ Route sequence_items from a sequence to the driver
● Driver
■ It converts sequence_item into the pin level for DUT
● Monitor
■ It converts pin level data to the transactions for use in scoreboard, coverage
models, etc
UVM Agent
● Other components
■ coverage collectors,
■ protocol checkers,
■ TLM mode
UVM Agent
----------------------
endclass
➢ So uvm_agent is a component.
UVM Agent
Interface
Config
DUT is_active = 0
UVM
Agent Monitor
vi
(Passive)
UVM
UVM
Sequen vi
Driver
Interface
cer
Config
DUT
is_active = 1
UVM
Agent Monitor
vi
(Active)
UVM Agent
● an active mode
● a passive mode
----------------------
endclass
➢ So uvm_sequencer is a component.
UVM Sequence
----------------------
endclass
➢ So uvm_sequence is a object.
UVM Driver
➢ TLM port
● Receive transactions from the Sequencer
● Access to the DUT interface in order to drive the signals.
UVM Driver
----------------------
endclass
➢ So uvm_driver is a component.
UVM Monitor
----------------------
endclass
➢ So uvm_sequence is a component.
UVM Scoreboard
• Receives data item’s from monitor’s and compares with expected values.
Summary : UVM Testbench Overview
.1. UVM Testbench
l
2. UVM Test
3. UVM Environment
4. UVM Agent
5. UVM Sequencer
6. UVM Sequence
7. UVM Driver
8. UVM Monitor