use crate::{
ast::{Attributes, GroupComments, GroupFn},
common::{items::NameList, table::TableLookUp},
expression::LogicBooleanExpression,
Ctx,
};
#[mut_set::derive::item(sort)]
#[derive(Debug, Clone)]
#[derive(liberty_macros::Group)]
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(bound = "C::InternalPower: serde::Serialize + serde::de::DeserializeOwned")]
pub struct InternalPower<C: Ctx> {
#[size = 32]
#[liberty(comments)]
comments: GroupComments,
#[size = 0]
#[liberty(extra_ctx)]
pub extra_ctx: C::InternalPower,
#[size = 40]
#[liberty(attributes)]
pub attributes: Attributes,
#[id(
borrow = "crate::common::items::RefNameList<'_>",
check_fn = "NameList::as_ref",
with_ref = false
)]
#[size = 64]
#[liberty(simple)]
pub related_pin: NameList,
#[id(
borrow = "crate::common::items::RefNameList<'_>",
check_fn = "NameList::as_ref",
with_ref = false
)]
#[size = 64]
#[liberty(simple)]
pub related_pg_pin: NameList,
#[size = 80]
#[liberty(simple(type = Option))]
#[id(
borrow = "Option<&LogicBooleanExpression>",
check_fn = "mut_set::borrow_option!",
with_ref = false
)]
pub when: Option<LogicBooleanExpression>,
#[size = 48]
#[liberty(complex(type = Option))]
pub mode: Option<[String; 2]>,
#[size = 336]
#[liberty(group(type = Option))]
pub rise_power: Option<TableLookUp<C>>,
#[size = 336]
#[liberty(group(type = Option))]
pub fall_power: Option<TableLookUp<C>>,
#[size = 336]
#[liberty(group(type = Option))]
pub power: Option<TableLookUp<C>>,
}
impl<C: Ctx> GroupFn for InternalPower<C> {}