Actively maintained. Last release 2 months ago. A safe choice.
pip install cocotb-testcocotb-test
[!NOTE]
Since version 1.8 cocotb supports python based runner.
cocotb-test provides standard python unit testing capabilities for cocotb
- allow the look and feel of Python unit testing
- remove the need for Makefiles (includes Makefile compatibility mode)
- allow easy customization of simulation flow
- allow to use pytest-xdist or pytest-parallel for parallel runs
Usage:
-
Install cocotb.
-
Install simulator (for Icarus Verilog with conda, on widows use 10.3 or devel steveicarus/iverilog#395 ):
conda install -c conda-forge iverilog==10.3
- Install the package via pip:
pip install cocotb-test
or development version
pip install -v https://github.com/themperek/cocotb-test/archive/master.zip
or
git clone https://github.com/themperek/cocotb-test.git
pip install -v -e cocotb-test
- Create a
test_dff.pyfile (check test folder for more examples):
from cocotb_test.simulator import run
def test_dff():
run(
verilog_sources=["dff.sv"], # sources
toplevel="dff", # top level HDL
module="dff_cocotb" # name of cocotb test module
)