Skip to content

Commit

Permalink
Sta::clockDomains
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Apr 10, 2023
1 parent f5314d1 commit ec17970
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 2 deletions.
Binary file modified doc/OpenSTA.odt
Binary file not shown.
Binary file modified doc/OpenSTA.pdf
Binary file not shown.
8 changes: 7 additions & 1 deletion include/sta/Search.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

////////////////////////////////////////////////////////////////

Expand Down
4 changes: 3 additions & 1 deletion include/sta/Sta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions search/Property.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
36 changes: 36 additions & 0 deletions search/Search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 8 additions & 0 deletions search/Sta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec17970

Please sign in to comment.