diff --git a/doc/OpenSTA.odt b/doc/OpenSTA.odt index f62a343c..20a0359f 100644 Binary files a/doc/OpenSTA.odt and b/doc/OpenSTA.odt differ diff --git a/doc/OpenSTA.pdf b/doc/OpenSTA.pdf index a35bbbfa..a99d3a7f 100644 Binary files a/doc/OpenSTA.pdf and b/doc/OpenSTA.pdf differ diff --git a/include/sta/Search.hh b/include/sta/Search.hh index a5d0a521..85a59916 100644 --- a/include/sta/Search.hh +++ b/include/sta/Search.hh @@ -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; //////////////////////////////////////////////////////////////// diff --git a/include/sta/Sta.hh b/include/sta/Sta.hh index cbb91c82..0fdccfb9 100644 --- a/include/sta/Sta.hh +++ b/include/sta/Sta.hh @@ -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. diff --git a/search/Property.cc b/search/Property.cc index 459ca7a0..f67764a8 100644 --- a/search/Property.cc +++ b/search/Property.cc @@ -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); diff --git a/search/Search.cc b/search/Search.cc index bdaa9e0a..d1e25b1a 100644 --- a/search/Search.cc +++ b/search/Search.cc @@ -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), this); + while (path_iter.hasNext()) { + Path *path = path_iter.next(); + const Clock *clk = path->clock(this); + if (clk) + clks.insert(const_cast(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 { diff --git a/search/Sta.cc b/search/Sta.cc index ad3f42be..29c1319d 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -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