UVMArena
π FIFO UVM Testbench
A comprehensive Universal Verification Methodology testbench for FIFO design verification
Project Overview
The FIFO UVM Testbench is a complete, production-ready verification environment for testing FIFO (First-In-First-Out) designs using the Universal Verification Methodology. This project demonstrates best practices in UVM testbench design with comprehensive stimulus generation, coverage collection, and verification.
The testbench supports parameterized data width (8 bits) and depth (16 elements) FIFO with full handshake protocol including write acknowledge and read valid signals. It includes directed tests, random stimulus generation, reference model verification, and an advanced FIFO Tracker component for real-time operation monitoring.
FIFO Specifications
8
Data Width (bits)16
Depth (Elements)11
UVM Components3
Test Scenarios⨠Key Features
π― Complete UVM Environment
Fully functional testbench with agent, driver, monitor, sequencer, scoreboard, reference model, and coverage components.
π Coverage Collection
Functional coverage metrics tracking FIFO operations, control signals, and edge cases for completeness assessment.
π Reference Model
Behavioral model implementation providing golden reference for scoreboard comparison and expected results generation.
π Multiple Test Scenarios
Directed tests (fill, empty) and random stimulus generation for comprehensive and realistic verification coverage.
π FIFO Tracker (NEW)
Advanced transaction tracking with real-time occupancy monitoring, error detection, and detailed statistics reporting.
β‘ Efficient Constraints
Smart constraint distribution with weighted probability for realistic and comprehensive test stimulus generation.
π οΈ Technology Stack
Language
SystemVerilog
Methodology
UVM 1.2
Simulator
Riviera-PRO
ποΈ Testbench Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TESTBENCH (tb_top) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β FIFO Environment β β
β β ββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β FIFO Agent β β β
β β β ββββββββββββββββββββββββββββββββββββββββ β β β
β β β β Sequencer β Driver β Monitor β β β β
β β β ββββββββββββββββββββββββββββββββββββββββ β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β β
β β ββββββββββββββββΌβββββββββββββββ β β
β β βΌ βΌ βΌ β β
β β ββββββββββββ βββββββββββββ ββββββββββββ β β
β β βCoverage β βReference β βScoreboardβ β β
β β βCollector β βModel β β β β β
β β ββββββββββββ βββββββββββββ ββββββββββββ β β
β β β β
β β FIFO Tracker ββ Monitor β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββ β
β β DUT (FIFO) β β
β βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π§ Main Components
Sequence Item
Base transaction class with write/read controls and response feedback.
fifo_seq_item.svSequencer & Driver
Manages stimulus generation and applies transactions to DUT via virtual interface.
fifo_sequencer.sv, fifo_driver.svMonitor
Captures transactions from DUT on handshake signals. Non-intrusive observation.
fifo_monitor.svAgent
Hierarchical container connecting driver, monitor, and sequencer components.
fifo_agent.svReference Model
Behavioral FIFO model generating expected outputs for comparison.
fifo_ref_model.svScoreboard
Compares expected vs. actual results. Reports mismatches and statistics.
fifo_scoreboard.svCoverage Collector
Functional coverage tracking for states, operations, and edge cases.
fifo_coverage.svβ FIFO Tracker
Advanced transaction tracking with occupancy monitoring and statistics.
fifo_tracker.sv (NEW)π Test Scenarios
Directed Tests
- Fill Sequence: Fills FIFO to capacity, tests full condition
- Empty Sequence: Empties FIFO completely, tests empty condition
- Covers boundary conditions and edge cases
Random Testing
- Count: 20-200 transactions (configurable)
- Distribution: 50% read, 50% write, 80% idle cycles
- Comprehensive functional coverage
π FIFO Tracker - Key Capabilities
- β Real-time Occupancy Tracking - Monitor FIFO size dynamically
- β Transaction History Logging - Up to 1000 timestamped entries
- β Error Detection - Write-while-full and read-while-empty
- β Data Mismatch Detection - Verify data integrity
- β Comprehensive Statistics - Auto-generated end-of-sim reports
- β Public Query Methods - Dynamic access to occupancy and counts
π Project Files
Design & Testbench
βββ design.sv (DUT FIFO implementation)
βββ testbench.sv (Top-level testbench)
βββ fifo_if.sv (Virtual interface)
UVM Components
βββ fifo_pkg.sv (Package)
βββ fifo_seq_item.sv (Transaction)
βββ fifo_sequence.sv (Stimulus)
βββ fifo_sequencer.sv (Sequencer)
βββ fifo_driver.sv (Driver)
βββ fifo_monitor.sv (Monitor)
βββ fifo_agent.sv (Agent)
βββ fifo_env.sv (Environment)
βββ fifo_test.sv (Test classes)
Verification Components
βββ fifo_ref_model.sv (Reference model)
βββ fifo_scoreboard.sv (Scoreboard)
βββ fifo_coverage.sv (Coverage)
βββ fifo_tracker.sv (Transaction tracker) β
Documentation & Scripts
βββ documentation.html (Full documentation)
βββ run.sh (Simulation script)
βοΈ Quick Start
1. Compile the design and testbench:
vlib work
vlog -timescale 1ns/1ps design.sv testbench.sv
2. Run the simulation:
vsim -c tb_top -do "run -all; quit"
3. Run different test scenarios:
# Directed test (fill/empty)
vsim tb_top +UVM_TESTNAME=fifo_directed_test
# Random test
vsim tb_top +UVM_TESTNAME=fifo_rand_test
1000+
Lines of SystemVerilog
11
UVM Components
100%
Coverage Ready
Ready to Explore This Project?
Access the complete documentation, run simulations, and verify the FIFO design with comprehensive UVM testbench.
π Full Documentation π» View on GitHub