GithubHelp home page GithubHelp logo

bensampson5 / libsv Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 4.0 261 KB

An open source, parameterized SystemVerilog digital hardware IP library

Home Page: https://libsv.readthedocs.io/en/latest/

License: MIT License

SystemVerilog 88.39% Dockerfile 0.45% Python 11.16%
verilog systemverilog hdl ip fpga asic digital-design asic-library fpga-library hardware hardware-libraries hardware-designs

libsv's Introduction

LibSV


PyPI Documentation Status

Welcome to LibSV! Click here to go to LibSV’s documentation.

LibSV is an open source, parameterized SystemVerilog digital hardware IP library. While similar libraries may already exist, LibSV is unique in that it takes advantage of open-source, state-of-the-art development best practices and tools from across the software and digital design community, including:

Getting Started

LibSV is very easy to use. First, install the libsv package from PyPI:

pip install libsv

We recommend using a Python virtual environment so that the installation is project-specific and isolated from the rest of your system.

Then add the site-packages/ folder, where LibSV was just installed, to your include path when building your project so that your design tools can find LibSV.

Finally, at the top of your design file where you want to use LibSV modules, for each module you want to use, add:

`include "libsv/<path>/<to>/<module>.sv"

Running Testbenches

Running the LibSV testbenches require Cocotb, Verilator, and a number of other dependencies to be installed. Instead of trying to install everything manually on your machine, the easier and recommended way to run the LibSV testbenches is to use the pre-built LibSV Docker images on Docker Hub that have the complete set of LibSV developer tools already installed.

To use a LibSV Docker image, first you’ll need to install Docker, if you don’t already have it.

Next, pull the latest LibSV Docker image:

docker build --pull -f Dockerfile.dev \
  --build-arg UID=$(id -u) \
  --build-arg GID=$(id -g) \
  -t libsv .

Then, start a new Docker container using the LibSV image and mount the project folder to the container:

docker run --rm -it -v $(pwd):/code libsv

Finally, within the Docker container, run pytest:

pytest

This will run all the LibSV testbenches for the entire library (Warning: This may take a while!).

Instead, to list all the available LibSV testbenches, run:

pytest --co

Then, you can run an individual or subset of testbenches using the -k flag which will only run tests which match the given substring expression:

pytest -k EXPRESSION

Each testbench generates an associated .fst waveform file that is written to the build/ directory and can be viewed using GTKWave.

Bugs/Feature Requests

Please use LibSV's GitHub issue tracker to submit bugs or request features.

Contributing

Contributions are much welcomed and appreciated! Take a look at the Contributing page to get started.

License

Distributed under the terms of the MIT license, LibSV is free and open source software.

libsv's People

Contributors

bensampson5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

libsv's Issues

Each branch gets it's own dockerfile

Add functionality to ci.yml so that each branch gets its own docker image on openhdl's docker hub. Here are the rules:

  1. If new branch created, then retag the source branch's docker image so that new branch has it's own image
  2. If branch == "main" or starts with "docker-" then always build and push a new docker image with every commit
  3. All other CI steps run with the specific branch's docker image
  4. Upon branch deletion, then remove that docker image from Docker Hub

BCD Decoder

Develop a purely combinatorial circuit for a BCD decoder (bcd -> bin)

Add formatting for C++ code

Use clang-format. Will have to pick a style

Task list:

  • Pick a formatting style
  • Add format style file to project
  • Add C++ formatting step to precommit script

Fix docker job if statement

Task list:

  • Should not be startsWith for main comparison, should just be ==
  • Retag docker image on new remote branch creation (only builds docker if branch == main or starts with "docker-"

Add badges to README

Useful badges:

  • current pypi version
  • main ci status
  • docs build status (on main branch)

Update docker meta job

Must update to resolve issue with multiple tags being generated for only getting the right one from ${{ steps.docker_meta.outputs.tags }}. Also migrate to metadata-action instead of crazy-max/ghaction-docker-meta

Write some kind of IP

The catalog needs to be started with at least one kind of IP. Let's pick a parameterized counter that counts up.

Tasks:

  • Create a new Verilog file counter.v
  • Write a testbench for it
  • Simulate it to validate it's operation

SystemVerilog/Verilog linter

Add a linter for SystemVerilog/Verilog.

I think Verilator has one but Verible definitely has one. So compare and pick one

iwyu for c++

Add Include What You Use (IWYU) check for C++ code

Add format check ci step

Applies to all branches

Task list:

  • Implement format check for C++ files
  • Implement format check for SystemVerilog/Verilog files

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.