liberty-parse 0.1.0

Liberty file format parser
Documentation
  • Coverage
  • 52.94%
    36 out of 68 items documented1 out of 34 items with examples
  • Size
  • Source code size: 114.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.88 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 24s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • shages/liberty-parse
    8 4 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • shages

liberty-parse

Liberty file format parser for Rust

Example usage

Parse libraries from a Liberty file

use liberty_parse::parse_lib;

let lib_str = r#"
library(sample) {
    cell(AND2) {
        area: 1;
    }
}
"#;

for lib in parse_lib(lib_str).unwrap() {
    println!("Library '{}' has {} cells", lib.name, lib.cells.len());
    if let Some(cell) = lib.cells.get("AND2") {
        let area = cell.simple_attributes.get("area").map_or(0.0, |v| v.float());
        println!("Cell AND2 has area: {}", area);
    } else {
        println!("Cell AND2 doesn't exist!");
    }
}

Limitations

  • Doesn't automatically parse files from include statements

  • Doesn't parse bus syntax in pin names. For example:

        pin (X[0:3]){
        }