View on GitHub


Coroutine Co-simulation Test Bench

Download this project as a .zip file Download this project as a tar.gz file


cocotb is a coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python.

Latest release available source


VHDL and Verilog are both unsuitable for writing complex testbenches. eRM, SystemVerilog and the various SV based methodologies have emerged to address this deficiency. These verification methodologies are large and cumbersome, requiring specialist knowledge, significant time investment and expensive toolchains to achieve satisfactory verification. The overhead of setting up testbenches is onerous so often designers write small throwaway testbenches at a block level and defer the majority of verification to a large system level testbench.

Cocotb bridges this gap in order to make block-level testing useful, reusable, fast and accessible to a much wider skill-set. The net effect is that bugs will be discovered earlier in the design cycle which equate to significant time and cost savings.

Cocotb is ideally suited to FPGA development but also scales to ASIC environments. A testbench can be as simple as basic directed tests, through to a complex constrained random verification environment. Cocotb provides similar capabilities to UVM but with the productivity benefit of a higher-level language.

Cocotb is complete open-source, licensed under the BSD license and compatible with the Icarus Verilog simulator.

Why verify in Python?

For further details refer to the documentation.

NMI Slidedeck

Slides from the Potential Ventures presentation at the NMI FPGA Verification event:

Similar projects

MyHDL seeks to displace VHDL and Verilog with a Python framework that can generate synthesiable RTL.

Several examples exist of projects providing a VPI interface into a language other than C:

Cocotb tries to build on the advances made by these projects while learning from the direction of UVM and other verification standards.