From dccf03e157ae6d13c5f4c98a1638a56c24022023 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Mon, 17 May 2021 17:27:48 -0700 Subject: [PATCH] increase and check max level --- include/sta/Graph.hh | 5 ++++- search/Levelize.cc | 18 +++++++++++++++++- search/Levelize.hh | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/include/sta/Graph.hh b/include/sta/Graph.hh index f31da812..b6bc9876 100644 --- a/include/sta/Graph.hh +++ b/include/sta/Graph.hh @@ -192,6 +192,9 @@ public: void removeDelaySlewAnnotations(); VertexSet *regClkVertices() { return ®_clk_vertices_; } + static const int vertex_level_bits = 24; + static const int vertex_level_max = (1<= Graph::vertex_level_max) + criticalError(616, "maximum logic level exceeded"); if (search_pred_->searchFrom(vertex)) { VertexOutEdgeIterator edge_iter(vertex, graph_); @@ -226,7 +228,7 @@ Levelize::visit(Vertex *vertex, LevelColor to_color = to_vertex->color(); if (to_color == LevelColor::gray) // Back edges form feedback loops. - recordLoop(edge, path); + recordLoop(edge, path); else if (to_color == LevelColor::white || to_vertex->level() < level) { path.push_back(edge); @@ -250,6 +252,20 @@ Levelize::visit(Vertex *vertex, vertex->setColor(LevelColor::black); } +void +Levelize::reportPath(EdgeSeq &path) const +{ + bool first_edge = true; + EdgeSeq::Iterator edge_iter(path); + while (edge_iter.hasNext()) { + Edge *edge = edge_iter.next(); + if (first_edge) + report_->reportLine(" %s", edge->from(graph_)->name(network_)); + report_->reportLine(" %s", edge->to(graph_)->name(network_)); + first_edge = false; + } +} + void Levelize::recordLoop(Edge *edge, EdgeSeq &path) diff --git a/search/Levelize.hh b/search/Levelize.hh index 305ae7cf..6b366ec2 100644 --- a/search/Levelize.hh +++ b/search/Levelize.hh @@ -71,6 +71,7 @@ protected: void ensureLatchLevels(); void setLevel(Vertex *vertex, Level level); + void reportPath(EdgeSeq &path) const; SearchPred *search_pred_; bool levelized_;