Crates.io | vast |
lib.rs | vast |
version | 0.3.3 |
source | src |
created_at | 2020-07-23 16:29:22.739317 |
updated_at | 2022-11-20 17:57:20.991951 |
description | Verilog AST library |
homepage | |
repository | https://github.com/vegaluisjose/vast |
max_upload_size | |
id | 268666 |
size | 128,571 |
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.
Add vast
to your Cargo.toml
like this:
[dependencies]
vast = "0.3.0"
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);
}
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);
}