Giter Site home page Giter Site logo

svase's Introduction

SVase

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.

Disclaimer

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.

Using SVase

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

Example: SystemVerilog to Verilog flow

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

Getting SVase

Releases

You can get SVase binaries from the Releases page on Github. Note: For now only Linux releases; glibc-2.29 is required

Build it yourself

Requirements

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.

Build

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.

Running Tests

make run-tests

Development

Format to match linter

make format

V1.0.0 ToDo list

User Interface

  • Help message
  • Multiple input files (ie from json)
  • (Optional) Run select passes only

Preprocessing

  • Clean up endmodule-trailing

Rewrite support

  • 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

Postprocessing

  • Add support for library output
  • (Optional) Formatting and cleanup using verible if installed
  • (Optional) output validation using slang and verible if installed

Cleanup

  • Switch to available Slang release
  • Use better command line library (cxxopts is buggy and lacking)
  • Revise cloning and use std::move where appropriate

Hardening

  • 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

License

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.

svase's People

Contributors

joennlae avatar phsauter avatar paulsc96 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.