#system-verilog #slang #parser #bindings #api

slang-rs

Rust bindings for the Slang Verilog parser

11 breaking releases

0.12.0 Nov 19, 2024
0.10.0 Nov 14, 2024

#1222 in Hardware support

Download history 369/week @ 2024-09-16 346/week @ 2024-09-23 123/week @ 2024-09-30 404/week @ 2024-10-07 183/week @ 2024-10-14 23/week @ 2024-10-21 153/week @ 2024-10-28 25/week @ 2024-11-04 259/week @ 2024-11-11 233/week @ 2024-11-18 14/week @ 2024-11-25 177/week @ 2024-12-02

685 downloads per month
Used in topstitch

Apache-2.0

26KB
630 lines

slang-rs

Parse SystemVerilog with Slang using a Rust API.

Note: the API is currently under development and is subject to frequent changes.

Prerequisite

First install the Slang parser. We recommend building it from source.

curl -LO "https://github.com/MikePopoloski/slang/archive/refs/tags/v6.0.tar.gz"
tar xzvf v6.0.tar.gz
cd slang-6.0
cmake -B build
cmake --build build -j8

This will take a few minutes. Then set an environment variable to specify the location of the Slang binary:

export SLANG_PATH=`realpath build/bin/slang`

Installation

Install Rust if you don't have it already:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then clone this repository:

git clone https://github.com/xlsynth/slang-rs.git

To run the tests:

cd slang-rs
cargo test

Dependencies

~7–17MB
~255K SLoC