From ec009543d5cc7f360bc80bd4b571d6e041cde9d5 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 18 Dec 2024 09:00:21 -0700 Subject: [PATCH] dcalc tolerance commit 5bdb9a754899cef13d6976e27b619b885fd85e23 Author: James Cherry Date: Wed Dec 18 08:56:03 2024 -0700 dcalc tolerance Signed-off-by: James Cherry commit 1f2d9b9b62d322a257ec10f33f172a2050369ed9 Author: James Cherry Date: Tue Dec 17 16:27:55 2024 -0700 GraphDelayCalc::findVertexDelay refactor Signed-off-by: James Cherry commit 344df7b3e6ae746f8977c3397713972e347d8054 Author: James Cherry Date: Tue Dec 17 11:37:08 2024 -0700 GraphDelayCalc::loadSlewsChanged optimization Signed-off-by: James Cherry Signed-off-by: James Cherry --- dcalc/DelayCalc.i | 2 +- dcalc/GraphDelayCalc.cc | 28 +++++++++++++--------------- search/PathVertex.cc | 4 +--- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/dcalc/DelayCalc.i b/dcalc/DelayCalc.i index 04344296..6efc62d2 100644 --- a/dcalc/DelayCalc.i +++ b/dcalc/DelayCalc.i @@ -49,7 +49,7 @@ set_delay_calculator_cmd(const char *alg) void set_delay_calc_incremental_tolerance(float tol) { - sta::Sta::sta()->setIncrementalDelayTolerance(tol); + Sta::sta()->setIncrementalDelayTolerance(tol); } string diff --git a/dcalc/GraphDelayCalc.cc b/dcalc/GraphDelayCalc.cc index 9b34acbe..366af21d 100644 --- a/dcalc/GraphDelayCalc.cc +++ b/dcalc/GraphDelayCalc.cc @@ -580,16 +580,17 @@ GraphDelayCalc::findVertexDelay(Vertex *vertex, if (network_->isLeaf(pin)) { if (vertex->isDriver(network_)) { LoadPinIndexMap load_pin_index_map = makeLoadPinIndexMap(vertex); - DrvrLoadSlews prev_load_slews = loadSlews(load_pin_index_map); + DrvrLoadSlews load_slews_prev; + if (incremental_) + load_slews_prev = loadSlews(load_pin_index_map); findDriverDelays(vertex, arc_delay_calc, load_pin_index_map); if (propagate) { if (network_->direction(pin)->isInternal()) enqueueTimingChecksEdges(vertex); - bool load_slews_changed = loadSlewsChanged(prev_load_slews, - load_pin_index_map); // Enqueue adjacent vertices even if the load slews did not // change when non-incremental to stride past annotations. - if (load_slews_changed || !incremental_) + if (!incremental_ + || loadSlewsChanged(load_slews_prev, load_pin_index_map)) iter_->enqueueAdjacentVertices(vertex); } } @@ -621,19 +622,15 @@ GraphDelayCalc::loadSlews(LoadPinIndexMap &load_pin_index_map) } bool -GraphDelayCalc::loadSlewsChanged(DrvrLoadSlews &prev_load_slews, +GraphDelayCalc::loadSlewsChanged(DrvrLoadSlews &load_slews_prev, LoadPinIndexMap &load_pin_index_map) { for (auto const [pin, index] : load_pin_index_map) { Vertex *load_vertex = graph_->pinLoadVertex(pin); - const SlewSeq load_slews = graph_->slews(load_vertex); - const SlewSeq &prev_slews = prev_load_slews[index]; - for (size_t i = 0; i < load_slews.size(); i++) { - const Slew &slew = delayAsFloat(load_slews[i]); - const Slew &prev_slew = delayAsFloat(prev_slews[i]); - if ((prev_slew == 0.0 && slew != 0.0) - || (prev_slew != 0.0 - && abs((slew - prev_slew) / prev_slew) > incremental_delay_tolerance_)) + const SlewSeq slews = graph_->slews(load_vertex); + const SlewSeq &slews_prev = load_slews_prev[index]; + for (size_t i = 0; i < slews.size(); i++) { + if (!delayEqual(slews[i], slews_prev[i])) return true; } } @@ -1112,9 +1109,10 @@ GraphDelayCalc::annotateDelaySlew(Edge *edge, float prev_gate_delay1 = delayAsFloat(prev_gate_delay); if (prev_gate_delay1 == 0.0 || (abs(gate_delay1 - prev_gate_delay1) / prev_gate_delay1 - > incremental_delay_tolerance_)) + > incremental_delay_tolerance_)) { delay_changed = true; - graph_->setArcDelay(edge, arc, ap_index, gate_delay); + graph_->setArcDelay(edge, arc, ap_index, gate_delay); + } } return delay_changed; } diff --git a/search/PathVertex.cc b/search/PathVertex.cc index 0a1880e9..09b53880 100644 --- a/search/PathVertex.cc +++ b/search/PathVertex.cc @@ -395,9 +395,7 @@ PrevPathVisitor::visitFromToPath(const Pin *, PathAPIndex path_ap_index = path_ap->index(); if (to_rf->index() == path_rf_index_ && path_ap_index == path_ap_index_ - && (dcalc_tol_ > 0.0 - ? std::abs(delayAsFloat(to_arrival - path_arrival_)) < dcalc_tol_ - : delayEqual(to_arrival, path_arrival_)) + && delayEqual(to_arrival, path_arrival_) && (tagMatch(to_tag, path_tag_, this) // If the filter exception became active searching from // from_path to to_path the tag includes the filter, but