#eda #liberty #data-structures #database #parser #syntax-tree

liberty-db

A fully defined liberty data structure, efficient parser & formatter

59 releases (6 breaking)

new 0.7.4 Dec 3, 2024
0.7.3 Nov 28, 2024
0.6.14 Nov 13, 2024
0.4.11 Jul 30, 2024
0.1.1 Dec 16, 2022

#67 in Development tools

Download history 267/week @ 2024-08-16 945/week @ 2024-08-23 460/week @ 2024-08-30 527/week @ 2024-09-06 238/week @ 2024-09-13 105/week @ 2024-09-20 58/week @ 2024-09-27 2/week @ 2024-10-04 3/week @ 2024-10-11 1/week @ 2024-10-18 31/week @ 2024-11-01 1122/week @ 2024-11-08 512/week @ 2024-11-15 102/week @ 2024-11-22 184/week @ 2024-11-29

1,939 downloads per month

MIT license

770KB
15K SLoC

liberty-db

pipeline pipeline License liberty-db Docs Benchmark codecov

Highlight Features

Usage

This library is implemented in Rust, with document.

[dependencies]
liberty_db = "0.7"

You can run examples with commands:

# example0
cargo run --example 0_parse_fmt
# example1
cargo run --example 1_parse_fmt_file -- dev/tech/cases/ocv.lib
# example2
cargo run --example 2_prune_lib -- dev/tech/cases/ocv.lib

Benchmark

Basic information as follow, see latest benchmark summary.

Project Comparison

ProjectLangVersionType SupportBoolean
Expression
Comment
AllPartlyAST only
liberty-dbrustlatestcurrent version
si2dr_libertyC1.0Synopsys's version at 2005, many attributes are not supported
OpenTimerC++172STA tool's liberty component
liberty-iorust0.0.4
libertyparserust0.3.0
liberty2jsonrust0.1.0

Self Regression

ProjectLangVersionType SupportBoolean
Expression
Comment
AllPartlyAST only
liberty-dbrustlatestcurrent version
liberty-dbrust0.6.3published at 2024-09-07
liberty-dbrust0.5.9published at 2024-08-27
liberty-dbrust0.4.13published at 2024-08-13
liberty-dbrust0.3.1published at 2023-08-03

Dev

Run unit-test and regression.

cargo test
cargo test --package dev

Run benchmark, it will takes 5h.

cargo bench --bench dev

TODO

  • Reconstruction:

    • parser to GroupBuilder, e.g., use Vec to store GroupSet, no comment attribute
    • build/link GroupBuilder to Group, providing parent's scope, e.g.
      • all Pin name set to build BDD
      • supper group like timing::TimingTableLookUp
      • check all rules
  • Parse:

    • Only Vec<NotNan<f64>> and Value complex attributes need quotes vector, use fast_float2::parse_partial
    • Fix error when make_golden
      • intrinsic_parasitic group
      • leakage_current group
      • dynamic_current group
    • async
    • stream input
  • CI:

    • only do comparsion after tag new version
    • fast regression self in build.yml
  • Other:

    • BDD use ArcStr
    • Linked Group
    • like IndexMap, only sort once and store
    • bitcode support
  • Finished

    • user define
    • remove GroupWapper, ComplexWapper, SimpleWapper. At leaset remove it in parser and formatter
    • fix missing newline at endding
    • recursive parse boolean expression
    • macros
    • format to liberty
    • support multi-line \
    • support comment
    • Use MutSet to store GroupMap

Dependencies

~3–4.5MB
~86K SLoC