Sta::portExtCaps fanout init

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-03-20 12:29:58 -07:00
parent 4c850afcd1
commit 869ad909a3
3 changed files with 9 additions and 3 deletions

View File

@ -49,6 +49,7 @@ public:
const char *asString() const { return name_; }
int index() const { return index_; }
float initValue() const { return init_value_; }
int initValueInt() const { return init_value_int_; }
// Max value1 > value2, Min value1 < value2.
bool compare(float value1,
float value2) const;
@ -74,12 +75,14 @@ private:
MinMax(const char *name,
int index,
float init_value,
int init_value_int,
bool (*compare)(float value1,
float value2));
const char *name_;
int index_;
float init_value_;
int init_value_int_;
bool (*compare_)(float value1,
float value2);

View File

@ -3705,7 +3705,7 @@ Sta::portExtCaps(const Port *port,
bool fanout_exists = false;
pin_cap = min_max->initValue();
wire_cap = min_max->initValue();
fanout = min_max->initValue();
fanout = min_max->initValueInt();
for (RiseFall *rf : RiseFall::range()) {
float pin_cap1, wire_cap1;
int fanout1;

View File

@ -17,6 +17,7 @@
#include "MinMax.hh"
#include <algorithm>
#include <limits>
#include "StringUtil.hh"
@ -40,18 +41,20 @@ compareMax(float value1,
////////////////////////////////////////////////////////////////
MinMax MinMax::min_("min", 0, INF, compareMin);
MinMax MinMax::max_("max", 1, -INF, compareMax);
MinMax MinMax::min_("min", 0, INF, std::numeric_limits<int>::max(), compareMin);
MinMax MinMax::max_("max", 1, -INF, std::numeric_limits<int>::min(), compareMax);
const std::array<MinMax*, 2> MinMax::range_{&min_, &max_};
const std::array<int, 2> MinMax::range_index_{min_.index(), max_.index()};
MinMax::MinMax(const char *name,
int index,
float init_value,
int init_value_int,
bool (*compare)(float value1, float value2)) :
name_(name),
index_(index),
init_value_(init_value),
init_value_int_(init_value_int),
compare_(compare)
{
}