SVase is a source-to-source pre-elaborator for SystemVerilog (IEEE 1800-2017) single-unit designs.
It is developed as part of the PULP project, a joint effort between ETH Zurich and the University of Bologna.
It leverages the best-in-class FOSS tool Slang to parse and compile a design and then rewrite constructs unsupported by fundamental open EDA tools using the provided compile-time information. Most notably, SVase
- Creates unique module variants for each parameter combination and then hardcodes their parameters.
- Unrolls generate constructs and replaces instance types to use unique modules.
This completely uncouples instances and modules from each other, fully qualifying hierarchical parameters and types: any resulting unique module can be processed and synthesized out of context. Unlike Slang itself, SVase outputs a fully-compliant 1800-2017 source that may be fed into any next tool with limited SV support as-is.
This project is still considered to be in early development; some parts may not yet be functional, and existing interfaces and conventions may be broken without prior notice. We target a formal release in the near future.
Currently there is no way to run select passes or give multiple input files. The only way to use SVase is shown below:
# svase top_module output.sv input.sv
svase test out.sv test/assign/assign.sv
A popular tool to convert from SystemVerilog to Verilog is sv2v but it does not support all SystemVerilog constructs as can be seen on the sv-tests website.
By adding SVase into the flow, it is possible to get a wider coverage of SystemVerilog constructs.
svase top_module intermediate.sv input.sv
sv2v --verbose --write output.sv intermediate.sv
You can get SVase binaries from the Releases page on Github. Note: For now only Linux releases; glibc-2.29 is required
The build requirements for SVase are mostly dicated by the Slang build requirements. The following requirements should be sufficient:
- CMake 3.15
- C++20 compatible compiler (GCC 10, Clang 16, XCode 14.3)
- Python 3
The only tested configuration is GCC 11.2.0 with CMake 3.20.2 and Python 3.6.
Depending on where/how you installed the compiler, CMake may not find the correct one. In this case you can manually specify a compiler, scripts/svase.env
provides and example for this.
One-liner:
make build
Step-by-step:
# edit and source svase.env if necessary
# source scripts/svase.env
# build dependencies
cd deps
make
cd ..
# build SVase
mkdir build && cd build
cmake ..
make
If everything went well, you can find SVase at build/svase
.
make run-tests
make format
- Help message
- Multiple input files (ie from json)
- (Optional) Run select passes only
- Clean up endmodule-trailing
- Uniquify and replace interfaces
- Rewrite assignment pattern expressions using
default:
- Rewrite starred port expressions
- Handle instance arrays
- (Optional) Add optional SV attributes on rewritten syntax
- (Optional) Preserve/remove comments in a systematic way
- Add support for library output
- (Optional) Formatting and cleanup using verible if installed
- (Optional) output validation using slang and verible if installed
- Switch to available Slang release
- Use better command line library (
cxxopts
is buggy and lacking) - Revise cloning and use
std::move
where appropriate
- Set up CI with linting and compiling
- Add feature-oriented test cases (FOSS equivalence checking?)
- Integrate Cheshire as test
- (Optional) Integrate Snitch Cluster as test
- (Optional) Investigate Occamy Top as test
Unless specified otherwise in the respective file headers, all code checked into this repository is made available under a permissive license. All software sources are licensed under Apache 2.0.