Giter Site home page Giter Site logo

mciepluc / cocotb-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from themperek/cocotb-test

1.0 2.0 2.0 169 KB

Unit testing for cocotb

License: BSD 2-Clause "Simplified" License

Python 91.71% Verilog 2.62% Forth 0.03% VHDL 2.11% Makefile 0.51% C++ 3.02%

cocotb-test's Introduction

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

cocotb-test's People

Contributors

cmarqu avatar eric-wieser avatar mciepluc avatar themperek avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.