--- id: cocotb version: "2.0.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # cocotb — cocotb is a coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python. License: permissive · Maintenance: active · Downloads: 589.2K/mo ## What it is and what it does cocotb is a Python-based testbench framework that lets hardware engineers write verification code in Python instead of VHDL or Verilog. It uses coroutines to drive and monitor HDL simulations, bridging the gap between Python's ease of use and the low-level requirements of hardware verification. The framework handles the communication between your Python test code and a running HDL simulator, allowing you to read and write signals, check assertions, and orchestrate complex test scenarios. The package is designed for digital design verification workflows where you need to test RTL (register-transfer level) designs. It depends on find_libpython to locate the Python runtime, and requires an external HDL simulator to actually run the tests. The project is actively maintained, supports Python 3.6 through 3.13, and has been in development since 2018, with a mature ecosystem of extensions and community resources. Use it for: - Verify VHDL or Verilog RTL designs by writing test scenarios in Python instead of hardware description languages - Automate regression testing for digital designs by integrating testbenches into CI/CD pipelines - Rapidly prototype hardware verification by leveraging Python's standard libraries and testing frameworks - Drive complex stimulus patterns and monitor design behavior across multiple simulation runs - Combine Python data processing with HDL simulation for algorithm validation in hardware ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. cocotb is a Python framework for writing testbenches that simulate and verify VHDL and Verilog hardware designs through coroutine-based cosimulation. Yes, if you are developing or verifying VHDL or Verilog designs and want to write testbenches in Python. The framework is actively maintained, supports current Python versions, has no known vulnerabilities, and carries a permissive license. Install friction is moderate due to compiled wheels, but the broad platform support (macOS, Linux, Windows; x86_64, ARM, i686) mitigates this. Verify that your target HDL simulator is compatible before committing. ## Install pip install cocotb uv add cocotb poetry add cocotb ## Installing cocotb Before you install: Medium install friction due to compiled wheel distribution across multiple Python versions and architectures. The project is actively maintained with recent commits and a stable release cadence, suggesting reliable ongoing support. License in practice: BSD-3-Clause is a permissive license allowing commercial use, modification, and distribution with minimal restrictions—suitable for most projects. Quickstart: pip install cocotb import cocotb from cocotb.triggers import Timer @cocotb.test() async def simple_test(dut): await Timer(1, units='ns') Requires a compatible HDL simulator (e.g., Icarus Verilog, GHDL, or commercial simulators) and appropriate environment setup to run testbenches against actual designs. Verify before relying: - Which specific HDL simulators are officially supported or tested with version 2.0.1 - Whether the single runtime dependency find_libpython is sufficient or if system libraries are also required - Performance characteristics or scalability limits for large testbenches ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 589.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags vhdl verilog testbench python, hardware simulation testing, rtl verification framework, digital design cosimulation, hdl testbench automation, python hardware testing, verilog simulation framework, hdl-verification, hardware-testing, cosimulation [View on SkillFed](https://skillfed.io/packages/cocotb) · [View on PyPI](https://pypi.org/project/cocotb/)