#system-verilog #verilog #filelist

sv-filelist-parser

A library to parse a SystemVerilog Filelist and return a list of files, include directories and defines

1 unstable release

0.1.3 May 12, 2022

#31 in #system-verilog

Download history 94/week @ 2024-07-26 78/week @ 2024-08-02 96/week @ 2024-08-09 56/week @ 2024-08-16 66/week @ 2024-08-23 89/week @ 2024-08-30 97/week @ 2024-09-06 96/week @ 2024-09-13 87/week @ 2024-09-20 112/week @ 2024-09-27 79/week @ 2024-10-04 66/week @ 2024-10-11 91/week @ 2024-10-18 76/week @ 2024-10-25 80/week @ 2024-11-01 40/week @ 2024-11-08

296 downloads per month
Used in 2 crates (via svlint)

MIT license

12KB
226 lines

SystemVerilog Filelist Parser

A library in Rust to parse a SystemVerilog Filelist and return a list of files, include directories and defines.

Environment variables optionally enclosed in paranthesis or curly braces (i.e. $, $() or ${}) will be automatically substituted.

Example

use sv_filelist_parser;
let filelist = sv_filelist_parser::parse_file("testcase/files.f")
    .expect("Cannot read filelist");
for file in filelist.files {
    println!("{:?}", file);
}
for incdir in filelist.incdirs {
    println!("{:?}", incdir);
}
for (d, t) in filelist.defines {
    match t {
        None => println!("{:?}", d),
        Some(te) => println!("{:?}={:?}", d, te),
    };
}

lib.rs:

SystemVerilog Filelist Parser

A library in Rust to parse a SystemVerilog Filelist and return a list of files, include directories and defines.

Environment variables optionally enclosed in paranthesis or curly braces (i.e. $, $() or ${}) will be automatically substituted.

Example

use sv_filelist_parser;
let filelist = sv_filelist_parser::parse_file("testcase/files.f")
    .expect("Cannot read filelist");
for file in filelist.files {
    println!("{:?}", file);
}
for incdir in filelist.incdirs {
    println!("{:?}", incdir);
}
for (d, t) in filelist.defines {
    match t {
        None => println!("{:?}", d),
        Some(te) => println!("{:?}={:?}", d, te),
    };
}

Dependencies

~2.2–3MB
~55K SLoC