use crate::{
ast::{Attributes, GroupComments, GroupFn, GroupSet},
common::items::NameList,
expression::LogicBooleanExpression,
pin::{Direction, NextstateType},
timing::Timing,
ArcStr, Ctx,
};
#[mut_set::derive::item(sort)]
#[derive(Debug, Clone)]
#[derive(liberty_macros::Group)]
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(bound = "C::Pin: serde::Serialize + serde::de::DeserializeOwned")]
pub struct Bundle<C: Ctx> {
#[id(
borrow = "crate::common::items::RefNameList<'_>",
check_fn = "crate::common::items::namelist_borrow",
with_ref = false
)]
#[size = 48]
#[liberty(name)]
pub name: NameList,
#[size = 32]
#[liberty(comments)]
comments: GroupComments,
#[size = 0]
#[liberty(extra_ctx)]
pub extra_ctx: C::Pin,
#[size = 40]
#[liberty(attributes)]
pub attributes: Attributes,
#[size = 24]
#[liberty(complex)]
pub members: Vec<ArcStr>,
#[size = 1]
#[liberty(simple(type = Option))]
pub direction: Option<Direction>,
#[size = 16]
#[liberty(simple(type = Option))]
pub capacitance: Option<f64>,
#[size = 80]
#[liberty(simple(type = Option))]
pub function: Option<LogicBooleanExpression>,
#[size = 1]
#[liberty(simple(type = Option))]
pub nextstate_type: Option<NextstateType>,
#[size = 64]
#[liberty(group(type = Set))]
#[serde(serialize_with = "GroupSet::<Timing<C>>::serialize_with")]
#[serde(deserialize_with = "GroupSet::<Timing<C>>::deserialize_with")]
pub timing: GroupSet<Timing<C>>,
}
impl<C: Ctx> GroupFn for Bundle<C> {}