All Projects → zachjs → Sv2v

zachjs / Sv2v

Licence: other
SystemVerilog to Verilog conversion

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Sv2v

Tang e203 mini
LicheeTang 蜂鸟E203 Core
Stars: ✭ 135 (-10.6%)
Mutual labels:  verilog
Simplevout
A Simple FPGA Core for Creating VGA/DVI/HDMI/OpenLDI Signals
Stars: ✭ 139 (-7.95%)
Mutual labels:  verilog
Effectsize
🐉 Compute and work with indices of effect size and standardized parameters
Stars: ✭ 146 (-3.31%)
Mutual labels:  conversion
Typestat
Converts JavaScript to TypeScript and TypeScript to better TypeScript.
Stars: ✭ 136 (-9.93%)
Mutual labels:  conversion
Icesugar
iCESugar FPGA Board (base on iCE40UP5k)
Stars: ✭ 139 (-7.95%)
Mutual labels:  verilog
Chisel3
Chisel 3: A Modern Hardware Design Language
Stars: ✭ 2,290 (+1416.56%)
Mutual labels:  verilog
Hrconvert2
A self-hosted, drag-and-drop, & nosql file conversion server that supports 62x file formats.
Stars: ✭ 132 (-12.58%)
Mutual labels:  conversion
Learning Nvdla Notes
NVDLA is an Open source DL/ML accelerator, which is very suitable for individuals or college students. This is the NOTES when I learn and try. Hope THIS PAGE may Helps you a bit. Contact Me:[email protected]
Stars: ✭ 150 (-0.66%)
Mutual labels:  verilog
Openwifi
open-source IEEE 802.11 WiFi baseband FPGA (chip) design
Stars: ✭ 2,257 (+1394.7%)
Mutual labels:  verilog
Slang
SystemVerilog compiler and language services
Stars: ✭ 145 (-3.97%)
Mutual labels:  verilog
Symbiflow Arch Defs
FOSS architecture definitions of FPGA hardware useful for doing PnR device generation.
Stars: ✭ 137 (-9.27%)
Mutual labels:  verilog
Openfpgaduino
All open source file and project for OpenFPGAduino project
Stars: ✭ 137 (-9.27%)
Mutual labels:  verilog
Ice40 Playground
Various iCE40 cores / projects to play around with (mostly targeted at the icebreaker)
Stars: ✭ 141 (-6.62%)
Mutual labels:  verilog
Openofdm
Sythesizable, modular Verilog implementation of 802.11 OFDM decoder.
Stars: ✭ 135 (-10.6%)
Mutual labels:  verilog
Scale Mamba
Repository for the SCALE-MAMBA MPC system
Stars: ✭ 147 (-2.65%)
Mutual labels:  verilog
Wbuart32
A simple, basic, formally verified UART controller
Stars: ✭ 133 (-11.92%)
Mutual labels:  verilog
Swiftrewriter
A Swift Package Manager console app and library to convert Objective-C code into Swift.
Stars: ✭ 140 (-7.28%)
Mutual labels:  conversion
Figmatocode
Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
Stars: ✭ 2,299 (+1422.52%)
Mutual labels:  conversion
Logic
CMake, SystemVerilog and SystemC utilities for creating, building and testing RTL projects for FPGAs and ASICs.
Stars: ✭ 149 (-1.32%)
Mutual labels:  verilog
Easyrs
Convenience RenderScript tools for processing common Android formats such as Bitmap and NV21.
Stars: ✭ 144 (-4.64%)
Mutual labels:  conversion

sv2v: SystemVerilog to Verilog

sv2v converts SystemVerilog (IEEE 1800-2017) to Verilog (IEEE 1364-2005), with an emphasis on supporting synthesizable language constructs.

The primary goal of this project is to create a completely free and open-source tool for converting SystemVerilog to Verilog. While methods for performing this conversion already exist, they generally either rely on commercial tools, or are limited in scope.

