liberty_db/internal_power/
mod.rs

1use crate::{
2  Ctx,
3  ast::{Attributes, GroupComments, GroupFn},
4  common::items::WordSet,
5  expression::LogicBooleanExpression,
6  table::TableLookUp,
7};
8
9#[derive(Debug, Clone)]
10#[derive(liberty_macros::Group)]
11#[mut_set::derive::item]
12#[derive(serde::Serialize, serde::Deserialize)]
13#[serde(bound = "C::InternalPower: serde::Serialize + serde::de::DeserializeOwned")]
14pub struct InternalPower<C: 'static + Ctx> {
15  /// group comments
16  #[liberty(comments)]
17  comments: GroupComments,
18  #[liberty(extra_ctx)]
19  pub extra_ctx: C::InternalPower,
20  /// group undefined attributes
21  #[liberty(attributes)]
22  pub attributes: Attributes,
23  // NOTICE: Simple Attributes
24  // equal_or_opposite_output
25  // falling_together_group
26  // power_level
27  #[id]
28  #[liberty(simple)]
29  pub related_pin: WordSet,
30  #[id]
31  #[liberty(simple)]
32  pub related_pg_pin: WordSet,
33  // rising_together_group
34  // switching_interval
35  // switching_together_group
36  #[liberty(simple)]
37  #[id]
38  pub when: Option<LogicBooleanExpression>,
39  // NOTICE: Complex Attribute
40  /// The `mode` attribute specifies the current mode of operation of the cell. Use this attribute in
41  /// the `internal_power` group to define the internal power in the specified mode.
42  ///
43  /// ### Syntax
44  /// ``` text
45  /// mode (mode_name, mode_value) ;
46  /// ```
47  /// ### Example
48  /// ``` text
49  /// mode (rw, read) ;
50  /// ```
51  /// <a name ="reference_link" href="
52  /// https://zao111222333.github.io/liberty-db/2020.09/reference_manual.html?field=null&bgn=305.9&end=305.14
53  /// ">Reference-Definition</a>
54  #[liberty(complex)]
55  pub mode: Option<[String; 2]>,
56  // NOTICE: Group Statements
57  // #[liberty(group)]
58  // pub domain: Option<Domain<C>>,
59  #[liberty(group)]
60  #[liberty(after_build = TableLookUp::use_power_template)]
61  pub rise_power: Option<TableLookUp<C>>,
62  #[liberty(group)]
63  #[liberty(after_build = TableLookUp::use_power_template)]
64  pub fall_power: Option<TableLookUp<C>>,
65  #[liberty(group)]
66  #[liberty(after_build = TableLookUp::use_power_template)]
67  pub power: Option<TableLookUp<C>>,
68}
69
70impl<C: 'static + Ctx> GroupFn<C> for InternalPower<C> {}