Skip to content

sta: prima reports -INF slew for an uncrossed threshold since OpenSTA e419f88d; ORFS asap7 swerv_wrapper CTS stops on RSZ-1008 #12037

Closed

Description

@oharboe

Since the OpenROAD submodule update in The-OpenROAD-Project/OpenROAD-flow-scripts#4755, ORFS CI fails asap7 swerv_wrapper at CTS, on master and on every open PR:

repair_timing -setup_margin 0 -hold_margin 0 -repair_tns 100 -verbose
       0* |       0 |       0 |        0 |      0 |     0 |    +0.0% |     -inf |       -INF |   3721 | u67455/D
[ERROR RSZ-1008] FixedDelay conversion out of range: -inf

Cause

OpenSTA e419f88d ("prima init threshold_times"), which came in with the OpenSTA update, initializes threshold_times_ to NaN. When the simulation does not cross a threshold, PrimaDelayCalc::dcalcResults now reports min_max_->initValue() for that delay or slew, which is -INF for max. Before that commit, an uncrossed threshold read whatever value the vector already held.

ORFS selects prima when LIB_MODEL=CCS, and swerv_wrapper sets it. After CTS, the falling QN slew of DFFASRHQNx1_ASAP7_75t_R instance u1785 is -INF. The CLK→QN fall arc's table delay is 40.5 ps and its table slew is 16.8 ps. Downstream of u1785, slews and arrivals become inf, so slack is -inf at 3721 endpoints, and rsz's FixedDelay conversion aborts.

Patch

When a threshold that dcalcResults reads was not crossed, fall back to the table models, as gateDelays already does when checkArgs fails. The patch is against src/sta:

0001-prima-table-models-when-the-simulation-crosses-no-threshold.patch
diff --git a/dcalc/PrimaDelayCalc.cc b/dcalc/PrimaDelayCalc.cc
index 52cea8ff..f40a5cba 100644
--- a/dcalc/PrimaDelayCalc.cc
+++ b/dcalc/PrimaDelayCalc.cc
@@ -214,7 +214,10 @@ PrimaDelayCalc::gateDelays(ArcDcalcArgSeq &dcalc_args,
     return tableDcalcResults();
   else {
     simulate();
-    return dcalcResults();
+    if (thresholdsMeasured())
+      return dcalcResults();
+    debugPrint(debug_, "prima", 1, "threshold not crossed, using table models.");
+    return tableDcalcResults();
   }
 }
 
@@ -1053,6 +1056,31 @@ measuredSlew(double time1,
   return slew;
 }
 
+// True when the simulation crossed every threshold dcalcResults reads.
+bool
+PrimaDelayCalc::thresholdsMeasured()
+{
+  auto measured = [this](const Pin *pin) {
+    const ThresholdTimes &times = threshold_times_[pin_node_map_[pin]];
+    return !isUnset(times[threshold_vl])
+      && !isUnset(times[threshold_vth])
+      && !isUnset(times[threshold_vh]);
+  };
+  const Net *drvr_net = drvr_arg_->drvrNet(network_);
+  for (size_t drvr_idx = 0; drvr_idx < drvr_count_; drvr_idx++) {
+    ArcDcalcArg &dcalc_arg = (*dcalc_args_)[drvr_idx];
+    if (dcalc_arg.drvrNet(network_) == drvr_net) {
+      if (!measured(dcalc_arg.drvrPin()))
+        return false;
+      for (const auto [load_pin, load_idx] : *load_pin_index_map_) {
+        if (!measured(load_pin))
+          return false;
+      }
+    }
+  }
+  return true;
+}
+
 ArcDcalcResultSeq
 PrimaDelayCalc::dcalcResults()
 {
diff --git a/dcalc/PrimaDelayCalc.hh b/dcalc/PrimaDelayCalc.hh
index 3af74a3f..df53b893 100644
--- a/dcalc/PrimaDelayCalc.hh
+++ b/dcalc/PrimaDelayCalc.hh
@@ -173,6 +173,7 @@ protected:
   double voltagePrev1(size_t node_idx);
   double voltagePrev2(size_t node_idx);
   bool loadWaveformsFinished();
+  bool thresholdsMeasured();
   ArcDcalcResultSeq dcalcResults();
 
   void recordWaveformStep(double time);

Measured

On asap7 swerv_wrapper, built through placement with OpenROAD 9ddb60d (OpenSTA 384b539085c5):

repair_timing WNS at iteration 0 CTS
unpatched -inf, 3721 violating endpoints RSZ-1008
patched -144.9 ps, 358 violating endpoints completes, setup WNS -104.6 ps

Reproduce

From ORFS master:

make DESIGN_CONFIG=./designs/asap7/swerv_wrapper/config.mk cts

Activity

  1. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    🤖 Hi @oharboe, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

  2. dsengupta0628 commented on Oct 28, 2026

    @dsengupta0628
    Contributor

    Looking at it with highest priority.
    Found that commit e419f88d didn't cause this, it only made it visible. The real bug is in the simulation time window that came with 4f8d3ae6 ("Delay calculation noise analysis support"). Both commits arrived in the same OpenSTA update (384b5390).

    Putting a fix in upstream and also our repo.

  3. oharboe commented on Oct 28, 2026

    @oharboe
    CollaboratorAuthor

    @dsengupta0628 Thank you! Correlation is not causation for sure... ORFS is much healthier than yesterday, I think this is the only problem now. 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingstaStatic Timing Analysis

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions