Skip to content

Commit

Permalink
use latest version of biodivine-lib-bdd
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed May 22, 2024
1 parent 0ee679b commit f32d470
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ itertools = "0.10.5"
ryu = "1.0"
itoa = "1.0"
uom = { version = "0.36.0", default-features = false, features = ["f64", "si", "std", "serde"] }
# biodivine-lib-bdd = "0.5"
biodivine-lib-bdd = {path = "../../biodivine-lib-bdd" , features = ["serde"]}
biodivine-lib-bdd = { version = "0.5.17", features = ["serde"]}
# biodivine-lib-bdd = {path = "../../biodivine-lib-bdd" , features = ["serde"]}
mut_set = "0.3.5"
mut_set_derive = "0.3.5"
# mut_set = {path = "../mut_set"}
# mut_set_derive = {path = "../mut_set/derive"}
duplicate = "1.0.0"

[dev-dependencies]
anyhow = "1.0.80"
anyhow = "1.0.80"

# [profile.dev.build-override]
# opt-level = 3
# codegen-units = 256
# debug = false # when possible
49 changes: 48 additions & 1 deletion src/ccsn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
//! IFRAME('https://zao111222333.github.io/liberty-db/2020.09/reference_manual.html');
//! </script>
use crate::{
ast::{AttributeList, GroupComments, GroupFn, SimpleAttri},
ast::{
AttributeList, ComplexAttri, ComplexParseError, GroupComments, GroupFn, SimpleAttri,
},
common::table::{
TableLookUp, TableLookUp2D, TableLookUpMultiSegment, Vector3DGrpup, Vector4DGrpup,
},
Expand Down Expand Up @@ -292,6 +294,51 @@ pub struct ReceiverCapacitance {
}
impl GroupFn for ReceiverCapacitance {}

/// The `propagating_ccb` attribute lists all the channel-connected block noise groups that propagate
/// the noise to the output pin in a particular timing arc.
///
/// In the list, the first name is the `input_ccb` group of the input pin (specified by the `related_pin` attribute in the timing group).
/// The second name, **if present**, is for the `output_ccb` group of the output pin
/// <a name ="reference_link" href="
/// https://zao111222333.github.io/liberty-db/2020.09/reference_manual.html?field=null&bgn=339.33+340.2&end=339.34+340.4
/// ">Reference</a>
#[derive(Debug, Clone, Default)]
#[derive(serde::Serialize, serde::Deserialize)]
pub struct PropagatingCcb {
/// input_ccb_name
pub input_ccb_name: String,
/// output_ccb_name
pub output_ccb_name: Option<String>,
}

impl ComplexAttri for PropagatingCcb {
#[inline]
fn parse(v: Vec<&str>) -> Result<Self, ComplexParseError> {
let mut i = v.into_iter();
let input_ccb_name = match i.next() {
Some(s) => s.to_owned(),
None => return Err(ComplexParseError::LengthDismatch),
};
let output_ccb_name = match i.next() {
Some(s) => Some(s.to_owned()),
None => None,
};
if let Some(_) = i.next() {
return Err(ComplexParseError::LengthDismatch);
}
Ok(Self { input_ccb_name, output_ccb_name })
}
#[inline]
fn to_wrapper(&self) -> crate::ast::ComplexWrapper {
match &self.output_ccb_name {
Some(output_ccb_name) => {
vec![vec![self.input_ccb_name.clone(), output_ccb_name.clone()]]
}
None => vec![vec![self.input_ccb_name.clone()]],
}
}
}

#[test]
fn parse_file() -> anyhow::Result<()> {
use std::fs::File;
Expand Down
3 changes: 2 additions & 1 deletion src/timing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mod impls;
pub mod items;
use crate::{
ast::{AttributeList, GroupComments, GroupFn},
ccsn::PropagatingCcb,
common::{items::*, table::*},
expression::{self, BooleanExpression, IdBooleanExpression},
library::Sensitization,
Expand Down Expand Up @@ -1327,7 +1328,7 @@ pub struct Timing {
/// ">Reference-Instance</a>
pub fall_delay_intercept: Option<(i64, f64)>,
#[liberty(complex(type=Option))]
pub propagating_ccb: Option<[String; 2]>,
pub propagating_ccb: Option<PropagatingCcb>,
// piecewise model only
/// <a name ="reference_link" href="
/// https://zao111222333.github.io/liberty-db/2007.03/_user_guide.html
Expand Down
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ prettytable-rs = "^0.10"
colored = "2.0.0"
criterion = "0.3"
liberty-io = "0.0.2"
libertyparse = "0.2.2"
libertyparse = "0.3"
anyhow = "1.0.80"


Expand Down

0 comments on commit f32d470

Please sign in to comment.