Sta::clockDomains

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2023-04-09 22:22:39 -07:00
parent f5314d1f22
commit ec179707be
7 changed files with 58 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -176,9 +176,12 @@ public:
bool isClock(const Vertex *vertex) const;
// Vertices on propagated generated clock source paths.
bool isGenClkSrc(const Vertex *vertex) const;
// The set of clocks that arrive at vertex.
// The set of clocks that arrive at vertex in the clock network.
ClockSet clocks(const Vertex *vertex) const;
ClockSet clocks(const Pin *pin) const;
// Clock domains for a vertex.
ClockSet clockDomains(const Vertex *vertex) const;
ClockSet clockDomains(const Pin *pin) const;
void visitStartpoints(VertexVisitor *visitor);
void visitEndpoints(VertexVisitor *visitor);
bool havePathGroups() const;
@ -526,6 +529,9 @@ protected:
void clocks(const Vertex *vertex,
// Return value.
ClockSet &clks) const;
void clockDomains(const Vertex *vertex,
// Return value.
ClockSet &clks) const;
////////////////////////////////////////////////////////////////

View File

@ -595,8 +595,10 @@ public:
bool thru_disabled,
bool thru_constants);
// The set of clocks that reach pin.
// The set of clocks that arrive at vertex in the clock network.
ClockSet clocks(const Pin *pin);
// Clock domains for a pin.
ClockSet clockDomains(const Pin *pin);
void checkSlewLimitPreamble();
// Return pins with the min/max slew limit slack.

View File

@ -882,6 +882,10 @@ getProperty(const Pin *pin,
ClockSet clks = sta->clocks(pin);
return PropertyValue(&clks);
}
else if (stringEqual(property, "clock_domains")) {
ClockSet clks = sta->clockDomains(pin);
return PropertyValue(&clks);
}
else if (stringEqual(property, "activity")) {
PwrActivity activity = sta->findClkedActivity(pin);
return PropertyValue(&activity);

View File

@ -3018,6 +3018,42 @@ Search::timingDerate(Vertex *from_vertex,
}
}
ClockSet
Search::clockDomains(const Vertex *vertex) const
{
ClockSet clks;
clockDomains(vertex, clks);
return clks;
}
void
Search::clockDomains(const Vertex *vertex,
// Return value.
ClockSet &clks) const
{
VertexPathIterator path_iter(const_cast<Vertex*>(vertex), this);
while (path_iter.hasNext()) {
Path *path = path_iter.next();
const Clock *clk = path->clock(this);
if (clk)
clks.insert(const_cast<Clock *>(clk));
}
}
ClockSet
Search::clockDomains(const Pin *pin) const
{
ClockSet clks;
Vertex *vertex;
Vertex *bidirect_drvr_vertex;
graph_->pinVertices(pin, vertex, bidirect_drvr_vertex);
if (vertex)
clockDomains(vertex, clks);
if (bidirect_drvr_vertex)
clockDomains(bidirect_drvr_vertex, clks);
return clks;
}
ClockSet
Search::clocks(const Vertex *vertex) const
{

View File

@ -4681,6 +4681,14 @@ Sta::clocks(const Pin *pin)
return search_->clocks(pin);
}
ClockSet
Sta::clockDomains(const Pin *pin)
{
searchPreamble();
search_->findAllArrivals();
return search_->clockDomains(pin);
}
////////////////////////////////////////////////////////////////
InstanceSet