Skip to content

Commit

Permalink
Sta::portExtCaps fanout init
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Mar 20, 2024
1 parent 4c850af commit 869ad90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/sta/MinMax.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion search/Sta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions util/MinMax.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "MinMax.hh"

#include <algorithm>
#include <limits>

#include "StringUtil.hh"

Expand All @@ -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)
{
}
Expand Down

0 comments on commit 869ad90

Please sign in to comment.