Skip to content

search/parasitics: AOCV depth-based derate hook + SI-window coupling-cap setter#383

Open
saurav-fermions wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:feat/aocv-si
Open

search/parasitics: AOCV depth-based derate hook + SI-window coupling-cap setter#383
saurav-fermions wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:feat/aocv-si

Conversation

@saurav-fermions

Copy link
Copy Markdown

Summary

Two flag-gated, default-no-op OpenSTA hooks that let an external driver (OpenROAD dbSta/rcx) refine timing without changing stock OpenSTA behavior. With no hook installed, timing is byte-identical to upstream.

1. AOCV depth-based derate (search/Search.{hh,cc})

Adds an abstract AocvDepthDerate hook and Search::deratedDelayData so the OCV derate applied to data-path combinational arcs during forward arrival propagation can be selected by the path's accumulated combinational depth instead of the flat SDC factor.

  • When no hook is installed (the default), deratedDelayData forwards verbatim to deratedDelay → byte-identical to upstream.
  • Only data-path combinational cell arcs are depth-derated; clock/reg/latch/check arcs keep the flat derate.
  • Depth is the count of combinational arcs on the live from_path prev chain + 1.
  • A lateActive()/earlyActive() per-side gate prevents a late-only table from silently zeroing a user's set_timing_derate -early on the min path.

2. SI-window per-coupling-capacitor value setter (parasitics/*)

Adds Parasitics::setCapacitorValue (default no-op) plus a ConcreteParasitics override / ConcreteParasiticDevice::setValue, so a timing-window-aware coupling derate can scale individual coupling caps. Only invoked from the external window path; stock OpenSTA behavior is unchanged.

Testing

  • Full OpenSTA ctest suite: 6083/6084 pass. The single failure (tcl.power.vcd_detailed) is a pre-existing last-digit floating-point rounding diff in the power module that fails identically on unmodified master (unrelated to this change).
  • Derate / CRPR / multicorner / OCV-derate regressions all pass; timing is byte-identical with no hook installed.

Notes

  • clang-format intentionally not run on src/sta/* per project convention.
  • Both hooks are additive and default-off; no behavior change for existing users.

Add a flag-gated hook (AocvDepthDerate interface + Search::deratedDelayData)
so the OCV derate applied to data-path combinational arcs during forward
arrival propagation can be selected by the path's accumulated combinational
depth instead of the flat SDC factor.

When no hook is installed (the default) deratedDelayData forwards verbatim to
deratedDelay, so timing is byte-identical to upstream. Only data-path
combinational cell arcs are depth-derated; clock/reg/latch/check arcs keep the
flat derate. Depth is the count of combinational arcs on the live from_path
prev chain + 1.

All edits marked // OpenROAD-fork: AOCV. clang-format not run on src/sta/*.


Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
Add Parasitics::setCapacitorValue (default no-op) and a ConcreteParasitics
override / ConcreteParasiticDevice::setValue so the OpenROAD timing-window
aware coupling derate can scale individual coupling caps. Only invoked from
the OpenROAD window path; stock OpenSTA behavior is unchanged.


Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for setting individual coupling capacitor values to enable timing-window aware coupling derating, and adds an abstract hook (AocvDepthDerate) to support AOCV-style depth-dependent OCV derating during forward arrival propagation. The review feedback suggests adding a defensive null check for the capacitor pointer in ConcreteParasitics::setCapacitorValue to prevent potential null pointer dereferences. Additionally, it points out that traversing the path prefix chain in Search::aocvDataDepth results in O(N^2) complexity, which could become a performance bottleneck for deep combinational paths, and suggests caching or documenting this behavior.

Comment on lines +1418 to +1425
void
ConcreteParasitics::setCapacitorValue(ParasiticCapacitor *capacitor,
float value)
{
ConcreteParasiticCapacitor *ccapacitor =
static_cast<ConcreteParasiticCapacitor*>(capacitor);
ccapacitor->setValue(value);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To prevent potential null pointer dereferences and crashes, it is highly recommended to add a defensive null check for the capacitor pointer before casting and dereferencing it.

void
ConcreteParasitics::setCapacitorValue(ParasiticCapacitor *capacitor,
                                      float value)
{
  if (capacitor == nullptr)
    return;
  ConcreteParasiticCapacitor *ccapacitor =
    static_cast<ConcreteParasiticCapacitor*>(capacitor);
  ccapacitor->setValue(value);
}

Comment thread search/Search.cc
Comment on lines +3041 to +3053
int
Search::aocvDataDepth(const Path *from_path) const
{
int depth = 1; // the arc about to be derated is the next stage
const Path *p = from_path;
while (p) {
const TimingArc *arc = p->prevArc(this);
if (arc && arc->role() == TimingRole::combinational())
depth++;
p = p->prevPath();
}
return depth;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Traversing the path prefix chain backwards at every combinational arc propagation step results in $O(N^2)$ complexity with respect to path depth $N$. While this is only executed when the AOCV hook is active, it could become a performance bottleneck for deep combinational paths. Consider if there is a way to cache or store the depth, or at least document this scaling behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants