From 7a541edb708abf8194ef43398489521dd08227bb Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 18 Jun 2026 09:15:32 -0700 Subject: [PATCH] levelize rm latch d->q handling Signed-off-by: James Cherry --- search/Levelize.cc | 37 ------------------------------------- search/Levelize.hh | 2 -- 2 files changed, 39 deletions(-) diff --git a/search/Levelize.cc b/search/Levelize.cc index 76788b40..bc1b5609 100644 --- a/search/Levelize.cc +++ b/search/Levelize.cc @@ -134,7 +134,6 @@ Levelize::findLevels() findBackEdges(); VertexSeq topo_sorted = findTopologicalOrder(); assignLevels(topo_sorted); - ensureLatchLevels(); // Set level of stranded vertices (constants) to zero. VertexIterator vertex_iter2(graph_); @@ -354,8 +353,6 @@ Levelize::findTopologicalOrder() Vertex *to_vertex = edge->to(graph_); if (searchThru(edge)) in_degree[to_vertex] += 1; - if (edge->role() == TimingRole::latchDtoQ()) - latch_d_to_q_edges_.insert(edge); } // Levelize bidirect driver as if it was a fanout of the bidirect load. const Pin *pin = vertex->pin(); @@ -507,27 +504,6 @@ Levelize::assignLevels(VertexSeq &topo_sorted) //////////////////////////////////////////////////////////////// -// Make sure latch D input level is not the same as the Q level. -// This is because the Q arrival depends on the D arrival and -// to find them in parallel they have to be scheduled separately -// to avoid a race condition. -void -Levelize::ensureLatchLevels() -{ - for (Edge *edge : latch_d_to_q_edges_) { - Vertex *from = edge->from(graph_); - Vertex *to = edge->to(graph_); - if (from->level() == to->level()) { - Level adjusted_level = from->level() + level_space_; - debugPrint(debug_, "levelize", 2, "latch {} {} (adjusted {}) -> {} {}", - from->to_string(this), from->level(), adjusted_level, - to->to_string(this), to->level()); - setLevel(from, adjusted_level); - } - } - latch_d_to_q_edges_.clear(); -} - void Levelize::setLevel(Vertex *vertex, Level level) @@ -604,7 +580,6 @@ Levelize::relevelize() EdgeSeq path; visit(vertex, nullptr, vertex->level(), 1, path_vertices, path); } - ensureLatchLevels(); levels_valid_ = true; relevelize_from_.clear(); } @@ -635,18 +610,6 @@ Levelize::visit(Vertex *vertex, visit(to_vertex, edge, level + level_space, level_space, path_vertices, path); } - - const TimingRole *role = edge->role(); - if (role->isLatchDtoQ()) - latch_d_to_q_edges_.insert(edge); - if (role->isLatchEnToQ()) { - VertexInEdgeIterator edge_iter2(to_vertex, graph_); - while (edge_iter2.hasNext()) { - Edge *edge2 = edge_iter2.next(); - if (edge2->role()->isLatchDtoQ()) - latch_d_to_q_edges_.insert(edge2); - } - } } // Levelize bidirect driver as if it was a fanout of the bidirect load. diff --git a/search/Levelize.hh b/search/Levelize.hh index 094e3d47..22b268b8 100644 --- a/search/Levelize.hh +++ b/search/Levelize.hh @@ -83,7 +83,6 @@ protected: EdgeSeq &path); EdgeSeq *loopEdges(EdgeSeq &path, Edge *closing_edge); - void ensureLatchLevels(); void findBackEdges(); EdgeSet findBackEdges(EdgeSeq &path, FindBackEdgesStack &stack); @@ -113,7 +112,6 @@ protected: GraphLoopSeq loops_; EdgeSet loop_edges_; EdgeSet disabled_loop_edges_; - EdgeSet latch_d_to_q_edges_; LevelizeObserver *observer_{nullptr}; };