diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b244963..cc5e26ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ cmake_minimum_required (VERSION 3.9) -project(STA VERSION 2.0.16) +project(STA VERSION 2.0.17) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_CXX_STANDARD 11) @@ -375,7 +375,6 @@ set(STA_HEADERS util/MinMax.hh util/Mutex.hh util/ObjectId.hh - util/ObjectIndex.hh util/ObjectTable.hh util/PatternMatch.hh util/Report.hh diff --git a/doc/ApiChanges.txt b/doc/ApiChanges.txt index 81bbb007..d7546dfd 100644 --- a/doc/ApiChanges.txt +++ b/doc/ApiChanges.txt @@ -16,6 +16,12 @@ This file summarizes STA API changes for each release. +Release 2.0.17 2019/11/11 +------------------------- + +Network::setVertexIndex renamed to setVertexId +Network::vertexIndex renamed to vertexId + Release 2.0.0 2018/06/11 ------------------------- diff --git a/graph/Graph.cc b/graph/Graph.cc index 26d8e117..ae98a281 100644 --- a/graph/Graph.cc +++ b/graph/Graph.cc @@ -79,9 +79,9 @@ Graph::makeGraph() void Graph::makeVerticesAndEdges() { - VertexIndex vertex_count; - EdgeIndex edge_count; - ArcIndex arc_count; + int vertex_count; + int edge_count; + int arc_count; vertexAndEdgeCounts(vertex_count, edge_count, arc_count); vertices_ = new VertexTable; edges_ = new EdgeTable; @@ -100,9 +100,9 @@ Graph::makeVerticesAndEdges() void Graph::vertexAndEdgeCounts(// Return values. - VertexIndex &vertex_count, - EdgeIndex &edge_count, - ArcIndex &arc_count) + int &vertex_count, + int &edge_count, + int &arc_count) { vertex_count = edge_count = arc_count = 0; PinSet visited_drvrs; @@ -121,9 +121,9 @@ void Graph::vertexAndEdgeCounts(const Instance *inst, PinSet &visited_drvrs, // Return values. - VertexIndex &vertex_count, - EdgeIndex &edge_count, - ArcIndex &arc_count) + int &vertex_count, + int &edge_count, + int &arc_count) { LibertyCell *cell = network_->libertyCell(inst); InstancePinIterator *pin_iter = network_->pinIterator(inst); @@ -221,8 +221,8 @@ void Graph::drvrPinEdgeCounts(Pin *drvr_pin, PinSet &visited_drvrs, // Return values. - EdgeIndex &edge_count, - ArcIndex &arc_count) + int &edge_count, + int &arc_count) { if (!visited_drvrs.findKey(drvr_pin)) { int drvr_count = 0; @@ -444,13 +444,13 @@ Graph::makeWireEdge(Pin *from_pin, //////////////////////////////////////////////////////////////// Vertex * -Graph::vertex(VertexIndex vertex_index) const +Graph::vertex(VertexId vertex_id) const { - return vertices_->pointer(vertex_index); + return vertices_->pointer(vertex_id); } -VertexIndex -Graph::index(const Vertex *vertex) const +VertexId +Graph::id(const Vertex *vertex) const { return vertices_->objectId(vertex); } @@ -471,7 +471,7 @@ Graph::makePinVertices(Pin *pin, if (!dir->isPowerGround()) { bool is_reg_clk = network_->isRegClkPin(pin); vertex = makeVertex(pin, false, is_reg_clk); - network_->setVertexIndex(pin, index(vertex)); + network_->setVertexId(pin, id(vertex)); if (dir->isBidirect()) { bidir_drvr_vertex = makeVertex(pin, true, is_reg_clk); pin_bidirect_drvr_vertex_map_[pin] = bidir_drvr_vertex; @@ -500,7 +500,7 @@ Graph::pinVertices(const Pin *pin, Vertex *&vertex, Vertex *&bidirect_drvr_vertex) const { - vertex = Graph::vertex(network_->vertexIndex(pin)); + vertex = Graph::vertex(network_->vertexId(pin)); if (network_->direction(pin)->isBidirect()) bidirect_drvr_vertex = pin_bidirect_drvr_vertex_map_.findKey(pin); else @@ -513,13 +513,13 @@ Graph::pinDrvrVertex(const Pin *pin) const if (network_->direction(pin)->isBidirect()) return pin_bidirect_drvr_vertex_map_.findKey(pin); else - return Graph::vertex(network_->vertexIndex(pin)); + return Graph::vertex(network_->vertexId(pin)); } Vertex * Graph::pinLoadVertex(const Pin *pin) const { - return vertex(network_->vertexIndex(pin)); + return vertex(network_->vertexId(pin)); } void @@ -532,20 +532,20 @@ Graph::deleteVertex(Vertex *vertex) pin_bidirect_drvr_vertex_map_.erase(pin_bidirect_drvr_vertex_map_ .find(pin)); else - network_->setVertexIndex(pin, vertex_id_null); + network_->setVertexId(pin, vertex_id_null); // Delete edges to vertex. - EdgeIndex edge_index, next_index; - for (edge_index = vertex->in_edges_; edge_index; edge_index = next_index) { - Edge *edge = Graph::edge(edge_index); - next_index = edge->vertex_in_link_; + EdgeId edge_id, next_id; + for (edge_id = vertex->in_edges_; edge_id; edge_id = next_id) { + Edge *edge = Graph::edge(edge_id); + next_id = edge->vertex_in_link_; deleteOutEdge(edge->from(this), edge); arc_count_ -= edge->timingArcSet()->arcCount(); edges_->destroy(edge); } // Delete edges from vertex. - for (edge_index = vertex->out_edges_; edge_index; edge_index = next_index) { - Edge *edge = Graph::edge(edge_index); - next_index = edge->vertex_out_next_; + for (edge_id = vertex->out_edges_; edge_id; edge_id = next_id) { + Edge *edge = Graph::edge(edge_id); + next_id = edge->vertex_out_next_; deleteInEdge(edge->to(this), edge); arc_count_ -= edge->timingArcSet()->arcCount(); edges_->destroy(edge); @@ -564,10 +564,10 @@ void Graph::deleteInEdge(Vertex *vertex, Edge *edge) { - EdgeIndex edge_index = index(edge); - EdgeIndex prev = 0; - for (EdgeIndex i = vertex->in_edges_; - i && i != edge_index; + EdgeId edge_id = id(edge); + EdgeId prev = 0; + for (EdgeId i = vertex->in_edges_; + i && i != edge_id; i = Graph::edge(i)->vertex_in_link_) prev = i; if (prev) @@ -580,8 +580,8 @@ void Graph::deleteOutEdge(Vertex *vertex, Edge *edge) { - EdgeIndex next = edge->vertex_out_next_; - EdgeIndex prev = edge->vertex_out_prev_; + EdgeId next = edge->vertex_out_next_; + EdgeId prev = edge->vertex_out_prev_; if (prev) Graph::edge(prev)->vertex_out_next_ = next; else @@ -651,8 +651,8 @@ Graph::slew(const Vertex *vertex, int table_index = (slew_tr_count_ == 1) ? ap_index : ap_index*slew_tr_count_+tr->index(); DelayTable *table = slew_tables_[table_index]; - VertexIndex vertex_index = index(vertex); - return table->ref(vertex_index); + VertexId vertex_id = id(vertex); + return table->ref(vertex_id); } else { static Slew slew(0.0); @@ -670,8 +670,8 @@ Graph::setSlew(Vertex *vertex, int table_index = (slew_tr_count_ == 1) ? ap_index : ap_index*slew_tr_count_+tr->index(); DelayTable *table = slew_tables_[table_index]; - VertexIndex vertex_index = index(vertex); - Slew &vertex_slew = table->ref(vertex_index); + VertexId vertex_id = id(vertex); + Slew &vertex_slew = table->ref(vertex_id); vertex_slew = slew; } } @@ -679,13 +679,13 @@ Graph::setSlew(Vertex *vertex, //////////////////////////////////////////////////////////////// Edge * -Graph::edge(EdgeIndex edge_index) const +Graph::edge(EdgeId edge_id) const { - return edges_->pointer(edge_index); + return edges_->pointer(edge_id); } -EdgeIndex -Graph::index(const Edge *edge) const +EdgeId +Graph::id(const Edge *edge) const { return edges_->objectId(edge); } @@ -696,7 +696,7 @@ Graph::makeEdge(Vertex *from, TimingArcSet *arc_set) { Edge *edge = edges_->make(); - edge->init(index(from), index(to), arc_set); + edge->init(id(from), id(to), arc_set); makeEdgeArcDelays(edge); arc_count_ += arc_set->arcCount(); // Add out edge to from vertex. @@ -727,7 +727,7 @@ Graph::deleteEdge(Edge *edge) } void -Graph::makeArcDelayTables(ArcIndex arc_count, +Graph::makeArcDelayTables(int arc_count, DcalcAPIndex ap_count) { if (have_arc_delays_) { @@ -754,17 +754,17 @@ Graph::makeEdgeArcDelays(Edge *edge) { if (have_arc_delays_) { int arc_count = edge->timingArcSet()->arcCount(); - ArcIndex arc_index = 0; + ArcId arc_id = 0; for (DcalcAPIndex i = 0; i < ap_count_; i++) { DelayTable *table = arc_delays_[i]; ArcDelay *arc_delays; - table->make(arc_count, arc_delays, arc_index); + table->make(arc_count, arc_delays, arc_id); for (int j = 0; j < arc_count; j++) arc_delays[j] = 0.0; } - edge->setArcDelays(arc_index); + edge->setArcDelays(arc_id); // Make sure there is room for delay_annotated flags. - size_t max_annot_index = (arc_index + arc_count) * ap_count_; + size_t max_annot_index = (arc_id + arc_count) * ap_count_; if (max_annot_index >= arc_delay_annotated_.size()) { size_t size = max_annot_index * 1.2; arc_delay_annotated_.resize(size); @@ -1349,8 +1349,8 @@ Edge::Edge() } void -Edge::init(VertexIndex from, - VertexIndex to, +Edge::init(VertexId from, + VertexId to, TimingArcSet *arc_set) { from_ = from; @@ -1383,7 +1383,7 @@ Edge::setTimingArcSet(TimingArcSet *set) } void -Edge::setArcDelays(ArcIndex arc_delays) +Edge::setArcDelays(ArcId arc_delays) { arc_delays_ = arc_delays; } @@ -1515,7 +1515,7 @@ VertexIterator::findNextPin() { while (pin_iter_->hasNext()) { Pin *pin = pin_iter_->next(); - vertex_ = graph_->vertex(network_->vertexIndex(pin)); + vertex_ = graph_->vertex(network_->vertexId(pin)); bidir_vertex_ = network_->direction(pin)->isBidirect() ? graph_->pin_bidirect_drvr_vertex_map_.findKey(pin) : nullptr; @@ -1558,9 +1558,9 @@ VertexInEdgeIterator::VertexInEdgeIterator(Vertex *vertex, { } -VertexInEdgeIterator::VertexInEdgeIterator(VertexIndex vertex_index, +VertexInEdgeIterator::VertexInEdgeIterator(VertexId vertex_id, const Graph *graph) : - next_(graph->edge(graph->vertex(vertex_index)->in_edges_)), + next_(graph->edge(graph->vertex(vertex_id)->in_edges_)), graph_(graph) { } diff --git a/graph/Graph.hh b/graph/Graph.hh index efe71c42..4479e3d1 100644 --- a/graph/Graph.hh +++ b/graph/Graph.hh @@ -81,8 +81,8 @@ public: // Vertex functions. // Bidirect pins have two vertices. - virtual Vertex *vertex(VertexIndex vertex_index) const; - VertexIndex index(const Vertex *vertex) const; + virtual Vertex *vertex(VertexId vertex_id) const; + VertexId id(const Vertex *vertex) const; void makePinVertices(Pin *pin); void makePinVertices(Pin *pin, Vertex *&vertex, @@ -98,7 +98,7 @@ public: Vertex *pinLoadVertex(const Pin *pin) const; virtual void deleteVertex(Vertex *vertex); bool hasFaninOne(Vertex *vertex) const; - VertexIndex vertexCount() { return vertices_->size(); } + VertexId vertexCount() { return vertices_->size(); } Arrival *makeArrivals(Vertex *vertex, uint32_t count); Arrival *arrivals(Vertex *vertex) const; @@ -120,8 +120,8 @@ public: const Slew &slew); // Edge functions. - virtual Edge *edge(EdgeIndex edge_index) const; - EdgeIndex index(const Edge *edge) const; + virtual Edge *edge(EdgeId edge_index) const; + EdgeId id(const Edge *edge) const; virtual Edge *makeEdge(Vertex *from, Vertex *to, TimingArcSet *arc_set); @@ -165,8 +165,8 @@ public: bool annotated); // True if any edge arc is annotated. bool delayAnnotated(Edge *edge); - EdgeIndex edgeCount() { return edges_->size(); } - virtual ArcIndex arcCount() { return arc_count_; } + int edgeCount() { return edges_->size(); } + virtual int arcCount() { return arc_count_; } // Sdf width check annotation. void widthCheckAnnotation(const Pin *pin, @@ -196,20 +196,20 @@ public: protected: void makeVerticesAndEdges(); void vertexAndEdgeCounts(// Return values. - VertexIndex &vertex_count, - EdgeIndex &edge_count, - ArcIndex &arc_count); + int &vertex_count, + int &edge_count, + int &arc_count); virtual void vertexAndEdgeCounts(const Instance *inst, PinSet &visited_drvrs, // Return values. - VertexIndex &vertex_count, - EdgeIndex &edge_count, - ArcIndex &arc_count); + int &vertex_count, + int &edge_count, + int &arc_count); virtual void drvrPinEdgeCounts(Pin *pin, PinSet &visited_drvrs, // Return values. - EdgeIndex &edge_count, - ArcIndex &arc_count); + int &edge_count, + int &arc_count); Vertex *makeVertex(Pin *pin, bool is_bidirect_drvr, bool is_reg_clk); @@ -228,7 +228,7 @@ protected: void makeSlewTables(DcalcAPIndex count); void deleteSlewTables(); void makeVertexSlews(Vertex *vertex); - void makeArcDelayTables(ArcIndex arc_count, + void makeArcDelayTables(int arc_count, DcalcAPIndex ap_count); void deleteArcDelayTables(); void deleteInEdge(Vertex *vertex, @@ -247,7 +247,7 @@ protected: // driver/source (top level input, instance pin output) vertex // in pin_bidirect_drvr_vertex_map PinVertexMap pin_bidirect_drvr_vertex_map_; - ArcIndex arc_count_; + int arc_count_; ArrivalsTable arrivals_; std::mutex arrivals_lock_; PrevPathsTable prev_paths_; @@ -256,8 +256,8 @@ protected: int slew_tr_count_; bool have_arc_delays_; DcalcAPIndex ap_count_; - DelayTableSeq slew_tables_; // [ap_index][tr_index][vertex_index] - VertexIndex slew_count_; + DelayTableSeq slew_tables_; // [ap_index][tr_index][vertex_id] + VertexId slew_count_; DelayTableSeq arc_delays_; // [ap_index][edge_arc_index] // Sdf width check annotations. WidthCheckAnnotations *width_check_annotations_; @@ -353,8 +353,8 @@ protected: Pin *pin_; ArrivalId arrivals_; PrevPathId prev_paths_; - EdgeIndex in_edges_; // Edges to this vertex. - EdgeIndex out_edges_; // Edges from this vertex. + EdgeId in_edges_; // Edges to this vertex. + EdgeId out_edges_; // Edges from this vertex. // 4 bytes unsigned int tag_group_index_:tag_group_index_bits; // 24 @@ -409,8 +409,8 @@ public: TimingSense sense() const; TimingArcSet *timingArcSet() const { return arc_set_; } void setTimingArcSet(TimingArcSet *set); - ArcIndex arcDelays() const { return arc_delays_; } - void setArcDelays(ArcIndex arc_delays); + ArcId arcDelays() const { return arc_delays_; } + void setArcDelays(ArcId arc_delays); bool delayAnnotationIsIncremental() const; void setDelayAnnotationIsIncremental(bool is_incr); // Edge is disabled by set_disable_timing constraint. @@ -437,8 +437,8 @@ public: void setObjectIdx(ObjectIdx idx); protected: - void init(VertexIndex from, - VertexIndex to, + void init(VertexId from, + VertexId to, TimingArcSet *arc_set); TimingArcSet *arc_set_; @@ -447,7 +447,7 @@ protected: EdgeId vertex_in_link_; // Vertex in edges list. EdgeId vertex_out_next_; // Vertex out edges doubly linked list. EdgeId vertex_out_prev_; - ArcIndex arc_delays_; + ArcId arc_delays_; bool delay_annotation_is_incremental_:1; bool is_bidirect_inst_path_:1; bool is_bidirect_net_path_:1; @@ -497,7 +497,7 @@ class VertexInEdgeIterator : public VertexEdgeIterator public: VertexInEdgeIterator(Vertex *vertex, const Graph *graph); - VertexInEdgeIterator(VertexIndex vertex_index, + VertexInEdgeIterator(VertexId vertex_id, const Graph *graph); bool hasNext() { return (next_ != nullptr); } Edge *next(); diff --git a/graph/GraphClass.hh b/graph/GraphClass.hh index 17285e24..1040671d 100644 --- a/graph/GraphClass.hh +++ b/graph/GraphClass.hh @@ -17,7 +17,7 @@ #ifndef STA_GRAPH_CLASS_H #define STA_GRAPH_CLASS_H -#include "ObjectIndex.hh" +#include "ObjectId.hh" #include "Set.hh" #include "Vector.hh" #include "MinMax.hh" @@ -34,9 +34,9 @@ class VertexInEdgeIterator; class VertexOutEdgeIterator; class GraphLoop; -typedef ObjectIndex VertexIndex; -typedef ObjectIndex EdgeIndex; -typedef ObjectIndex ArcIndex; +typedef ObjectId VertexId; +typedef ObjectId EdgeId; +typedef ObjectId ArcId; typedef Set VertexSet; typedef Vector VertexSeq; typedef Vector EdgeSeq; diff --git a/network/ConcreteNetwork.cc b/network/ConcreteNetwork.cc index 9f988a05..9ebba0ed 100644 --- a/network/ConcreteNetwork.cc +++ b/network/ConcreteNetwork.cc @@ -1033,15 +1033,15 @@ ConcreteNetwork::direction(const Pin *pin) const } VertexId -ConcreteNetwork::vertexIndex(const Pin *pin) const +ConcreteNetwork::vertexId(const Pin *pin) const { const ConcretePin *cpin = reinterpret_cast(pin); return cpin->vertexId(); } void -ConcreteNetwork::setVertexIndex(Pin *pin, - VertexId id) +ConcreteNetwork::setVertexId(Pin *pin, + VertexId id) { ConcretePin *cpin = reinterpret_cast(pin); cpin->setVertexId(id); diff --git a/network/ConcreteNetwork.hh b/network/ConcreteNetwork.hh index c6f92de8..f6239bc6 100644 --- a/network/ConcreteNetwork.hh +++ b/network/ConcreteNetwork.hh @@ -131,9 +131,9 @@ public: virtual Term *term(const Pin *pin) const; virtual Port *port(const Pin *pin) const; virtual PortDirection *direction(const Pin *pin) const; - virtual VertexId vertexIndex(const Pin *pin) const; - virtual void setVertexIndex(Pin *pin, - VertexId id); + virtual VertexId vertexId(const Pin *pin) const; + virtual void setVertexId(Pin *pin, + VertexId id); virtual Net *net(const Term *term) const; virtual Pin *pin(const Term *term) const; diff --git a/network/Network.hh b/network/Network.hh index dd6e8451..0df859ec 100644 --- a/network/Network.hh +++ b/network/Network.hh @@ -321,9 +321,9 @@ public: virtual bool pinLess(const Pin *pin1, const Pin *pin2) const; // Return the id of the pin graph vertex. - virtual VertexId vertexIndex(const Pin *pin) const = 0; - virtual void setVertexIndex(Pin *pin, - VertexId id) = 0; + virtual VertexId vertexId(const Pin *pin) const = 0; + virtual void setVertexId(Pin *pin, + VertexId id) = 0; int pinCount(); int pinCount(Instance *inst); int leafPinCount(); diff --git a/network/SdcNetwork.cc b/network/SdcNetwork.cc index f4e9a757..8392cb35 100644 --- a/network/SdcNetwork.cc +++ b/network/SdcNetwork.cc @@ -211,16 +211,16 @@ NetworkNameAdapter::direction(const Port *port) const } VertexId -NetworkNameAdapter::vertexIndex(const Pin *pin) const +NetworkNameAdapter::vertexId(const Pin *pin) const { - return network_->vertexIndex(pin); + return network_->vertexId(pin); } void -NetworkNameAdapter::setVertexIndex(Pin *pin, - VertexId id) +NetworkNameAdapter::setVertexId(Pin *pin, + VertexId id) { - network_->setVertexIndex(pin, id); + network_->setVertexId(pin, id); } bool diff --git a/network/SdcNetwork.hh b/network/SdcNetwork.hh index 9e27c3f9..fd35a122 100644 --- a/network/SdcNetwork.hh +++ b/network/SdcNetwork.hh @@ -100,9 +100,9 @@ public: virtual Net *net(const Pin *pin) const; virtual Term *term(const Pin *pin) const; virtual PortDirection *direction(const Pin *pin) const; - virtual VertexId vertexIndex(const Pin *pin) const; - virtual void setVertexIndex(Pin *pin, - VertexId id); + virtual VertexId vertexId(const Pin *pin) const; + virtual void setVertexId(Pin *pin, + VertexId id); virtual Net *net(const Term *term) const; virtual Pin *pin(const Term *term) const; diff --git a/search/ClkInfo.cc b/search/ClkInfo.cc index 0d1f7bbe..968727a9 100644 --- a/search/ClkInfo.cc +++ b/search/ClkInfo.cc @@ -76,10 +76,10 @@ ClkInfo::findHash(const StaState *sta) const Network *network = sta->network(); if (clk_src_) - hashIncr(hash_, network->vertexIndex(clk_src_)); + hashIncr(hash_, network->vertexId(clk_src_)); if (gen_clk_src_) - hashIncr(hash_, network->vertexIndex(gen_clk_src_)); - hashIncr(hash_, crprClkVertexIndex()); + hashIncr(hash_, network->vertexId(gen_clk_src_)); + hashIncr(hash_, crprClkVertexId()); if (uncertainties_) { float uncertainty; bool exists; @@ -99,13 +99,13 @@ ClkInfo::findHash(const StaState *sta) hashIncr(hash_, path_ap_index_); } -VertexIndex -ClkInfo::crprClkVertexIndex() const +VertexId +ClkInfo::crprClkVertexId() const { if (crpr_clk_path_.isNull()) return 0; else - return crpr_clk_path_.vertexIndex(); + return crpr_clk_path_.vertexId(); } const char * diff --git a/search/ClkInfo.hh b/search/ClkInfo.hh index 988870ea..9b36b3d9 100644 --- a/search/ClkInfo.hh +++ b/search/ClkInfo.hh @@ -62,7 +62,7 @@ public: const PathVertexRep &crprClkPath() const { return crpr_clk_path_; } const Pin *crprClkPin(const StaState *sta) const; // Much faster than crprClkPin. - VertexIndex crprClkVertexIndex() const; + VertexId crprClkVertexId() const; // Much faster than crprClkPin != nullptr bool hasCrprClkPin() const { return !crpr_clk_path_.isNull(); } bool refsFilter(const StaState *sta) const; diff --git a/search/Crpr.cc b/search/Crpr.cc index f733121d..a5e8290f 100644 --- a/search/Crpr.cc +++ b/search/Crpr.cc @@ -68,7 +68,7 @@ CheckCrpr::clkPathPrev(Vertex *vertex, if (prev->isNull()) return nullptr; else { - tmp.init(graph_->vertex(prev->vertexIndex()), + tmp.init(graph_->vertex(prev->vertexId()), search_->tag(prev->tagIndex()), this); return &tmp; } diff --git a/search/Path.cc b/search/Path.cc index b2508f74..bc3b7b92 100644 --- a/search/Path.cc +++ b/search/Path.cc @@ -249,7 +249,7 @@ Path::equal(const Path *path1, { return (path1 && path2 - && path1->vertexIndex(sta) == path2->vertexIndex(sta) + && path1->vertexId(sta) == path2->vertexId(sta) // Tag equal implies transition and path ap equal. && path1->tagIndex(sta) == path2->tagIndex(sta)) || ((path1 == nullptr || path1->isNull()) @@ -284,9 +284,9 @@ Path::cmp(const Path *path1, const StaState *sta) { if (path1 && path2) { - VertexIndex vertex_index1 = path1->vertexIndex(sta); - VertexIndex vertex_index2 = path2->vertexIndex(sta); - if (vertex_index1 == vertex_index2) { + VertexId vertex_id1 = path1->vertexId(sta); + VertexId vertex_id2 = path2->vertexId(sta); + if (vertex_id1 == vertex_id2) { TagIndex tag_index1 = path1->tagIndex(sta); TagIndex tag_index2 = path2->tagIndex(sta); if (tag_index1 == tag_index2) @@ -296,7 +296,7 @@ Path::cmp(const Path *path1, else return 1; } - else if (vertex_index1 < vertex_index2) + else if (vertex_id1 < vertex_id2) return -1; else return 1; @@ -315,11 +315,11 @@ Path::cmpNoCrpr(const Path *path1, const Path *path2, const StaState *sta) { - VertexIndex vertex_index1 = path1->vertexIndex(sta); - VertexIndex vertex_index2 = path2->vertexIndex(sta); - if (vertex_index1 == vertex_index2) + VertexId vertex_id1 = path1->vertexId(sta); + VertexId vertex_id2 = path2->vertexId(sta); + if (vertex_id1 == vertex_id2) return tagMatchCmp(path1->tag(sta), path2->tag(sta), false, sta); - else if (vertex_index1 < vertex_index2) + else if (vertex_id1 < vertex_id2) return -1; else return 1; diff --git a/search/Path.hh b/search/Path.hh index 5a4d7dcb..a7da5b87 100644 --- a/search/Path.hh +++ b/search/Path.hh @@ -44,7 +44,7 @@ public: virtual void setRef(PathRef *ref) const = 0; virtual void setRef(PathRef &ref) const { setRef(&ref); } virtual Vertex *vertex(const StaState *sta) const = 0; - virtual VertexIndex vertexIndex(const StaState *sta) const = 0; + virtual VertexId vertexId(const StaState *sta) const = 0; virtual Pin *pin(const StaState *sta) const; virtual Tag *tag(const StaState *sta) const = 0; virtual TagIndex tagIndex(const StaState *sta) const; diff --git a/search/PathEnum.cc b/search/PathEnum.cc index 4ab0bea9..ad14e3d4 100644 --- a/search/PathEnum.cc +++ b/search/PathEnum.cc @@ -538,7 +538,7 @@ PathEnum::makeDivertedPath(Path *path, PathRef prev; TimingArc *prev_arc; p.prevPath(this, prev, prev_arc); - PathEnumed *copy = new PathEnumed(p.vertexIndex(this), + PathEnumed *copy = new PathEnumed(p.vertexId(this), p.tagIndex(this), p.arrival(this), nullptr, // prev_path made in next pass. diff --git a/search/PathEnumed.cc b/search/PathEnumed.cc index 646b5bc7..19ece450 100644 --- a/search/PathEnumed.cc +++ b/search/PathEnumed.cc @@ -25,7 +25,7 @@ namespace sta { -PathEnumed:: PathEnumed(VertexIndex vertex_index, +PathEnumed:: PathEnumed(VertexId vertex_id, TagIndex tag_index, Arrival arrival, PathEnumed *prev_path, @@ -34,7 +34,7 @@ PathEnumed:: PathEnumed(VertexIndex vertex_index, prev_path_(prev_path), prev_arc_(prev_arc), arrival_(arrival), - vertex_index_(vertex_index), + vertex_id_(vertex_id), tag_index_(tag_index) { } @@ -59,13 +59,13 @@ Vertex * PathEnumed::vertex(const StaState *sta) const { const Graph *graph = sta->graph(); - return graph->vertex(vertex_index_); + return graph->vertex(vertex_id_); } -VertexIndex -PathEnumed::vertexIndex(const StaState *) const +VertexId +PathEnumed::vertexId(const StaState *) const { - return vertex_index_; + return vertex_id_; } Tag * diff --git a/search/PathEnumed.hh b/search/PathEnumed.hh index 9310f57e..dee31d0d 100644 --- a/search/PathEnumed.hh +++ b/search/PathEnumed.hh @@ -26,15 +26,15 @@ namespace sta { class PathEnumed : public Path { public: - PathEnumed(VertexIndex vertex_index, + PathEnumed(VertexId vertex_id, TagIndex tag_index, Arrival arrival, PathEnumed *prev_path, TimingArc *prev_arc); virtual void setRef(PathRef *ref) const; - virtual bool isNull() const { return vertex_index_ == 0; } + virtual bool isNull() const { return vertex_id_ == 0; } virtual Vertex *vertex(const StaState *sta) const; - virtual VertexIndex vertexIndex(const StaState *sta) const; + virtual VertexId vertexId(const StaState *sta) const; virtual Tag *tag(const StaState *sta) const; virtual const TransRiseFall *transition(const StaState *sta) const; virtual int trIndex(const StaState *) const; @@ -65,7 +65,7 @@ protected: PathEnumed *prev_path_; TimingArc *prev_arc_; Arrival arrival_; - VertexIndex vertex_index_; + VertexId vertex_id_; unsigned int tag_index_:tag_index_bits; private: diff --git a/search/PathRef.cc b/search/PathRef.cc index cc1c7d0c..30b1443b 100644 --- a/search/PathRef.cc +++ b/search/PathRef.cc @@ -132,13 +132,13 @@ PathRef::vertex(const StaState *sta) const return path_vertex_.vertex(sta); } -VertexIndex -PathRef::vertexIndex(const StaState *sta) const +VertexId +PathRef::vertexId(const StaState *sta) const { if (path_enumed_) - return path_enumed_->vertexIndex(sta); + return path_enumed_->vertexId(sta); else - return path_vertex_.vertexIndex(sta); + return path_vertex_.vertexId(sta); } Tag * diff --git a/search/PathRef.hh b/search/PathRef.hh index 74c80a1f..de960d35 100644 --- a/search/PathRef.hh +++ b/search/PathRef.hh @@ -50,7 +50,7 @@ public: virtual void setRef(PathRef *ref) const; virtual bool isNull() const; virtual Vertex *vertex(const StaState *sta) const; - virtual VertexIndex vertexIndex(const StaState *sta) const; + virtual VertexId vertexId(const StaState *sta) const; virtual Tag *tag(const StaState *sta) const; virtual TagIndex tagIndex(const StaState *sta) const; virtual const TransRiseFall *transition(const StaState *sta) const; diff --git a/search/PathVertex.cc b/search/PathVertex.cc index 586d50f3..44bbe0e5 100644 --- a/search/PathVertex.cc +++ b/search/PathVertex.cc @@ -184,11 +184,11 @@ PathVertex::setRef(PathRef *ref) const ref->init(vertex_, tag_, arrival_index_); } -VertexIndex -PathVertex::vertexIndex(const StaState *sta) const +VertexId +PathVertex::vertexId(const StaState *sta) const { const Graph *graph = sta->graph(); - return graph->index(vertex_); + return graph->id(vertex_); } TagIndex diff --git a/search/PathVertex.hh b/search/PathVertex.hh index 80b120e7..2f62ebb1 100644 --- a/search/PathVertex.hh +++ b/search/PathVertex.hh @@ -59,7 +59,7 @@ public: virtual bool isNull() const; virtual void setRef(PathRef *ref) const; virtual Vertex *vertex(const StaState *) const { return vertex_; } - virtual VertexIndex vertexIndex(const StaState *sta) const; + virtual VertexId vertexId(const StaState *sta) const; virtual Tag *tag(const StaState *) const { return tag_; } virtual TagIndex tagIndex(const StaState *sta) const; virtual const TransRiseFall *transition(const StaState *) const; diff --git a/search/PathVertexRep.cc b/search/PathVertexRep.cc index 76d31cfb..1ba1f859 100644 --- a/search/PathVertexRep.cc +++ b/search/PathVertexRep.cc @@ -52,10 +52,10 @@ PathVertexRep::PathVertexRep(const PathVertex &path, init(path, sta); } -PathVertexRep::PathVertexRep(VertexIndex vertex_index, +PathVertexRep::PathVertexRep(VertexId vertex_id, TagIndex tag_index, bool is_enum) : - vertex_index_(vertex_index), + vertex_id_(vertex_id), tag_index_(tag_index), is_enum_(is_enum) { @@ -64,7 +64,7 @@ PathVertexRep::PathVertexRep(VertexIndex vertex_index, void PathVertexRep::init() { - vertex_index_ = 0; + vertex_id_ = 0; tag_index_ = tag_index_null; is_enum_ = false; } @@ -73,7 +73,7 @@ void PathVertexRep::init(const PathVertexRep *path) { if (path) { - vertex_index_ = path->vertex_index_; + vertex_id_ = path->vertex_id_; tag_index_ = path->tag_index_; is_enum_ = false; } @@ -84,7 +84,7 @@ PathVertexRep::init(const PathVertexRep *path) void PathVertexRep::init(const PathVertexRep &path) { - vertex_index_ = path.vertex_index_; + vertex_id_ = path.vertex_id_; tag_index_ = path.tag_index_; is_enum_ = false; } @@ -96,7 +96,7 @@ PathVertexRep::init(const PathVertex *path, if (path == nullptr || path->isNull()) init(); else { - vertex_index_ = sta->graph()->index(path->vertex(sta)); + vertex_id_ = sta->graph()->id(path->vertex(sta)); tag_index_ = path->tag(sta)->index(); is_enum_ = false; } @@ -109,7 +109,7 @@ PathVertexRep::init(const PathVertex &path, if (path.isNull()) init(); else { - vertex_index_ = sta->graph()->index(path.vertex(sta)); + vertex_id_ = sta->graph()->id(path.vertex(sta)); tag_index_ = path.tag(sta)->index(); is_enum_ = false; } @@ -119,7 +119,7 @@ Vertex * PathVertexRep::vertex(const StaState *sta) const { const Graph *graph = sta->graph(); - return graph->vertex(vertex_index_); + return graph->vertex(vertex_id_); } Tag * @@ -135,7 +135,7 @@ PathVertexRep::arrival(const StaState *sta) const const Graph *graph = sta->graph(); const Search *search = sta->search(); Tag *tag = search->tag(tag_index_); - Vertex *vertex = graph->vertex(vertex_index_); + Vertex *vertex = graph->vertex(vertex_id_); TagGroup *tag_group = search->tagGroup(vertex); int arrival_index; bool arrival_exists; @@ -162,7 +162,7 @@ bool PathVertexRep::equal(const PathVertexRep *path1, const PathVertexRep *path2) { - return path1->vertex_index_ == path2->vertex_index_ + return path1->vertex_id_ == path2->vertex_id_ && path1->tag_index_ == path2->tag_index_; } @@ -170,7 +170,7 @@ bool PathVertexRep::equal(const PathVertexRep &path1, const PathVertexRep &path2) { - return path1.vertex_index_ == path2.vertex_index_ + return path1.vertex_id_ == path2.vertex_id_ && path1.tag_index_ == path2.tag_index_; } @@ -179,9 +179,9 @@ PathVertexRep::cmp(const PathVertexRep *path1, const PathVertexRep *path2) { if (path1 && path2) { - VertexIndex vertex_index1 = path1->vertexIndex(); - VertexIndex vertex_index2 = path2->vertexIndex(); - if (vertex_index1 == vertex_index2) { + VertexId vertex_id1 = path1->vertexId(); + VertexId vertex_id2 = path2->vertexId(); + if (vertex_id1 == vertex_id2) { TagIndex tag_index1 = path1->tagIndex(); TagIndex tag_index2 = path2->tagIndex(); if (tag_index1 == tag_index2) @@ -191,7 +191,7 @@ PathVertexRep::cmp(const PathVertexRep *path1, else return 1; } - else if (vertex_index1 < vertex_index2) + else if (vertex_id1 < vertex_id2) return -1; else return 1; @@ -209,9 +209,9 @@ int PathVertexRep::cmp(const PathVertexRep &path1, const PathVertexRep &path2) { - VertexIndex vertex_index1 = path1.vertexIndex(); - VertexIndex vertex_index2 = path2.vertexIndex(); - if (vertex_index1 == vertex_index2) { + VertexId vertex_id1 = path1.vertexId(); + VertexId vertex_id2 = path2.vertexId(); + if (vertex_id1 == vertex_id2) { TagIndex tag_index1 = path1.tagIndex(); TagIndex tag_index2 = path2.tagIndex(); if (tag_index1 == tag_index2) @@ -221,7 +221,7 @@ PathVertexRep::cmp(const PathVertexRep &path1, else return 1; } - else if (vertex_index1 < vertex_index2) + else if (vertex_id1 < vertex_id2) return -1; else return 1; diff --git a/search/PathVertexRep.hh b/search/PathVertexRep.hh index 686d59d4..7ba3227c 100644 --- a/search/PathVertexRep.hh +++ b/search/PathVertexRep.hh @@ -34,7 +34,7 @@ public: const StaState *sta); explicit PathVertexRep(const PathVertex &path, const StaState *sta); - explicit PathVertexRep(VertexIndex vertex_index, + explicit PathVertexRep(VertexId vertex_id, TagIndex tag_index, bool is_enum); void init(); @@ -44,9 +44,9 @@ public: const StaState *sta); void init(const PathVertex &path, const StaState *sta); - bool isNull() const { return vertex_index_ == 0; } + bool isNull() const { return vertex_id_ == 0; } Vertex *vertex(const StaState *) const; - VertexIndex vertexIndex() const { return vertex_index_; } + VertexId vertexId() const { return vertex_id_; } Tag *tag(const StaState *sta) const; TagIndex tagIndex() const { return tag_index_; } Arrival arrival(const StaState *sta) const; @@ -65,7 +65,7 @@ public: const PathVertexRep &path2); protected: - VertexIndex vertex_index_; + VertexId vertex_id_; unsigned int tag_index_:tag_index_bits; bool is_enum_:1; diff --git a/search/Sta.cc b/search/Sta.cc index 12f7d458..a75e8d0f 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -3184,11 +3184,11 @@ Vertex * Sta::maxArrivalCountVertex() const { Vertex *max_vertex = nullptr; - VertexIndex max_count = 0; + int max_count = 0; VertexIterator vertex_iter(graph_); while (vertex_iter.hasNext()) { Vertex *vertex = vertex_iter.next(); - VertexIndex count = vertexArrivalCount(vertex); + int count = vertexArrivalCount(vertex); if (count > max_count) { max_count = count; max_vertex = vertex; @@ -3919,7 +3919,7 @@ Sta::connectPinAfter(Pin *pin) } else { Vertex *vertex, *bidir_drvr_vertex; - if (network_->vertexIndex(pin) == vertex_id_null) { + if (network_->vertexId(pin) == vertex_id_null) { graph_->makePinVertices(pin, vertex, bidir_drvr_vertex); graph_->makePinInstanceEdges(pin); } diff --git a/search/Tag.cc b/search/Tag.cc index 06a33b3d..9ce71ecf 100644 --- a/search/Tag.cc +++ b/search/Tag.cc @@ -279,7 +279,7 @@ Tag::matchHash(bool match_crpr_clk_pin) const { if (match_crpr_clk_pin) // match_hash_ with crpr clk pin thrown in. - return hashSum(match_hash_, clk_info_->crprClkVertexIndex()); + return hashSum(match_hash_, clk_info_->crprClkVertexId()); else return match_hash_; } @@ -416,7 +416,7 @@ tagMatch(const Tag *tag1, && clk_info1->isGenClkSrcPath() == clk_info2->isGenClkSrcPath() && (!match_crpr_clk_pin || !sta->sdc()->crprActive() - || clk_info1->crprClkVertexIndex() == clk_info2->crprClkVertexIndex()) + || clk_info1->crprClkVertexId() == clk_info2->crprClkVertexId()) && tagStateEqual(tag1, tag2)); } @@ -477,8 +477,8 @@ tagMatchCmp(const Tag *tag1, if (match_crpr_clk_pin && sta->sdc()->crprActive()) { - VertexIndex crpr_vertex1 = clk_info1->crprClkVertexIndex(); - VertexIndex crpr_vertex2 = clk_info2->crprClkVertexIndex(); + VertexId crpr_vertex1 = clk_info1->crprClkVertexId(); + VertexId crpr_vertex2 = clk_info2->crprClkVertexId(); if (crpr_vertex1 < crpr_vertex2) return -1; if (crpr_vertex1 > crpr_vertex2) diff --git a/util/ObjectIndex.hh b/util/ObjectIndex.hh deleted file mode 100644 index 9187217c..00000000 --- a/util/ObjectIndex.hh +++ /dev/null @@ -1,25 +0,0 @@ -// OpenSTA, Static Timing Analyzer -// Copyright (c) 2019, Parallax Software, Inc. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef STA_OBJECT_INDEX_H -#define STA_OBJECT_INDEX_H - -namespace sta { - -typedef unsigned ObjectIndex; - -} // Namespace -#endif