CheckCrpr::clkPathPrev

This commit is contained in:
James Cherry 2020-09-25 17:35:56 -07:00
parent c33a446918
commit b9824b62b2
3 changed files with 19 additions and 23 deletions

View File

@ -55,27 +55,24 @@ CheckCrpr::clkPathPrev(const PathVertex *path,
int arrival_index; int arrival_index;
bool exists; bool exists;
path->arrivalIndex(arrival_index, exists); path->arrivalIndex(arrival_index, exists);
return clkPathPrev(vertex, arrival_index, tmp); tmp = clkPathPrev(vertex, arrival_index);
} if (tmp.isNull())
PathVertex *
CheckCrpr::clkPathPrev(Vertex *vertex,
int arrival_index,
PathVertex &tmp)
{
PathVertexRep *prevs = graph_->prevPaths(vertex);
if (prevs) {
PathVertexRep *prev = &prevs[arrival_index];
if (prev->isNull())
return nullptr; return nullptr;
else { else
tmp.init(graph_->vertex(prev->vertexId()),
search_->tag(prev->tagIndex()), this);
return &tmp; return &tmp;
} }
}
else PathVertex
CheckCrpr::clkPathPrev(Vertex *vertex,
int arrival_index)
{
PathVertexRep *prevs = graph_->prevPaths(vertex);
if (prevs)
return PathVertex(prevs[arrival_index], this);
else {
internalError("missing prev paths"); internalError("missing prev paths");
return PathVertex();
}
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////

View File

@ -51,14 +51,14 @@ public:
Pin *&crpr_pin); Pin *&crpr_pin);
// Previous clk path when crpr is enabled. // Previous clk path when crpr is enabled.
PathVertex *clkPathPrev(const PathVertex *path, PathVertex clkPathPrev(const PathVertex *path);
PathVertex &tmp);
// For Search::reportArrivals. // For Search::reportArrivals.
PathVertex *clkPathPrev(Vertex *vertex, PathVertex clkPathPrev(Vertex *vertex,
int arrival_index, int arrival_index);
PathVertex &tmp);
private: private:
PathVertex *clkPathPrev(const PathVertex *path,
PathVertex &tmp);
Arrival otherMinMaxArrival(const PathVertex *path); Arrival otherMinMaxArrival(const PathVertex *path);
void checkCrpr1(const Path *src_path, void checkCrpr1(const Path *src_path,
const PathVertex *tgt_clk_path, const PathVertex *tgt_clk_path,

View File

@ -2745,10 +2745,9 @@ Search::reportArrivals(Vertex *vertex) const
} }
report_->print(" %s", tag->asString(this)); report_->print(" %s", tag->asString(this));
if (tag_group->hasClkTag()) { if (tag_group->hasClkTag()) {
PathVertex tmp; PathVertex prev = check_crpr_->clkPathPrev(vertex, arrival_index);
PathVertex *prev = check_crpr_->clkPathPrev(vertex, arrival_index, tmp);
report_->print(" clk_prev=[%s]", report_->print(" clk_prev=[%s]",
prev && !prev->isNull() ? prev->name(this) : "NULL"); prev.isNull() ? "NULL" : prev.name(this));
} }
report_->print("\n"); report_->print("\n");
} }