Genclks::srcPathk return PathVertex

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-02-23 17:40:00 -07:00
parent 1da295318f
commit f5cd0b24c7
5 changed files with 25 additions and 40 deletions

View File

@ -302,8 +302,8 @@ CheckCrpr::genClkSrcPaths(const PathVertex *path,
PathAnalysisPt *path_ap = path->pathAnalysisPt(this);
gclk_paths.push_back(path);
while (clk_edge->clock()->isGenerated()) {
PathVertex genclk_path;
search_->genclks()->srcPath(clk_edge, clk_src, path_ap, genclk_path);
PathVertex genclk_path =
search_->genclks()->srcPath(clk_edge, clk_src, path_ap);
if (genclk_path.isNull())
break;
clk_info = genclk_path.clkInfo(this);

View File

@ -973,47 +973,40 @@ Genclks::matchesSrcFilter(Path *path,
return false;
}
void
Genclks::srcPath(Path *clk_path,
// Return value.
PathVertex &src_path) const
PathVertex
Genclks::srcPath(Path *clk_path) const
{
const Pin *src_pin = clk_path->pin(this);
const ClockEdge *clk_edge = clk_path->clkEdge(this);
const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(this);
const EarlyLate *early_late = clk_path->minMax(this);
PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late);
srcPath(clk_edge->clock(), src_pin, clk_edge->transition(),
insert_ap, src_path);
return srcPath(clk_edge->clock(), src_pin, clk_edge->transition(),
insert_ap);
}
void
PathVertex
Genclks::srcPath(const ClockEdge *clk_edge,
const Pin *src_pin,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const
const PathAnalysisPt *path_ap) const
{
srcPath(clk_edge->clock(), src_pin, clk_edge->transition(),
path_ap, src_path);
return srcPath(clk_edge->clock(), src_pin, clk_edge->transition(), path_ap);
}
void
PathVertex
Genclks::srcPath(const Clock *gclk,
const Pin *src_pin,
const RiseFall *rf,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const
const PathAnalysisPt *path_ap) const
{
PathVertexRep *src_paths =
genclk_src_paths_.findKey(ClockPinPair(gclk, src_pin));
if (src_paths) {
int path_index = srcPathIndex(rf, path_ap);
src_path.init(src_paths[path_index], this);
return PathVertex(src_paths[path_index], this);
}
else
src_path.init();
return PathVertex();
}
Arrival
@ -1023,9 +1016,8 @@ Genclks::insertionDelay(const Clock *clk,
const EarlyLate *early_late,
const PathAnalysisPt *path_ap) const
{
PathVertex src_path;
PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late);
srcPath(clk, pin, rf, insert_ap, src_path);
PathVertex src_path = srcPath(clk, pin, rf, insert_ap);
if (!src_path.isNull())
return src_path.arrival(this);
else

View File

@ -71,21 +71,15 @@ public:
const EarlyLate *early_late,
const PathAnalysisPt *path_ap) const;
// Generated clock source path for a clock path root.
void srcPath(Path *clk_path,
// Return value.
PathVertex &src_path) const;
PathVertex srcPath(Path *clk_path) const;
// Generated clock source path.
void srcPath(const ClockEdge *clk_edge,
const Pin *src_pin,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const;
void srcPath(const Clock *clk,
const Pin *src_pin,
const RiseFall *rf,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const;
PathVertex srcPath(const ClockEdge *clk_edge,
const Pin *src_pin,
const PathAnalysisPt *path_ap) const;
PathVertex srcPath(const Clock *clk,
const Pin *src_pin,
const RiseFall *rf,
const PathAnalysisPt *path_ap) const;
Vertex *srcPathVertex(const Pin *pin) const;
Level clkPinMaxLevel(const Clock *clk) const;
void copyGenClkSrcPaths(Vertex *vertex,

View File

@ -115,8 +115,7 @@ PathExpanded::expandGenclk(PathRef *clk_path)
if (!clk_path->isNull()) {
const Clock *src_clk = clk_path->clock(sta_);
if (src_clk && src_clk->isGenerated()) {
PathVertex src_path;
sta_->search()->genclks()->srcPath(clk_path, src_path);
PathVertex src_path = sta_->search()->genclks()->srcPath(clk_path);
if (!src_path.isNull()) {
// The head of the genclk src path is already in paths_,
// so skip past it.

View File

@ -2394,9 +2394,9 @@ ReportPath::reportGenClkSrcPath1(const Clock *clk,
bool clk_used_as_data) const
{
PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late);
PathVertex src_path;
const MinMax *min_max = path_ap->pathMinMax();
search_->genclks()->srcPath(clk, clk_pin, clk_rf, insert_ap, src_path);
PathVertex src_path =
search_->genclks()->srcPath(clk, clk_pin, clk_rf, insert_ap);
if (!src_path.isNull()) {
ClkInfo *src_clk_info = src_path.clkInfo(search_);
const ClockEdge *src_clk_edge = src_clk_info->clkEdge();