Cocotb is an open source coroutine-based cosimulation testbench environment for verifying VHDL and SystemVerilog RTL using Python. It allows verification of chips like software; Productive, simulator-agnostic, in Python.
cocotb works with any hardware design that your preferred simulator (and cocotb supports all major simulators) can simulate – be it (System)Verilog, VHDL, a mixed language, or even a mixed-signal design!
With cocotb, you write testbenches and verification code in Python. In addition to all the goodies of the Python programming language and its ecosystem, cocotb provides a lean framework to efficiently write verification code.
Running a test has never been easier thanks to cocotb's built-in test runner with CI integration. Alternatively, you can integrate cocotb easily with your existing build and reporting system.
cocotb works with all commonly used RTL simulators: VCS, ModelSim and Questa, Xcelium, Riviera-PRO and Active-HDL, GHDL, CVC, Verilator and Icarus Verilog on Windows, Linux, and macOS. If your simulator of choice can simulate your RTL design, cocotb can verify it! cocotb is just a library, integrate it with your existing project automation.
Verification is all about productivity. With cocotb, your testbench can make use of the whole Python ecosystem: oover 400,000 extension packages, [answers to over two million questions on StackOverflow](answers to over two million questions on StackOverflow "answers to over two million questions on StackOverflow"), and a huge pool of books (including Python for RTL Verification, a book on cocotb itself!), blog posts, tutorials, and much more.
With cocotb, interfacing with existing infrastructure is easy. Do you want to talk to a golden model in your testbench? Or to real hardware, e.g. an FPGA or a logic analyzer? In most cases, that's just a matter of looking for existing Python bindings—like in this example, where a handful lines of code are sufficient to talk to MatLab!
Are you tired of writing custom test runner tooling? With cocotb, tests are automatically discovered and run. No more need for custom runners. The cocotb test runner by default produces regression results in the industry-standard Junit XML format, which is understood by most CI solutions, such as Jenkins, or Azure Pipelines.
cocotb is a true and independent open source project, developed by a loosely connected community of like-minded engineers which we collectively call the cocotb contributors. Everybody can be a cocotb contributor: we value providing support for other users, bug reports, feature requests, and improvements to our documentation just as much as we value code changes or help with releasing and maintaining cocotb. All development and decision making happens in the open on GitHub.
The cocotb source code licensing provides a level playing field for all. cocotb is licensed under a permissive BSD license with no Contributor License Agreement (CLA) or other copyright assignment mechanisms in place: every individual and every company can use and contribute to cocotb under the same terms.
The development of cocotb is coordinated by a group of experienced volunteers, the cocotb maintainers. Think of maintainers as the caretakers of the cocotb project: they create releases, review and approve code changes in pull requests, and often also do a fair amount of development.
cocotb is a project of the FOSSi Foundation, a UK-based not-for-profit, which provides legal, administrative, and financial support, but does not influence the technical direction the cocotb project is taking.
cocotb documentation can be found here. Documentation can also be found on GitHub here.
Download and installation instructions are here and on GitHub here.
The current stable version of cocotb requires:
Python 3.6+
GNU Make 3+
A Verilog or VHDL simulator, depending on your :term:RTL
source code
COCOTB - VERIFICATION TB
Vendor
The FOSSi Foundation
Digital EDA
Free