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

View File

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

View File

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