liberty-db
Highlight Features
- Support all
libertyattributes with typed datastructure, rather than syntax tree (AST) only, in the definition of Liberty Version R-2020.09, September 2020 - Support
libertyboolean expression syntax, employ binary decesion diagram (BDD) to identify (hashing) - Parser & formatter are implemented by static macros, providing a decent preformance and tiny ~3MB
parser & formatterbinary. See benchmark summary - Support generics user-defined context for library, cell, and more.
- Support
define define_groupuser-defined attributes - Verified with library-complier, well defined document, and examples provided
Usage
This library is implemented in Rust, with document.
[]
= "0.8"
One basic demo here:
use ;
use ;
static TEMPLATE: &str = r#"
library(demo) {
time_unit : "1ps";
voltage_unit : "10mV";
current_unit : "1uA";
operating_conditions ( typical ) {
process : 1;
voltage : 1.1;
}
lu_table_template(delay_template_4x5) {
variable_1 : total_output_net_capacitance;
variable_2 : input_net_transition;
index_1 ("1000.0, 1001.0, 1002.0, 1003.0");
index_2 ("1000.0, 1001.0, 1002.0, 1003.0, 1004.0");
}
cell (DFF) {
pin (D) {}
pin (CK) {}
pin (Q) {}
}
}"#;
See more examples, and run them if you clone this repo:
# 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
Dev
Run unit-test and regression.
cargo test --release
Run benchmark, it will takes 40mins.
cargo bench --bench dev
TODO
-
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
-
Reconstruction:parser toGroupBuilder, e.g., useVecto storeGroupSet, no comment attributebuild/linkGroupBuildertoGroup, providing parent'sscope, e.g.allPinname set to build BDDsupper group liketiming::TimingTableLookUp- check all rules
-
Parse:
OnlyVec<NotNan<f64>>andValuecomplex attributes need quotes vector, usefast_float2::parse_partialFix error whenmake_goldenintrinsic_parasiticgroupleakage_currentgroupdynamic_currentgroup
- async
- stream input
-
Finished
userdefineremoveGroupWapper,ComplexWapper,SimpleWapper. At leaset remove it in parser and formatterfix missing newline at enddingrecursive parse boolean expressionmacrosformat tolibertysupport multi-line\support commentUseMutSetto store GroupMap