SystemVerilog to Verilog conversion
Go to file
Zachary Snow 5351dee80a minor scoping/ordering fixes for pesky VCS restrictions 2019-04-02 15:36:29 -04:00
src minor scoping/ordering fixes for pesky VCS restrictions 2019-04-02 15:36:29 -04:00
test/relong fix broken for inits parsing; beefed up relong test script to catch such mistakes 2019-03-27 03:33:28 -04:00
.gitignore switch to using stack 2019-02-11 23:48:49 -05:00
.travis.yml Travis CI 2019-03-27 02:23:57 -04:00
LICENSE added initial Readme; tweaked copyright notice 2019-02-24 14:59:00 -05:00
Makefile added hdl-examples tests 2019-03-26 21:32:02 -04:00
README.md updated CLI to support include dirs and multiple files 2019-03-28 19:55:53 -04:00
Setup.hs Initial commit: fork of https://github.com/tomahawkins/verilog 2019-02-07 23:49:12 -05:00
stack.yaml switch to using stack 2019-02-11 23:48:49 -05:00
sv2v.cabal added support and conversion handling of the $bits system function 2019-04-02 00:16:09 -04:00

README.md

sv2v: SystemVerilog to Verilog

sv2v is a tool for converting SystemVerilog (IEEE 1800-2017) to (IEEE 1364-2005), with an emphasis on supporting synthesizable SystemVerilog features. This project was originally developed to target Yosys, and so allows for disabling the conversion of those SystemVerilog features which Yosys supports.

Installation

Pre-built binaries

We plan on releasing pre-built binaries in the near future.

Building from source

You must have Stack installed to build sv2v.

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

This creates the executable at ./bin/sv2v You can install the binary by running stack install.

Usage

The interface for this tool has not yet been finalized. Currently, running sv2v path/to/file.sv will output the converted file to stdout.

sv2v [OPTIONS] [FILES]

Common flags:
  -e --exclude=CONV     conversion to exclude (always, interface, logic); can
                        be specified multiple times
  -i --incdir=DIR       add directory to include search path
  -? --help             Display help message
  -V --version          Print version information
     --numeric-version  Print just the version number

SystemVerilog Parser/AST

This project contains a basic preprocessor, lexer, parser, and abstract syntax tree for a subset of synthesizable SystemVerilog. The parser is not extremely strict, and 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 parser if there is significant interest.

License

See the LICENSE file for copyright and licensing information.