Skip to main content

No project description provided

Project description

cocotb-test

Build Status PyPI version

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
  • easy installation (especially on Windows)
  • allow to use pytest-xdist or pytest-parallel for parallel runs

!Proof of Concept!

Usage:

  • Install and use conda for Python (can be installed in user/local folder).

  • Install development tools for conda (Windows only):

conda install m2w64-gcc libpython
  • Install simulator (for Icarus Verilog):
conda install -c conda-forge iverilog
  • Install the package via pip:
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.py file (check test folder for more examples):
from cocotb_test.run import run
def test_dff():
    run(
        verilog_sources=["dff.v"], # sources
        toplevel="dff",            # top level HDL
        module="dff_cocotb"        # name of cocotb test module
    )
pytest -s 

Running (some) tests and examples from cocotb

For cocotb tests/examples install cocotb in editable mode

git clone https://github.com/potentialventures/cocotb.git
pip install -e cocotb
SIM=icarus pytest -s --junitxml=test-results.xml --cocotbxml=test-cocotb.xml tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cocotb-test-0.0.6.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file cocotb-test-0.0.6.tar.gz.

File metadata

  • Download URL: cocotb-test-0.0.6.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6

File hashes

Hashes for cocotb-test-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5dd26592a948a0836553ef95ada54ef6ed05de36a52c15c4123197aee7412777
MD5 3c62e04bb4aa2fc20a8bdada86578ec4
BLAKE2b-256 8f157175dcfb1bad3367df7cb94621d7ae6249c4368898754e056af1fc286f7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page