toddstrader / slang

SystemVerilog compiler and language services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slang - SystemVerilog Language Services

Build Status codecov CodeFactor Codacy Badge License: MIT Join the chat at https://gitter.im/MikePopoloski/slang

Parser and compiler library for SystemVerilog.

Still under heavy construction!

Goals

  • Fully parse and analyze all SystemVerilog features.
  • Be robust about compilation, no matter how broken the source text. This makes the compiler usable in editor highlighting and completion scenarios, where the code is likely to be pretty broken.
  • The parse tree should round trip back to the original source, making it easy to write refactoring and code generation tools.
  • Provide great error messages, ala clang.
  • Be fast and robust in the face of production-scale projects.

Try It Out

Experiment with parsing, type checking, and error detection live on the web (this tool is inspired by Matt Godbolt's excellent Compiler Explorer). It's still pretty rough but useful for exploring the interactive behavior of the toolchain.

Build Instructions

Dependencies

Compilation

CMake is used for project generation and Conan is used for dependency management. All external packages will be pulled down, configured, and built automatically by Conan as part of invoking CMake. CMake supports many generator backends so use the one that is most comfortable for you; some recommended options are as follows:

Visual Studio

The recommended method on Windows is to open the slang root folder in Visual Studio and press build. The IDE handles all of the CMake interaction.

Ninja

Ninja is the recommended method for command line building (on any platform):

mkdir build && cd build
cmake -GNinja ..
ninja
Make

If you're building on Linux and don't want the additional Ninja dependency, you can build with make, which is the default generator for CMake on Linux:

mkdir build && cd build
cmake ..
make -j 8

Running tests

From the build directory:

bin/unittests

About

SystemVerilog compiler and language services

License:MIT License


Languages

Language:C++ 96.8%Language:CMake 1.8%Language:Python 1.4%Language:SystemVerilog 0.0%Language:Verilog 0.0%