A comprehensive, modular learning path for mastering UVM (Universal Verification Methodology) and pyuvm (Python UVM implementation) with progressive complexity levels. This project provides a complete educational resource with examples, testbenches, and documentation covering all aspects of UVM verification.
- Overview
- Features
- Prerequisites
- Quick Start
- Project Structure
- Documentation
- Modules
- Installation
- Usage
- Contributing
- License
- Acknowledgments
This project is a complete educational resource for learning UVM verification methodology using pyuvm, a Python implementation of UVM 1.2. It provides:
- 8 Progressive Modules: From Python basics to real-world applications
- Comprehensive Examples: Over 50+ working examples with detailed explanations
- Complete Testbenches: cocotb and pyuvm testbenches for each module
- Automated Scripts: Installation and orchestration scripts for easy setup
- Full Documentation: Detailed guides covering all concepts and usage
- IEEE 1800.2 Coverage: Complete coverage of the UVM standard
- Open Source: Free and accessible to everyone
- Python Syntax: Easier to learn and read than SystemVerilog
- Full UVM 1.2: Complete implementation of the IEEE 1800.2 standard
- Works with Verilator: Fast, open-source simulation
- Better Tooling: Python IDE support, debugging, testing frameworks
- Modern Development: Async/await, type hints, comprehensive error handling
- β Complete UVM Coverage: All 12 sections of IEEE 1800.2 standard
- β Progressive Learning: 8 modules from beginner to advanced
- β Practical Examples: Real-world verification scenarios
- β Automated Setup: One-command installation scripts
- β Multiple Simulators: Support for Verilator and other open-source simulators
- β Virtual Environment Support: Isolated Python environments
- β Git Submodules: Easy tool management
- β Comprehensive Documentation: Detailed guides for every concept
- β
Slides & video: Per-module
slides.pptxundermedia/(see./scripts/build_all_media.sh) - β Production Quality: Best practices and industry patterns
- β Exercises: Hands-on practice for each module
- Hardware Description Languages: Basic understanding of Verilog/SystemVerilog
- Python Programming: Intermediate level (classes, decorators, async/await)
- Digital Design Concepts: Flip-flops, state machines, buses
- Verification Basics: Testbenches, assertions, coverage (helpful but not required)
- Operating System: Linux, macOS, or Windows (WSL2 recommended)
- Python: 3.10 or higher
- Memory: Minimum 4GB RAM (8GB+ recommended)
- Disk Space: ~2GB for tools and dependencies
git clone <repository-url>
cd learn_uvm_pyuvm# Make scripts executable (Linux/Mac/WSL)
chmod +x scripts/*.sh
# Install all tools with default settings
./scripts/module0.sh# Run Module 1 examples
./scripts/module1.sh
# Or run specific examples
./scripts/module1.sh --python-basics
./scripts/module1.sh --cocotb-tests./scripts/build_all_media.sh --regenerate-outlines --pptx-only # decks only
./scripts/build_all_media.sh --install-deps # + PDF + videoSee media/INDEX.md for links to each module deck.
Begin with Module 0: Installation and Setup and follow the modules sequentially.
learn_uvm_pyuvm/
βββ docs/ # Comprehensive documentation
β βββ MODULE0.md # Installation and setup guide
β βββ MODULE1.md # Python and verification basics
β βββ MODULE2.md # cocotb fundamentals
β βββ MODULE3.md # UVM basics
β βββ MODULE4.md # UVM components
β βββ MODULE5.md # Advanced UVM concepts
β βββ MODULE6.md # Complex testbenches
β βββ MODULE7.md # Real-world applications
β βββ MODULE8.md # UVM miscellaneous utilities
β βββ STUDY.md # Complete study plan
β βββ PYTHON_VERILOG_INTERACTION.md # Python-Verilog interaction guide
β βββ COVERAGE_CHECKLIST.md # Coverage verification
β βββ IEEE_1800_2_COVERAGE.md # IEEE standard coverage
β βββ GLOSSARY.md # UVM terminology
β
βββ module0/ # Installation scripts and tools
βββ module1/ # Python basics and verification fundamentals
β βββ examples/ # Python examples
β βββ dut/ # Design Under Test (Verilog)
β βββ tests/ # Testbenches (cocotb and pyuvm)
βββ module2/ # cocotb fundamentals
βββ module3/ # UVM basics
βββ module4/ # UVM components
βββ module5/ # Advanced UVM concepts
βββ module6/ # Complex testbenches
βββ module7/ # Real-world applications
βββ module8/ # UVM utilities
β
βββ media/ # Slides, PDF, video (module-to-slides-video)
β βββ moduleN/ # outline.yaml, slides.pptx, assets/
βββ scripts/ # Automation scripts
β βββ build_all_media.sh # Build all module decks + PDF + video
β βββ module0.sh # Install all tools
β βββ module1.sh # Run Module 1 examples
β βββ ... # Module orchestrators
β βββ install_*.sh # Individual tool installers
β βββ uninstall_*.sh # Tool uninstallers
β
βββ tools/ # Git submodules for tools
β βββ verilator/ # Verilator simulator
β βββ cocotb/ # cocotb framework
β βββ pyuvm/ # pyuvm library
β
βββ README.md # This file
The docs/ directory contains comprehensive documentation for the entire learning path:
- STUDY.md: Complete study plan with learning path, schedule, and resources
- PYTHON_VERILOG_INTERACTION.md: Detailed guide on Python-Verilog interaction using cocotb
Each module has a dedicated guide with examples, exercises, and detailed explanations:
-
MODULE0.md: Installation and Setup
- System requirements, tool installation, environment setup
- Automated installation scripts usage
- Verification checklist
-
MODULE1.md: Python and Verification Basics
- Python OOP, decorators, async/await
- Data structures for verification
- Error handling and logging
- Basic testbenches
-
MODULE2.md: cocotb Fundamentals
- Signal access, clock generation, triggers
- Reset patterns, common verification patterns
- cocotb testbenches for registers, FIFOs, state machines
-
MODULE3.md: UVM Basics
- UVM class hierarchy, phases, reporting
- ConfigDB, factory pattern, objections
- Basic UVM testbenches
-
MODULE4.md: UVM Components
- Drivers, monitors, sequencers, sequences
- TLM (Transaction-Level Modeling)
- Scoreboards, agents, complete testbenches
-
MODULE5.md: Advanced UVM Concepts
- Virtual sequences, coverage models
- Configuration, callbacks, register models
- Advanced testbench patterns
-
MODULE6.md: Complex Testbenches
- Multi-agent environments, protocol verification
- Protocol checkers, multi-channel scoreboards
- System-level testbench architecture
-
MODULE7.md: Real-World Applications
- DMA verification, protocol verification (UART, SPI, I2C)
- VIP development, best practices
- System-level verification
-
MODULE8.md: UVM Miscellaneous Utilities
- Command Line Processor, comparators, recorders
- Pools, queues, string/math/random utilities
- Utility integration patterns
- COVERAGE_CHECKLIST.md: Verification checklist for all IEEE 1800.2 sections
- IEEE_1800_2_COVERAGE.md: Detailed mapping of IEEE standard to modules
- GLOSSARY.md: Comprehensive glossary of UVM terms and concepts
Complexity: Beginner
Set up your verification environment with all required tools:
- Verilator (simulator)
- cocotb (coroutine-based testbench framework)
- pyuvm (Python UVM implementation)
Quick Start: ./scripts/module0.sh
Complexity: Beginner
Learn Python concepts essential for verification:
- Python OOP (classes, inheritance)
- Decorators and context managers
- Async/await for simulation
- Data structures for verification
- Error handling and logging
Quick Start: ./scripts/module1.sh
Complexity: Intermediate
Master cocotb for hardware verification:
- Signal access and manipulation
- Clock generation and triggers
- Reset patterns
- Common verification patterns
- Testbenches for registers, FIFOs, state machines
Quick Start: ./scripts/module2.sh
Complexity: Intermediate
Introduction to UVM methodology:
- UVM class hierarchy
- Phases (build, connect, run, check, report)
- Reporting and logging
- ConfigDB for configuration
- Factory pattern
- Objections
Quick Start: ./scripts/module3.sh
Complexity: Intermediate-Advanced
Build complete UVM testbenches:
- Drivers, monitors, sequencers
- Sequences and sequence items
- TLM (Transaction-Level Modeling)
- Scoreboards
- Agents and environments
Quick Start: ./scripts/module4.sh
Complexity: Advanced
Advanced UVM features:
- Virtual sequences and sequencers
- Coverage models
- Configuration and callbacks
- Register models
- Multi-channel environments
Quick Start: ./scripts/module5.sh
Complexity: Advanced
Build production-quality testbenches:
- Multi-agent environments
- Protocol verification
- Protocol checkers
- Multi-channel scoreboards
- System-level architecture
Quick Start: ./scripts/module6.sh
Complexity: Advanced
Apply UVM to real-world scenarios:
- DMA verification
- Protocol verification (UART, SPI, I2C)
- VIP development
- Best practices and patterns
- System-level verification
Quick Start: ./scripts/module7.sh
Complexity: Intermediate-Advanced
Master UVM utility classes:
- Command Line Processor
- Comparators
- Recorders
- Pools and queues
- String, math, and random utilities
Quick Start: ./scripts/module8.sh
# Install all tools
./scripts/module0.sh
# Or install with custom options
./scripts/module0.sh --verilator-mode submodule --cocotb-mode pip --pyuvm-mode pip# Verilator
./scripts/install_verilator.sh [--from-submodule|--system|--source]
# cocotb
./scripts/install_cocotb.sh [--pip|--from-submodule] [--venv DIR]
# pyuvm
./scripts/install_pyuvm.sh [--pip|--from-submodule] [--venv DIR]See MODULE0.md for detailed manual installation instructions.
Each module has an orchestrator script to run examples and tests:
# Run all examples for a module
./scripts/module1.sh
./scripts/module2.sh
# ... etc
# Run specific examples
./scripts/module1.sh --python-basics --decorators
./scripts/module2.sh --signal-access --clock-generation
# Run tests
./scripts/module1.sh --cocotb-tests --pyuvm-tests# Activate virtual environment
source .venv/bin/activate
# Run Python example
cd module1/examples/python_basics
python3 transaction.py
# Run cocotb test
cd module1/tests/cocotb_tests
make SIM=verilator TEST=test_and_gate
# Run pyuvm test
cd module1/tests/pyuvm_tests
make SIM=verilator TEST=test_and_gate_uvm# Module 8: CLP example
cd module8/examples/clp
python3 clp_example.py +test_mode=stress +num_transactions=20 +seed=42Contributions are welcome! This project follows best practices for educational resources:
- Code Quality: All code follows Python best practices with type hints and docstrings
- Documentation: Comprehensive docstrings and comments
- Testing: Examples are tested and verified
- Consistency: Follow existing patterns and structure
- Follow the existing code style and structure
- Add comprehensive docstrings to all functions and classes
- Include type hints for all code
- Update relevant documentation
- Test your changes thoroughly
- Follow the module structure for new examples
This work is licensed under a Creative Commons Attribution 4.0 International License.
-
β You are free to:
- Share β copy and redistribute the material in any medium or format
- Adapt β remix, transform, and build upon the material for any purpose, even commercially
-
π Under the following terms:
- Attribution β You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
When using this material, please include:
Based on "Learn UVM with pyuvm" by [Your Name/Organization]
Licensed under CC BY 4.0
https://creativecommons.org/licenses/by/4.0/
This project is built on the excellent work of:
-
pyuvm: Python implementation of UVM 1.2 by Ray Salemi
- Website: https://pyuvm.readthedocs.io/
- GitHub: https://github.com/pyuvm/pyuvm
-
cocotb: Coroutine-based testbench framework
- Website: https://docs.cocotb.org/
- GitHub: https://github.com/cocotb/cocotb
-
Verilator: Fast Verilog/SystemVerilog simulator
-
UVM: Universal Verification Methodology
- Standard: IEEE 1800.2-2020
- Accellera Systems Initiative
- UVM 1.2 User's Guide (Accellera Systems Initiative)
- Verification Academy: https://verificationacademy.com/
- IEEE Design & Test publications
- DVCon proceedings
For questions, issues, or contributions:
- Check the documentation first
- Review the GLOSSARY.md for terminology
- Check COVERAGE_CHECKLIST.md for module coverage
- Open an issue for bugs or feature requests
- 8 Modules: Complete learning path
- 50+ Examples: Working code examples
- 20+ Testbenches: cocotb and pyuvm testbenches
- 15+ Scripts: Automation and orchestration
- 13 Documentation Files: Comprehensive guides
- 100% IEEE 1800.2 Coverage: All standard sections covered
Happy Learning! π
Start your UVM journey today with Module 0: Installation and Setup
