Further Resources - cocotb/cocotb GitHub Wiki
Talks, Papers, Books, Blogposts...
Al-Hakeem Hayder (Wärtsilä Oy) "Simple yet powerful: Open-source HDL simulation with Cocotb" (DVClub, October 2024) (slides)
Philipp Wagner (FOSSi Foundation, IBM) "Cocotb 2.0: Modernize your testbenches for even more productivity" (DVClub, October 2024) (slides)
Grant Bowers (Garrison) "How cocotb saved us £1000s & 1000s of hours" (DVClub, October 2024) (slides)
Christian Tchilikov (Semify GmbH) "Utilizing Cocotb for Efficient Functional Verification" (FPGA Front Runner: FPGA Verification Strategies, September 2024)
Philipp Wagner (FOSSi Foundation, IBM) "cocotb is making verification fun!" (FPGA Front Runner: FPGA Verification Strategies, September 2024)
Kaleb Barrett (Hudson River Trading) "cocotb Gets A Glow Up: Fixes and Features of 2.0" (ORConf, September 2024) (slides)
Marek Cieplucha "cocotb as a way towards a new verification methodology" (ORConf, September 2024)
Peter Birch (VyperCore) "Forastero: cocotb testbenches with batteries included" (ORConf, September 2024) (slides)
Stuart Alldred (VyperCore) "Buckets of Coverage" (ORConf, September 2024) (slides)
Matthew Ballance (AMD) "PyHDL-IF: An Easy-to-Use Python/HDL Cross-Calling Interface" (LatchUp, April 2024) (video)
Miikka Sinervä (University of Oulo) "Master's Thesis: UVM Testbench In Python: Feature And Performance Comparison With SystemVerilog Implementation" (June 2023) (paper)
Lavanya Jagadeeswaran (Vyoma Systems) "Verification Makeover with RISC-V Processor Designs using CoCoTb" (June 2023) (slides)
Philipp Wagner (FOSSi Foundation, IBM) "How cocotb made Python-powered verification mainstream -- and what comes next" (ORConf, September 2023) (video)
Philipp Wagner (FOSSi Foundation, IBM) "Make Verification Fun Again with Python and cocotb" (DVClub Europe, January 2023) (video)
Markus Koch "Lazy People's Guide to Writing Test Benches" (December 2022) (Video)
Vijayvithal Jahagirdar "cocotb tutorial" (October 2022) (Videos)
Ray Salemi Python for RTL Verification: A complete course in Python, cocotb, and pyuvm (September 2022) (Book, ISBN 979-8582338147)
Rodrigo A. Melo "cocotb Tutorial" (March 2022) (slides)
Ahmed Alsawi "Cocotb Internals - Cocotb Startup VPI bootstrap to Python" (January 2022) (blogpost)
Ahmed Alsawi "Cocotb Deepdive - Test discovery" (November 2021) (blogpost)
Philipp Wagner/FOSSi Dial-Up "The long path to a sustainable cocotb community" (May 2021) (video)
The Data Bus "A gentle introduction to CocoTb" (March 2021)
Alex Forencich "FPGA Dev Live Stream: Working with cocotb" (December 2020) (video)
Symbiotic EDA "Useful tools: pyfda and cocotb" (September 2020) (video)
Tomasz Hemperek "Testing 'the Python way' with cocotb and pytest" (WOSDV 2019) (slides)
Antmicro "Testing open source USB IP cores with Python and Cocotb" (2019-12) (blog)
Philipp Wagner (FOSSi Foundation, lowRISC) "News from cocotb land" (ORConf 2019) (video)
Philipp Wagner (FOSSi Foundation, lowRISC) "Cocotb: Python-powered hardware verification" (WOSH 2019) (video)
Andres Demski (Satellogic) "COCOTB: Testbenchs in Python" (spanish) (SPL 2019) (slides)
Smith, Andrew Michael; Mayo, Jackson; Armstrong, Robert C.; Schiek, Richard; Sholander, Peter E.; Mei, Ting (Sandia National Lab): "Digital/Analog Cosimulation using CocoTB and Xyce" (paper)
Ben Rosser (University of Pennsylvania) "Cocotb: a Python-based digital logic verification framework" (CERN 2018) (pdf)
Luke Darnell (Broadcom) "Another Introduction to Cocotb" (ORConf 2018) Video, Slides and Code
Marek Ciepłucha (TDK) "Cocotb as a comprehensive verification platform" (ORConf 2018) Video
Torbjørn Viem Ness (NTNU) "Low Power Floating-Point Unit for RISC-V" (2018) [PDF]
Aldec Inc. "Writing a Python Testbench" (2017/2018) Video, 2018, Video, 2017
Marek Ciepłucha, Witold Pleskacz "New Constrained Random and Metric-Driven Verification Methodology using Python" (DVCon 2017) Paper, Slides
Andrey Filippov (Elphel) "I will not have to learn SystemVerilog" (2016) [Blog]
Chris Higgs (Potential Ventures) "Applying agile techniques to FPGA development" Video, Paper
Chris Higgs (Potential Ventures) "Cocotb" (ORConf 2015) Video, Slides
Chris Higgs (Potential Ventures) "Exploitation for Fun and Profit" (Verification Futures 2016) Video, Paper
Chris Higgs (Potential Ventures) "Management sans frontiers: Removing the roadblocks in FPGA projects" (NMI 2015) Slides, PDF
Chris Higgs (Potential Ventures) "Rapid FPGA Verification" (NMI, February 2014) [Slides]
Utility Libraries and Frameworks
- cocotb-coverage, an extension for Functional Coverage and Constrained Randomization
- uvm-python, an almost 1:1 port of UVM 1.2 to Python
- pyuvm, The UVM IEEE 1800.2 specification built upon cocotb and implemented from scratch in Python.
- forastero - UVM-inspired cocotb-bus successor
- packtype - Packed data structure specifications for multi-language hardware projects.
- cocotb_kernel - Jupyter kernel that enables using cocotb within Jupyter Notebooks
- cocotb fault injection - Library for injecting SEU/SET.
cocotb-bus
Extensions
A list of cocotb extensions module packaged as described in documentation.
Please add yours here! If you publish to PyPI, please add the Framework :: cocotb
classifier.
- cocotb-bus for pre-packaged testbenching tools and reusable bus interfaces.
- cocotbext-fcov: Functional Coverage Closure
- cocotbext-eth: Ethernet (GMII, RGMII, XGMII, PTP clock)
- cocotbext-pcie: PCI Express (PCIe), and hard IP core models for UltraScale and UltraScale+
- cocotbext-axi: AXI, AXI lite, and AXI stream
- cocotbext-i2c: I2C interface modules
- cocotbext-uart: UART interface modules
- cocotbext-wishbone: Drive and monitor Wishbone bus
- cocotbext-uart: UART testing
- cocotbext-spi: Drive SPI bus
- cocomod-fifointerface: FIFO testing
- cocotbext-interfaces: "generalization of digital interfaces and their associated behavioral models"; Avalon ST
- cocotbext-ral: A port of the uvm-python RAL to use BusDrivers
- cocotbext-apb: AMPBA APB (Transaction, Master, Slave, Monitor)
- cocotbext-ahb: AMBA AHB Master, Slave, Monitor
- cocotb-ahb AHB bus functional model
- cocotb-tilelink TileLink UL bus functional model
Examples
- https://github.com/VLSI-EDA/PoC
- https://git.elphel.com/Elphel/x393/blob/master/py393/x393_mem.py
- https://github.com/SpinalHDL/CocotbLib/
- https://github.com/JarrettR/FPGA-Cryptoparty/tree/master/FPGA/tests
- UART, ... - https://github.com/andresdemski/pycocotb/
- UART Monitor - https://github.com/forensicgarlic/verilog_uart/blob/master/uart/test
- https://github.com/putsplut/ghdl/blob/records/testsuite/cocotb/
- https://github.com/jayant-sharma/dac/blob/master/testbench/dac/test_dac.py
- https://github.com/imphil/cocotb-testrunner
- https://github.com/aoeldemann/cocotb
- JTAG Master - https://gitlab.com/Chips4Makers/c4m_jtag/tree/master/sim/cocotb
- Simple testbench for a RAM block - https://www.edaplayground.com/s/example/106
- OpenCores jpegencode with Cocotb testbench - https://github.com/chiggs/oc_jpegencode, https://opencores-jpegencoder.readthedocs.io/en/latest/
- Functional Coverage and Constrained Randomization Extensions - https://github.com/mciepluc/cocotb-coverage
- APB/I2C Example using the Coverage Extension - https://github.com/mciepluc/apbi2c_cocotb_example
- Coverage Visualisation: https://github.com/JoseIuri/cocoTBCoverageView
- Python package providing a library for Verification Stimulus and Coverage - https://github.com/fvutils/pyvsc
- http://bitsbytesgates.blogspot.com/2020/03/modeling-random-stimulus-and-functional.html
- Video "SystemVerilog-Style Constraints and Functional Coverage in Python": https://www.youtube.com/watch?v=J4bYP3mTpeA (2023-04)
- Visual debugging in PyCharm - http://blog.patfarley.org/pages/cocotb-pycharm
- nMigen-cocotb extension: https://github.com/andresdemski/nmigen-cocotb
- cocotb benchmark tool: https://github.com/andresdemski/cocotb-performance
- OpenSocDebug:
- USB: https://github.com/xobs/valentyusb/tree/tri-fifo/sim
- A simple example for cocotb+GnuRadio (see gr_test), a combination which may be helpful for DSP applications: https://github.com/zinka/DSP-BB/blob/master/test/cocotb
- https://github.com/avidan-efody/wave_rerunner
Non-cocotb but Related
Python and Other HDL/HVL Languages
- basil - cocotb tests for hardware (Paper)
- https://github.com/gsmecher/pyxsi - "C/RTL Cosimulation with Vivado and Python"
- https://github.com/kaushalmodi/nim-systemverilog-dpic
- https://github.com/kaushalmodi/nim-systemverilog-vpi
- https://bitsbytesgates.blogspot.com/2019/06/py-hpi-procedural-hdlpython-integration.html
- https://www.amiq.com/consulting/2019/05/17/how-to-connect-e-language-with-python/
- https://www.amiq.com/consulting/2019/03/22/how-to-connect-systemverilog-with-python/
- http://www.fivecomputers.com/a-uvm-layer-for-pyhvl.html
- http://pyhvl.sourceforge.net/
- https://community.cadence.com/cadence_blogs_8/b/fv/posts/specman-python
- https://github.com/Kuree/kratos
Register Models
- https://github.com/Juniper/open-register-design-tool
- https://github.com/sjalloq/open-register-design-tool/tree/master/utils/python A Python model for the Ordt Register File
- https://github.com/sjalloq/cocotb-regfile An example of using the above model in a cocotb testbench
- http://www.amiq.com/consulting/2015/12/09/c-register-modeling-framework/
Other Useful Python Libraries
spfpm
: fixed-point, arbitrary-precision arithmeticpint
: working with physical quantitiesfixedpoint
: fixed-point arithmeticapytypes
: Fully configurable floating-point and fixed-point scalar and array arithmetic.fxpmath
: A Python library for fractional fixed-point (base 2) arithmetic and binary manipulation with Numpy compatibility.