8 releases

0.3.3 Nov 20, 2022
0.3.2 Nov 20, 2022
0.3.1 Oct 4, 2022
0.3.0 May 20, 2021
0.1.0 Jul 23, 2020

#475 in Programming languages

Download history 272/week @ 2024-06-17 78/week @ 2024-06-24 115/week @ 2024-07-01 154/week @ 2024-07-08 144/week @ 2024-07-15 133/week @ 2024-07-22 190/week @ 2024-07-29 150/week @ 2024-08-05 40/week @ 2024-08-12 47/week @ 2024-08-19 152/week @ 2024-08-26 65/week @ 2024-09-02 53/week @ 2024-09-09 48/week @ 2024-09-16 71/week @ 2024-09-23 60/week @ 2024-09-30

238 downloads per month
Used in 5 crates (2 directly)

Apache-2.0

85KB
3K SLoC

Verilog AST (VAST)

Build Status Crates.io

VAST is a Rust library for building and manipulating Verilog ASTs. The goal is to support features from two different versions of the standard 2005 and 2017, v05 and v17 respectively. The subset directory contains types that are common between the two.

Using VAST

Add vast to your Cargo.toml like this:

[dependencies]
vast = "0.3.0"

Creating a module in Verilog-2005

use vast::v05::ast::Module;

fn main() {
    let mut module = Module::new("foo");
    module.add_input("a", 32);
    let res = module.to_string();
    let exp = r#"module foo (
    input wire [31:0] a
);
endmodule
"#;
    assert_eq!(res, exp);
}

Creating a module in SystemVerilog-2017

use vast::v17::ast::Module;

fn main() {
    let mut module = Module::new("foo");
    module.add_input("a", 32);
    let res = module.to_string();
    let exp = r#"module foo (
    input logic [31:0] a
);
endmodule
"#;
    assert_eq!(res, exp);
}

Dependencies

~1MB
~18K SLoC