This project was originally developed to target Yosys, and so allows for disabling the conversion of (passing through) those SystemVerilog features which Yosys supports.

The idea for this project was shared with me while I was an undergraduate at Carnegie Mellon University as part of a joint Computer Science and Electrical and Computer Engineering research project on open hardware under Professors Ken Mai and Dave Eckhardt. I have greatly enjoyed collaborating with the team at CMU since January 2019, even after my graduation the following May.

Dependencies

All of sv2v's dependencies are free and open-source.

  • Build Dependencies
    • Haskell Stack - Haskell build system
    • Haskell dependencies are managed in sv2v.cabal
  • Test Dependencies
    • Icarus Verilog - for Verilog simulation
    • shUnit2 - test framework
    • Python (any version) - for generating certain test cases

Installation

Pre-built binaries

Binaries for Ubuntu, macOS, and Windows are available on the releases page. If your system is not covered, or you would like to build the latest commit, simple instructions for building from source are below.

Building from source

You must have Stack installed to build sv2v. Then you can:

git clone https://github.com/zachjs/sv2v.git
cd sv2v
make

This creates the executable at ./bin/sv2v. Stack takes care of installing exact (compatible) versions of the compiler and sv2v's build dependencies.

You can install the binary to your local bin path (typically ~/.local/bin) by running stack install, or copy over the executable manually.

Usage

sv2v takes in a list of files and prints the converted Verilog to stdout. Using --write=adjacent will create a converted .v for every .sv input file rather than printing to stdout.

Users may specify include search paths, define macros during preprocessing, and exclude some of the conversions. Specifying - as an input file will read from stdin.

Below is the current usage printout. This interface is subject to change.

sv2v [OPTIONS] [FILES]

Preprocessing:
  -I --incdir=DIR           Add directory to include search path
  -D --define=NAME[=VALUE]  Define a macro for preprocessing
     --siloed               Lex input files separately, so macros from
                            earlier files are not defined in later files
     --skip-preprocessor    Disable preprocessor
Conversion:
  -E --exclude=CONV         Exclude a particular conversion (always, assert,
                            interface, or logic)
  -v --verbose              Retain certain conversion artifacts
  -w --write=MODE           How to write output; default is 'stdout'; use
                            'adjacent' to create a .v file next to each input
Other:
     --help                 Display help message
     --version              Print version information
     --numeric-version      Print just the version number

Supported Features

sv2v supports most synthesizable SystemVerilog features. Current notable exceptions include defparam on interface instances and references to typedefs within interface instances. Assertions are also supported, but are simply dropped during conversion.

If you find a bug or have a feature request, please create an issue. Preference will be given to issues which include examples or test cases.

SystemVerilog Front End

This project contains a preprocessor, lexer, and parser, and an abstract syntax tree representation for a subset of the SystemVerilog specification. The parser is not very strict. The AST allows for the representation of syntactically (and semantically) invalid Verilog. The goal is to be more general in the representation to enable more standardized and straightforward conversion procedures. This could be extended into an independent and more fully-featured front end if there is significant interest.

Testing

Once the test dependencies are installed, tests can be run with make test. GitHub Actions is used to automatically test commits.

There is also a SystemVerilog compliance suite being created to test open-source tools' SystemVerilog support. Although not every test in the suite is applicable, it has been a valuable asset in finding edge cases.

Acknowledgements

This project was originally forked from Tom Hawkin's Verilog parser. While the front end has changed substantially to support the larger SystemVerilog standard, his project was a great starting point.

Reid Long was invaluable in developing this tool, providing significant tests and advice, and isolating many bugs. His projects can be found here.

Edric Kusuma helped me with the ins and outs of SystemVerilog, with which I had no prior experience, and has also helped with test cases.

Since sv2v's public release, several people have taken the time to file detailed bug reports and feature requests. I greatly appreciate their help in furthering the project.

License

See the LICENSE file for copyright and licensing information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].