Skip to content

Commit

Permalink
dcalc tolerance
Browse files Browse the repository at this point in the history
commit 5bdb9a754899cef13d6976e27b619b885fd85e23
Author: James Cherry <[email protected]>
Date:   Wed Dec 18 08:56:03 2024 -0700

    dcalc tolerance

    Signed-off-by: James Cherry <[email protected]>

commit 1f2d9b9b62d322a257ec10f33f172a2050369ed9
Author: James Cherry <[email protected]>
Date:   Tue Dec 17 16:27:55 2024 -0700

    GraphDelayCalc::findVertexDelay refactor

    Signed-off-by: James Cherry <[email protected]>

commit 344df7b3e6ae746f8977c3397713972e347d8054
Author: James Cherry <[email protected]>
Date:   Tue Dec 17 11:37:08 2024 -0700

    GraphDelayCalc::loadSlewsChanged optimization

    Signed-off-by: James Cherry <[email protected]>

Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Dec 18, 2024
1 parent fded1f2 commit ec00954
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dcalc/DelayCalc.i
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 13 additions & 15 deletions dcalc/GraphDelayCalc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions search/PathVertex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec00954

Please sign in to comment.