- Overview
- Features
- Requirements
- Installation
- Project Structure
- Configuration
- Testing
- Contributing
- License
- Acknowledgments
The cocotb project is a Python-based chip verification framework that enables users to write testbenches using SystemVerilog for RISC-V cores. This library provides a coroutine-based testbench framework, allowing users to create modular and reusable tests with ease.
This repository is part of the universal-verification-methodology organization, which aims to improve open-source verification projects by providing comprehensive documentation and examples.
- Coroutine-based testbench framework written in Python, enabling efficient and flexible test development
- Support for RISC-V cores, including the Icelake and Romeo cores
- Built-in support for SystemVerilog constructs such as sequences and coverage groups
- Integration with popular verification libraries like UVM (Universal Verification Methodology) and VSVGA (Verification System Validation and Analysis)
- Extensive documentation and examples for easy adoption
- SystemVerilog simulator (e.g., Questa, VCS, Xcelium)
- Python 3.8+
- No external dependencies required
git clone https://github.com/universal-verification-methodology/cocotb.git
cd cocotb
git checkout masterimport cocotb
class MyDUT(cocotb.coroutine):
async def run(self):
await cocotb.start(cocotb.triggers.trigger_clock)
print("Hello, world!")
dut = MyDUT()
cocotb.fork(dut.run())This code example demonstrates the basic usage of Cocotb, a Python-based framework for verifying digital circuits. It shows how to define a coroutine (like a function) that runs concurrently with the simulation clock using cocotb.start(cocotb.triggers.trigger_clock).
- Testing a simple digital circuit with a single clock input
- Verifying a finite state machine's behavior under various input conditions
- Demonstrating how to use Cocotb's coroutine-based programming model for concurrent execution of tasks
cocotb/
├── src/
├── tests/
├── examples/
├── docs/
└── README.md
Key directories:
- Source code and modules
- Test directories for verification testbenches
- Example code and usage patterns
- Documentation
Configuration options can typically be set through:
- Environment variables
- Configuration files (if present)
- Command-line arguments
See the examples and source code for detailed configuration options.
To run the test suite:
# Run tests with make
make test
# Or navigate to test directory first
cd tests
make testContributions are welcome! Please follow these guidelines:
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Submit pull requests with clear descriptions
See CONTRIBUTING.md for more details.
This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the LICENSE file for details.
- universal-verification-methodology organization
- Original repository: https://github.com/universal-verification-methodology/cocotb
- All contributors to this project