This commit is contained in:
James Cherry 2018-10-23 16:28:41 -07:00
parent 2af22d9331
commit d0ca009460
9 changed files with 120 additions and 120 deletions

View File

@ -103,16 +103,16 @@ deleteDiversionPathEnd(Diversion *div)
////////////////////////////////////////////////////////////////
PathEnum::PathEnum(int max_paths,
int nworst,
PathEnum::PathEnum(int group_count,
int endpoint_count,
bool unique_pins,
bool cmp_slack,
const MinMax *min_max,
const StaState *sta) :
StaState(sta),
cmp_slack_(cmp_slack),
max_paths_(max_paths),
nworst_(nworst),
group_count_(group_count),
endpoint_count_(endpoint_count),
unique_pins_(unique_pins),
div_queue_(DiversionGreater(cmp_slack, min_max, sta->network())),
div_count_(0),
@ -189,7 +189,7 @@ PathEnum::findNext()
}
path_counts_[vertex]++;
if (path_counts_[vertex] <= nworst_) {
if (path_counts_[vertex] <= endpoint_count_) {
// Add diversions for all arcs converging on the path up to the
// diversion.
makeDiversions(path_end, div->divPath());
@ -199,8 +199,8 @@ PathEnum::findNext()
break;
}
else {
// We have nworst paths for this endpoint, so we are done with it.
debugPrint1(debug_, "path_enum", 1, "nworst reached for %s\n",
// We have endpoint_count paths for this endpoint, so we are done with it.
debugPrint1(debug_, "path_enum", 1, "endpoint_count reached for %s\n",
vertex->name(sdc_network_));
deleteDiversionPathEnd(div);
}
@ -431,7 +431,7 @@ PathEnum::makeDiversion(PathEnd *div_end,
div_queue_.push(div);
div_count_++;
if (static_cast<int>(div_queue_.size()) > max_paths_ * 2)
if (static_cast<int>(div_queue_.size()) > group_count_ * 2)
// We have more potenial paths than we will need.
pruneDiversionQueue();
}
@ -442,14 +442,14 @@ PathEnum::pruneDiversionQueue()
debugPrint0(debug_, "path_enum", 2, "prune queue\n");
VertexPathCountMap path_counts;
int end_count = 0;
// Collect nworst diversions per vertex.
// Collect endpoint_count diversions per vertex.
DiversionSeq divs;
while (!div_queue_.empty()) {
Diversion *div = div_queue_.top();
Vertex *vertex = div->pathEnd()->vertex(this);
if (end_count < max_paths_
if (end_count < group_count_
&& ((unique_pins_ && path_counts[vertex] == 0)
|| (!unique_pins_ && path_counts[vertex] < nworst_))) {
|| (!unique_pins_ && path_counts[vertex] < endpoint_count_))) {
divs.push_back(div);
path_counts[vertex]++;
end_count++;

View File

@ -57,8 +57,8 @@ private:
class PathEnum : public Iterator<PathEnd*>, StaState
{
public:
PathEnum(int max_paths,
int nworst,
PathEnum(int group_count,
int endpoint_count,
bool unique_pins,
bool cmp_slack,
const MinMax *min_max,
@ -95,12 +95,12 @@ private:
void findNext();
bool cmp_slack_;
int max_paths_;
int nworst_;
int group_count_;
int endpoint_count_;
bool unique_pins_;
DiversionQueue div_queue_;
int div_count_;
// Number of paths returned for each endpoint (limited to nworst).
// Number of paths returned for each endpoint (limited to endpoint_count).
VertexPathCountMap path_counts_;
bool inserts_pruned_;
PathEnd *next_;

View File

@ -38,32 +38,32 @@ namespace sta {
PathGroup *
PathGroup::makePathGroupSlack(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
const StaState *sta)
{
return new PathGroup(name, max_paths, nworst, unique_pins,
return new PathGroup(name, group_count, endpoint_count, unique_pins,
slack_min, slack_max, true, MinMax::min(), sta);
}
PathGroup *
PathGroup::makePathGroupArrival(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
const MinMax *min_max,
const StaState *sta)
{
return new PathGroup(name, max_paths, nworst, unique_pins,
return new PathGroup(name, group_count, endpoint_count, unique_pins,
0.0, 0.0, false, min_max, sta);
}
PathGroup::PathGroup(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -71,8 +71,8 @@ PathGroup::PathGroup(const char *name,
const MinMax *min_max,
const StaState *sta) :
name_(name),
max_paths_(max_paths),
nworst_(nworst),
group_count_(group_count),
endpoint_count_(endpoint_count),
unique_pins_(unique_pins),
slack_min_(slack_min),
slack_max_(slack_max),
@ -119,8 +119,8 @@ PathGroup::insert(PathEnd *path_end)
{
lock_.lock();
path_ends_.push_back(path_end);
if (max_paths_ < std::numeric_limits<int>::max()
&& static_cast<int>(path_ends_.size()) > max_paths_ * 2)
if (group_count_ < std::numeric_limits<int>::max()
&& static_cast<int>(path_ends_.size()) > group_count_ * 2)
prune();
lock_.unlock();
}
@ -134,9 +134,9 @@ PathGroup::prune()
for (unsigned i = 0; i < path_ends_.size(); i++) {
PathEnd *path_end = path_ends_[i];
Vertex *vertex = path_end->vertex(sta_);
// Squish up to nworst path ends per vertex up to the front of path_ends_.
if (end_count < max_paths_
&& path_counts[vertex] < nworst_) {
// Squish up to endpoint_count path ends per vertex up to the front of path_ends_.
if (end_count < group_count_
&& path_counts[vertex] < endpoint_count_) {
path_ends_[end_count++] = path_end;
path_counts[vertex]++;
}
@ -175,7 +175,7 @@ PathGroup::iterator()
void
PathGroup::ensureSortedMaxPaths()
{
if (static_cast<int>(path_ends_.size()) > max_paths_)
if (static_cast<int>(path_ends_.size()) > group_count_)
prune();
else
sort();
@ -212,8 +212,8 @@ PathGroups::isGroupPathName(const char *group_name)
|| stringEq(group_name, unconstrained_group_name_);
}
PathGroups::PathGroups(int max_paths,
int nworst,
PathGroups::PathGroups(int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -227,23 +227,23 @@ PathGroups::PathGroups(int max_paths,
bool unconstrained,
const StaState *sta) :
StaState(sta),
max_paths_(max_paths),
nworst_(nworst),
group_count_(group_count),
endpoint_count_(endpoint_count),
unique_pins_(unique_pins),
slack_min_(slack_min),
slack_max_(slack_max)
{
makeGroups(max_paths, nworst, unique_pins, slack_min, slack_max, group_names,
makeGroups(group_count, endpoint_count, unique_pins, slack_min, slack_max, group_names,
setup, recovery, clk_gating_setup, unconstrained,
MinMax::max());
makeGroups(max_paths, nworst, unique_pins, slack_min, slack_max, group_names,
makeGroups(group_count, endpoint_count, unique_pins, slack_min, slack_max, group_names,
hold, removal, clk_gating_hold, unconstrained,
MinMax::min());
}
void
PathGroups::makeGroups(int max_paths,
int nworst,
PathGroups::makeGroups(int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -262,8 +262,8 @@ PathGroups::makeGroups(int max_paths,
GroupPathSet *groups;
group_path_iter->next(name, groups);
if (reportGroup(name, group_names)) {
PathGroup *group = PathGroup::makePathGroupSlack(name, max_paths,
nworst, unique_pins,
PathGroup *group = PathGroup::makePathGroupSlack(name, group_count,
endpoint_count, unique_pins,
slack_min, slack_max,
this);
named_map_[mm_index][name] = group;
@ -276,8 +276,8 @@ PathGroups::makeGroups(int max_paths,
Clock *clk = clk_iter->next();
const char *clk_name = clk->name();
if (reportGroup(clk_name, group_names)) {
PathGroup *group = PathGroup::makePathGroupSlack(clk_name, max_paths,
nworst, unique_pins,
PathGroup *group = PathGroup::makePathGroupSlack(clk_name, group_count,
endpoint_count, unique_pins,
slack_min, slack_max,
this);
clk_map_[mm_index][clk] = group;
@ -289,7 +289,7 @@ PathGroups::makeGroups(int max_paths,
if (setup_hold
&& reportGroup(path_delay_group_name_, group_names))
path_delay_[mm_index] = PathGroup::makePathGroupSlack(path_delay_group_name_,
max_paths, nworst,
group_count, endpoint_count,
unique_pins,
slack_min, slack_max,
this);
@ -299,7 +299,7 @@ PathGroups::makeGroups(int max_paths,
if (gated_clk
&& reportGroup(gated_clk_group_name_, group_names))
gated_clk_[mm_index] = PathGroup::makePathGroupSlack(gated_clk_group_name_,
max_paths, nworst,
group_count, endpoint_count,
unique_pins,
slack_min, slack_max,
this);
@ -309,7 +309,7 @@ PathGroups::makeGroups(int max_paths,
if (async
&& reportGroup(async_group_name_, group_names))
async_[mm_index] = PathGroup::makePathGroupSlack(async_group_name_,
max_paths, nworst,
group_count, endpoint_count,
unique_pins,
slack_min, slack_max,
this);
@ -320,7 +320,7 @@ PathGroups::makeGroups(int max_paths,
&& reportGroup(unconstrained_group_name_, group_names))
unconstrained_[mm_index] =
PathGroup::makePathGroupArrival(unconstrained_group_name_,
max_paths, nworst, unique_pins,
group_count, endpoint_count, unique_pins,
min_max, this);
else
unconstrained_[mm_index] = NULL;
@ -503,14 +503,14 @@ PathGroups::makePathEnds(ExceptionTo *to,
bool sort_by_slack)
{
Stats stats(this->debug());
makeGroupPathEnds(to, max_paths_, nworst_, unique_pins_, corner, min_max);
makeGroupPathEnds(to, group_count_, endpoint_count_, unique_pins_, corner, min_max);
PathEndSeq *path_ends = new PathEndSeq;
pushGroupPathEnds(path_ends);
if (sort_by_slack) {
sort(path_ends, PathEndLess(this));
if (static_cast<int>(path_ends->size()) > max_paths_)
path_ends->resize(max_paths_);
if (static_cast<int>(path_ends->size()) > group_count_)
path_ends->resize(group_count_);
}
if (search_->reportUnconstrainedPaths()
@ -608,7 +608,7 @@ MakePathEnds1::vertexEnd(Vertex *)
class MakePathEndsAll : public PathEndVisitor
{
public:
explicit MakePathEndsAll(int nworst,
explicit MakePathEndsAll(int endpoint_count,
PathGroups *path_groups);
virtual ~MakePathEndsAll();
virtual PathEndVisitor *copy();
@ -620,7 +620,7 @@ private:
void visitPathEnd(PathEnd *path_end,
PathGroup *group);
int nworst_;
int endpoint_count_;
PathGroups *path_groups_;
const StaState *sta_;
PathGroupEndsMap ends_;
@ -628,9 +628,9 @@ private:
PathEndNoCrprLess path_no_crpr_cmp_;
};
MakePathEndsAll::MakePathEndsAll(int nworst,
MakePathEndsAll::MakePathEndsAll(int endpoint_count,
PathGroups *path_groups) :
nworst_(nworst),
endpoint_count_(endpoint_count),
path_groups_(path_groups),
sta_(path_groups),
slack_cmp_(path_groups),
@ -642,7 +642,7 @@ MakePathEndsAll::MakePathEndsAll(int nworst,
PathEndVisitor *
MakePathEndsAll::copy()
{
return new MakePathEndsAll(nworst_, path_groups_);
return new MakePathEndsAll(endpoint_count_, path_groups_);
}
MakePathEndsAll::~MakePathEndsAll()
@ -692,7 +692,7 @@ MakePathEndsAll::vertexEnd(Vertex *)
PathEndSeq::Iterator end_iter(ends);
int n = 0;
while (end_iter.hasNext()
&& n < nworst_) {
&& n < endpoint_count_) {
PathEnd *path_end = end_iter.next();
// Only save the worst path end for each crpr tag.
// PathEnum will peel the others.
@ -732,18 +732,18 @@ MakePathEndsAll::vertexEnd(Vertex *)
void
PathGroups::makeGroupPathEnds(ExceptionTo *to,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
const Corner *corner,
const MinMaxAll *min_max)
{
if (nworst == 1) {
if (endpoint_count == 1) {
MakePathEnds1 make_path_ends(this);
makeGroupPathEnds(to, corner, min_max, &make_path_ends);
}
else {
MakePathEndsAll make_path_ends(nworst, this);
MakePathEndsAll make_path_ends(endpoint_count, this);
makeGroupPathEnds(to, corner, min_max, &make_path_ends);
MinMaxIterator mm_iter;
@ -757,7 +757,7 @@ PathGroups::makeGroupPathEnds(ExceptionTo *to,
group_path_iter->next(name, groups);
PathGroup *group = findPathGroup(name, path_min_max);
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, true, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, true, path_min_max);
}
delete group_path_iter;
@ -766,37 +766,37 @@ PathGroups::makeGroupPathEnds(ExceptionTo *to,
Clock *clk = clk_iter->next();
PathGroup *group = findPathGroup(clk, path_min_max);
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, true, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, true, path_min_max);
}
delete clk_iter;
PathGroup *group = unconstrained_[mm_index];
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, false, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, false, path_min_max);
group = path_delay_[mm_index];
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, true, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, true, path_min_max);
group = gated_clk_[mm_index];
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, true, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, true, path_min_max);
group = async_[mm_index];
if (group)
enumPathEnds(group, max_paths, nworst, unique_pins, true, path_min_max);
enumPathEnds(group, group_count, endpoint_count, unique_pins, true, path_min_max);
}
}
}
void
PathGroups::enumPathEnds(PathGroup *group,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
bool cmp_slack,
const MinMax *min_max)
{
// Insert the worst max_path path ends in the group into a path
// enumerator.
PathEnum path_enum(max_paths, nworst, unique_pins, cmp_slack, min_max, this);
PathEnum path_enum(group_count, endpoint_count, unique_pins, cmp_slack, min_max, this);
PathGroupIterator *end_iter = group->iterator();
while (end_iter->hasNext()) {
PathEnd *end = end_iter->next();
@ -806,8 +806,8 @@ PathGroups::enumPathEnds(PathGroup *group,
delete end_iter;
group->clear();
// Parallel path enumeratation to find the nworst/max path ends.
for (int n = 0; path_enum.hasNext() && n < max_paths; n++) {
// Parallel path enumeratation to find the endpoint_count/max path ends.
for (int n = 0; path_enum.hasNext() && n < group_count; n++) {
PathEnd *end = path_enum.next();
group->insert(end);
}

View File

@ -40,15 +40,15 @@ public:
virtual ~PathGroup();
// Path group that compares compare slacks.
static PathGroup *makePathGroupArrival(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
const MinMax *min_max,
const StaState *sta);
// Path group that compares arrival time, sorted by min_max.
static PathGroup *makePathGroupSlack(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float min_slack,
float max_slack,
@ -57,19 +57,19 @@ public:
const MinMax *minMax() const { return min_max_;}
const PathEndSeq &pathEnds() const { return path_ends_; }
void insert(PathEnd *path_end);
// Push max_paths into path_ends.
// Push group_count into path_ends.
void pushEnds(PathEndSeq *path_ends);
// Predicates to determine if a PathEnd is worth saving.
virtual bool savable(PathEnd *path_end);
int maxPaths() const { return max_paths_; }
int maxPaths() const { return group_count_; }
PathGroupIterator *iterator();
// This does NOT delete the path ends.
void clear();
protected:
PathGroup(const char *name,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float min_slack,
float max_slack,
@ -81,8 +81,8 @@ protected:
void sort();
const char *name_;
int max_paths_;
int nworst_;
int group_count_;
int endpoint_count_;
bool unique_pins_;
float slack_min_;
float slack_max_;
@ -100,8 +100,8 @@ private:
class PathGroups : public StaState
{
public:
PathGroups(int max_paths,
int nworst,
PathGroups(int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -132,8 +132,8 @@ public:
protected:
void makeGroupPathEnds(ExceptionTo *to,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
const Corner *corner,
const MinMaxAll *min_max);
@ -146,8 +146,8 @@ protected:
const MinMaxAll *min_max,
PathEndVisitor *visitor);
void enumPathEnds(PathGroup *group,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
bool cmp_slack,
const MinMax *min_max);
@ -156,8 +156,8 @@ protected:
void pushUnconstrainedPathEnds(PathEndSeq *path_ends,
const MinMaxAll *min_max);
void makeGroups(int max_paths,
int nworst,
void makeGroups(int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -171,8 +171,8 @@ protected:
PathGroupNameSet *group_names) const;
GroupPath *groupPathTo(const PathEnd *path_end) const;
int max_paths_;
int nworst_;
int group_count_;
int endpoint_count_;
bool unique_pins_;
float slack_min_;
float slack_max_;

View File

@ -418,8 +418,8 @@ Search::findPathEnds(ExceptionFrom *from,
ExceptionTo *to,
const Corner *corner,
const MinMaxAll *min_max,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -454,7 +454,7 @@ Search::findPathEnds(ExceptionFrom *from,
recovery = removal = false;
if (!sdc_->gatedClkChecksEnabled())
clk_gating_setup = clk_gating_hold = false;
path_groups_ = makePathGroups(max_paths, nworst, unique_pins,
path_groups_ = makePathGroups(group_count, endpoint_count, unique_pins,
slack_min, slack_max,
group_names, setup, hold,
recovery, removal,
@ -3965,8 +3965,8 @@ Search::wnsSlack(Vertex *vertex,
////////////////////////////////////////////////////////////////
PathGroups *
Search::makePathGroups(int max_paths,
int nworst,
Search::makePathGroups(int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -3978,7 +3978,7 @@ Search::makePathGroups(int max_paths,
bool clk_gating_setup,
bool clk_gating_hold)
{
return new PathGroups(max_paths, nworst, unique_pins,
return new PathGroups(group_count, endpoint_count, unique_pins,
slack_min, slack_max,
group_names,
setup, hold,

View File

@ -80,8 +80,8 @@ public:
ExceptionTo *to,
const Corner *corner,
const MinMaxAll *min_max,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -485,8 +485,8 @@ protected:
void tnsDecr(Vertex *vertex,
int min_max_index);
void tnsNotifyBefore(Vertex *vertex);
PathGroups *makePathGroups(int max_paths,
int nworst,
PathGroups *makePathGroups(int group_count,
int endpoint_count,
bool unique_pins,
float min_slack,
float max_slack,

View File

@ -2368,8 +2368,8 @@ Sta::findPathEnds(ExceptionFrom *from,
ExceptionTo *to,
const Corner *corner,
const MinMaxAll *min_max,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
float slack_min,
float slack_max,
@ -2384,7 +2384,7 @@ Sta::findPathEnds(ExceptionFrom *from,
{
searchPreamble();
return search_->findPathEnds(from, thrus, to,
corner, min_max, max_paths, nworst, unique_pins,
corner, min_max, group_count, endpoint_count, unique_pins,
slack_min, slack_max, sort_by_slack, group_names,
setup, hold,
recovery, removal,
@ -2484,22 +2484,22 @@ Sta::reportCheckTypes(bool all_violators,
|| removal
|| clock_gating_hold)
path_min_max = MinMaxAll::min();
int max_paths;
int group_count;
float slack_min, slack_max;
if (all_violators) {
max_paths = std::numeric_limits<int>::max();
group_count = std::numeric_limits<int>::max();
slack_min = -INF;
slack_max = 0.0;
}
else {
max_paths = 1;
group_count = 1;
slack_min = -INF;
slack_max = INF;
}
return findPathEnds(NULL, NULL, NULL, // from, thru, to
NULL, // corner
path_min_max, max_paths,
1, // nworst
path_min_max, group_count,
1, // endpoint_count
false, // unique_pins
slack_min, slack_max,
false, // sort_by_slack
@ -2568,7 +2568,7 @@ Sta::findGroupPathPins(const char *group_path_name)
NULL, NULL, NULL,
// corner, min_max,
NULL, MinMaxAll::max(),
// max_paths, nworst, unique_pins
// group_count, endpoint_count, unique_pins
1, 1, false,
-INF, INF, // slack_min, slack_max,
false, // sort_by_slack

View File

@ -776,11 +776,11 @@ public:
const MinMaxAll *min_max,
// Number of path ends to report in
// each group.
int max_paths,
int group_count,
// Number of paths to report for
// each endpoint.
int nworst,
// nworst paths report unique pins
int endpoint_count,
// endpoint_count paths report unique pins
// without rise/fall variations.
bool unique_pins,
// Min/max bounds for slack of
@ -812,11 +812,11 @@ public:
const MinMaxAll *min_max,
// Number of path ends to report in
// each group.
int max_paths,
int group_count,
// Number of paths to report for
// each endpoint.
int nworst,
// nworst paths report unique pins
int endpoint_count,
// endpoint_count paths report unique pins
// without rise/fall variations.
bool unique_pins,
// Min/max bounds for slack of

View File

@ -4415,8 +4415,8 @@ find_path_ends(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *delay_min_max,
int max_paths,
int nworst,
int group_count,
int endpoint_count,
bool unique_pins,
Corner *corner,
float slack_min,
@ -4428,7 +4428,7 @@ find_path_ends(ExceptionFrom *from,
Sta *sta = Sta::sta();
PathEndSeq *ends = sta->findPathEnds(from, thrus, to,
corner, delay_min_max,
max_paths, nworst, unique_pins,
group_count, endpoint_count, unique_pins,
slack_min, slack_max,
sort_by_slack, groups,
true, true, // setup, hold