Verification with UVM - Part 2
Table of Contents
-
Part 1 Recap: Setting the Stage
- Review of UART DUT: Interface and Software Views
- Summary of UART Testbench Tests
- Deep Dive: Word Format Poll Test
- Simulation Log and Waveform Correlation
- Key Takeaways -
Introduction to UVM Testbench Implementation
- Objective and Agenda -
Quick Refresher on Core UVM Concepts
- Test vs. Environment Roles
- Components vs. Objects
- Configuration Database
- UVM Phases
- Factory
- Modeling Transactions
- End of Test Handling
- TLM (Transaction-Level Modeling)
- Sequences and Sequencers
- UVM Base Class Hierarchy
- Utility Classes -
Testbench Directory Structure and Organization
- Top-Level Folders
- Inside UVM_TB Folder
- Code Exploration Techniques -
UVM Testbench Core View and Component Interaction
- DUT Interfaces
- Agent Instantiation
- Analysis Components
- Register Abstraction Layer (RAL)
- Virtual Sequencer
- Environment Configuration
- Test and Environment Interaction
Part 1 Recap: Setting the Stage
Review of UART DUT: Interface and Software Views
Summary of UART Testbench Tests
Deep Dive: Word Format Poll Test
Simulation Log and Waveform Correlation
Key Takeaways
- APB interface for control/data
- TXD/RXD for serial data
- Control via configuration registers
Introduction to UVM Testbench Implementation
Objective and Agenda
- Understanding how UVM testbench replicates observed functionality
- Overview of directory structure, components, stimulus, checks, coverage
Quick Refresher on Core UVM Concepts
Test vs. Environment Roles
- Test drives config and stimulus
- Environment performs checks and sequences
Components vs. Objects
- Components: Persistent (test, env, monitor, etc.)
- Objects: Dynamic (sequence items, sequences)
Configuration Database
uvm_config_db
for hierarchical configuration passing
UVM Phases
- Focus: Build, Connect, Run, Check, Report
Factory
- Creation/registration without deep dive into overrides
Modeling Transactions
- Sequence item creation using
uvm_sequence_item
End of Test Handling
- Using
raise_objection
/drop_objection
TLM (Transaction-Level Modeling)
- For communication between UVM components
Sequences and Sequencers
- Starting sequences on specific sequencers
UVM Base Class Hierarchy
uvm_object
uvm_sequence_item
→uvm_sequence
uvm_component
→uvm_test
,uvm_driver
,uvm_monitor
,uvm_env
Utility Classes
- Config DB, reporting, and logging
Testbench Directory Structure and Organization
Top-Level Folders
uart_example/
agents/
(APB, UART, Modem)docs/
protocol_monitor/
rtl/
sim/
UVM_TB/
Inside UVM_TB Folder
env/
– Scoreboards, checkers, coveragereg_model/
– RALsequences/
tb/
– TB top moduletests/
virtual_sequences/
Code Exploration Techniques
find
,grep
,xargs
to explore testbench code
UVM Testbench Core View and Component Interaction
DUT Interfaces
- APB, TXD, RXD
Agent Instantiation
- APB (active), UART TX (passive), UART RX (active)
Analysis Components
- TX Scoreboard
- RX Scoreboard
- TX Coverage Model (sampled only on valid TX)
Register Abstraction Layer (RAL)
- High-level register access, translated by adapters
Virtual Sequencer
- Orchestrates multiple interface sequences
Environment Configuration
- Carries interface handles and flags
Test and Environment Interaction
- Test sets config, launches virtual sequences
SystemVerilog Packages and Code Organization
reg_package
,uart_agent_pkg
,apb_agent_pkg
,modem_agent_pkg
,env_pkg
, etc.env_pkg
includes all scoreboards, monitors, checker modules, and env config
Connecting DUT to Testbench (tb_top.sv)
Steps to Connect
- Instantiate DUT
- Instantiate interfaces (
apb_if
,uart_if
, etc.) - Connect interfaces to DUT ports
- Pass interfaces via
uvm_config_db
```systemverilog uvm_config_db#(virtual apb_if)::set(uvm_root::get(), "UVM_TEST_TOP", "apb_if", apb_if_inst);