Full relevelization on every repeater insertion makes repair_design quadratic on loop-heavy netlists
I maintainer di solito rispondono entro 1 giorno
@jhkim-pii ci sta già lavorando.
Dal 30/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- Verilog
- Stelle
- 3.4k
- Fork
- 1.1k
- Merge medio
- 3g 11h
- PR unite (30g)
- 245
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di The-OpenROAD-Project/OpenROAD
-
odb LEF58_MINIMUMCUT: per-cut-class form never sets isPerCutClass, so drt silently drops the ruleForse già presa @LucasYuki l’ha presa 26 giorni fa. Apertabug drt odb
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
The-OpenROAD-Project/OpenROAD#12176 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
drt: LEF58_SPACING ENDOFLINE MINLENGTH l TWOSIDES is checked one-sided (io passes the TWOEDGES flag as TWOSIDES)Forse già presa @osamahammad21 l’ha presa 26 giorni fa. Apertabug drt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
The-OpenROAD-Project/OpenROAD#12173 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
cleanup-opportunity: BUILD files never refer to mockturtle in third-partty/Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabazel enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
The-OpenROAD-Project/OpenROAD#12160 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
odb: Bazel build fails on linux/aarch64 — char fc compared to EOF in def/lef lexersForse già presa @shivarammysore l’ha presa 32 giorni fa. Apertabazel bug odb
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
The-OpenROAD-Project/OpenROAD#12095 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
syn: acd_resynth -apply segfaults on a database resynthesized in an earlier processForse di nuovo libera @povik l’ha presa 31 giorni fa e non c’è nessuna pull request aperta. Apertabug syn
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
The-OpenROAD-Project/OpenROAD#12046 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno