Full relevelization on every repeater insertion makes repair_design quadratic on loop-heavy netlists
メンテナーはふだん 1 日以内に返信
@jhkim-pii がすでに取り組んでいます。
2026年9月30日 から。
評価
この issue はまだ評価されていません。
説明
Describe the bug
Summary
On netlists with many combinational loops (flat, unprogrammed FPGA fabrics), OpenROAD's timing-driven global_placement spends most of its time in Levelize::findLevels. Each repeater inserted by repair_design appears to trigger a full relevelization, so the cost grows with (buffers inserted) × (graph size).
Evidence
All 4 of 4 gdb samples of the main thread, taken during the first timing-driven repair_design inside global_placement, are in this chain:
RepairDesign::makeRepeater
-> Resizer::resizeToTargetSlew
-> EstimateParasitics::ensureWireParasitic
-> EstimateParasitics::estimateWireParasiticSteiner
-> EstimateParasitics::isIdealClockPin
-> Sta::isClock -> Sta::ensureClkNetwork -> Sta::ensureLevelized
-> Levelize::findLevels -> findBackEdges -> recordLoop -> loopEdges
Scale, on Nangate45 with ORFS defaults:
| design | nets | global placement wall time |
|---|---|---|
| 6x6 fabric | 246k | 4 h 58 min of a 5 h 40 min flow |
| 8x8 fabric | 550k | first of two timing-driven passes unfinished after 9 h |
The same fabric placed tile-by-tile (a few thousand nets per tile) shows no such slowdown.
Trigger (measured)
A full findLevels runs only when levelized_ is false. During repair_design, the only thing that cleared it was Levelize::deleteEdgeBefore on an edge in loop_edges_:
// Relevelize if a loop edge is removed. Incremental levelization
// fails because the DFS path will be missing.
levelized_ = false;
Counts from sta::set_debug levelize 2 over one repair_design on the smallest (4x4, 65k nets) fabric, starting from the pre-global-placement ODB:
| event | count |
|---|---|
| buffers inserted / nets repaired | 458 / 296 |
delete loop edge |
62 |
full levelize (findLevels) |
62 |
levels invalid (Levelize::invalid) |
0 |
relevelize from (incremental) |
10,784 |
So about one in five repaired nets carries a loop-breaking edge, and each of those buffers costs a full relevelization, including recordLoop for every loop in the design. Both the number of such nets and the cost of each relevelization grow with design size.
Question
Could deleting a loop edge be handled incrementally, for example by treating the new driver/load vertices as relevelizeFrom roots and re-running loop detection only in the affected fanout cone? Alternatively, could isClock/isIdealClock avoid forcing a full relevelization when only levels, not the clock network, are stale? We can share an ODB + SDC reproducer.
Measured on OpenSTA 14751996 (2026-05-28) inside OpenROAD 9b75dd85eb (2026-06-03). By code reading, current master still behaves this way: OpenSTA 5adf472 (2026-09-29) deleteEdgeBefore still clears levelized_ and findLevels → clear() → clearLoopEdges() resets back_edges_valid_, so ensureBackEdges() re-runs findBackEdges; OpenROAD master EstimateParasitics still calls isClock/isIdealClock per wire estimate.
Expected Behavior
Repeater insertion in repair_design should cost roughly the same per buffer whether or not the repaired net carries a loop-breaking edge. Deleting a loop edge should relevelize only the affected fanout cone, like the incremental relevelizeFrom path already does for ordinary edge changes. It should not trigger a full findLevels (with findBackEdges/recordLoop over every loop in the design) once per buffer.
On the 4x4 case above, that means the 62 full levelizations in one repair_design should be incremental updates. global_placement runtime on loop-heavy flat netlists should then scale with the number of repaired nets rather than (repaired nets) × (graph size). For reference, the same fabric placed tile-by-tile takes minutes where the flat run takes hours.
Environment
see bug description
To Reproduce
- Load the pre-global-placement ODB + SDC of a flat FPGA fabric (many combinational loops); a reproducer can be shared.
sta::set_debug levelize 2- Run
repair_design. - Count
delete loop edgeand fulllevelizemessages: each loop-edge deletion is followed by a fullfindLevels.
Relevant log output
Screenshots
No response
Additional Context
No response
- 主要言語
- Verilog
- スター
- 3.4k
- フォーク
- 1.1k
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 245
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
The-OpenROAD-Project/OpenROAD のほかの issue
-
odb LEF58_MINIMUMCUT: per-cut-class form never sets isPerCutClass, so drt silently drops the rule対応中かも @LucasYuki が 26 日前に担当しました。 オープンbug drt odb
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
The-OpenROAD-Project/OpenROAD#12176 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
drt: LEF58_SPACING ENDOFLINE MINLENGTH l TWOSIDES is checked one-sided (io passes the TWOEDGES flag as TWOSIDES)対応中かも @osamahammad21 が 26 日前に担当しました。 オープンbug drt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
The-OpenROAD-Project/OpenROAD#12173 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
cleanup-opportunity: BUILD files never refer to mockturtle in third-partty/再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbazel enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
The-OpenROAD-Project/OpenROAD#12160 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
odb: Bazel build fails on linux/aarch64 — char fc compared to EOF in def/lef lexers対応中かも @shivarammysore が 33 日前に担当しました。 オープンbazel bug odb
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
The-OpenROAD-Project/OpenROAD#12095 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
syn: acd_resynth -apply segfaults on a database resynthesized in an earlier process再び着手できるかも @povik が 31 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug syn
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
The-OpenROAD-Project/OpenROAD#12046 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信