diff --git a/include/sta/Liberty.hh b/include/sta/Liberty.hh index 1ac7921f..0bdb3753 100644 --- a/include/sta/Liberty.hh +++ b/include/sta/Liberty.hh @@ -26,6 +26,7 @@ #include #include +#include #include "MinMax.hh" #include "RiseFallMinMax.hh" @@ -474,6 +475,7 @@ public: void leakagePower(// Return values. float &leakage, bool &exists) const; + std::optional leakagePower() const; bool leakagePowerExists() const { return leakage_power_exists_; } // Register, Latch or Statetable. diff --git a/liberty/Liberty.cc b/liberty/Liberty.cc index e4893739..e5324dc4 100644 --- a/liberty/Liberty.cc +++ b/liberty/Liberty.cc @@ -1307,6 +1307,16 @@ LibertyCell::leakagePower(// Return values. exists = leakage_power_exists_; } +std::optional +LibertyCell::leakagePower() const +{ + std::optional leakage; + if (leakage_power_exists_) { + leakage = leakage_power_; + } + return leakage; +} + void LibertyCell::finish(bool infer_latches, Report *report,