LibertyPort::capacitance()

This commit is contained in:
James Cherry 2020-07-09 16:10:21 -07:00
parent b54125a1ae
commit b7a572cfe2
4 changed files with 33 additions and 0 deletions

View File

@ -636,6 +636,7 @@ public:
float &fanout_load,
bool &exists) const;
void setFanoutLoad(float fanout_load);
float capacitance() const;
float capacitance(const RiseFall *rf,
const MinMax *min_max) const;
void capacitance(const RiseFall *rf,

View File

@ -36,6 +36,9 @@ public:
float &value,
bool &exists) const;
bool hasValue() const;
void maxValue(// Return values
float &max_value,
bool &exists) const;
bool empty() const;
bool hasValue(const RiseFall *rf,
const MinMax *min_max) const;

View File

@ -1928,6 +1928,18 @@ LibertyPort::setCapacitance(const RiseFall *rf,
}
}
float
LibertyPort::capacitance() const
{
float cap;
bool exists;
capacitance_.maxValue(cap, exists);
if (exists)
return cap;
else
return 0.0;
}
float
LibertyPort::capacitance(const RiseFall *rf,
const MinMax *min_max) const

View File

@ -163,6 +163,23 @@ RiseFallMinMax::hasValue() const
return !empty();
}
void
RiseFallMinMax::maxValue(// Return values
float &max_value,
bool &exists) const
{
max_value = MinMax::max()->initValue();
exists = false;
for (int rf_index=0;rf_index<RiseFall::index_count;rf_index++) {
for (int mm_index = 0; mm_index < MinMax::index_count; mm_index++) {
if (exists_[rf_index][mm_index]) {
max_value = std::max(max_value, values_[rf_index][mm_index]);
exists = true;
}
}
}
}
bool
RiseFallMinMax::empty() const
{