dcalc: reserve per column slack in PrimaDelayCalc::stampEqns

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
This commit is contained in:
dsengupta0628 2026-08-12 15:23:10 +00:00
parent b6a817bab8
commit 4c3c017f7a
1 changed files with 11 additions and 0 deletions

View File

@ -590,6 +590,17 @@ PrimaDelayCalc::stampEqns()
C_.setZero(); C_.setZero();
B_.setZero(); B_.setZero();
// The stamps below insert into G_/C_ in parasitic traversal order, which is
// unrelated to the node indices assigned by findNodeCount(). coeffRef() on a
// packed sparse column has no free slot for an out of order insert, so it
// shifts the remaining values over, making stampEqns() quadratic in the node
// count. Reserving slack per column gives the inserts somewhere to land.
// Node degree in an RC network is small; stamp_slack covers the diagonal, the
// resistor and coupling capacitor off diagonals and the driver row.
constexpr int stamp_slack = 8;
G_.reserve(Eigen::VectorXi::Constant(order_, stamp_slack));
C_.reserve(Eigen::VectorXi::Constant(order_, stamp_slack));
NetSet drvr_nets(network_); NetSet drvr_nets(network_);
for (ArcDcalcArg &dcalc_arg : *dcalc_args_) { for (ArcDcalcArg &dcalc_arg : *dcalc_args_) {
const Net *net = dcalc_arg.drvrNet(network_); const Net *net = dcalc_arg.drvrNet(network_);