Full relevelization on every repeater insertion makes repair_design quadratic on loop-heavy netlists
Maintainer thường phản hồi trong vòng 1 ngày
@jhkim-pii đang làm issue này rồi.
Từ ngày 30/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Verilog
- Star
- 3.4k
- Fork
- 1.1k
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 245
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của The-OpenROAD-Project/OpenROAD
-
odb LEF58_MINIMUMCUT: per-cut-class form never sets isPerCutClass, so drt silently drops the ruleCó thể đã có người làm @LucasYuki đã nhận 26 ngày trước. Đang mởbug drt odb
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
The-OpenROAD-Project/OpenROAD#12176 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
drt: LEF58_SPACING ENDOFLINE MINLENGTH l TWOSIDES is checked one-sided (io passes the TWOEDGES flag as TWOSIDES)Có thể đã có người làm @osamahammad21 đã nhận 26 ngày trước. Đang mởbug drt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
The-OpenROAD-Project/OpenROAD#12173 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cleanup-opportunity: BUILD files never refer to mockturtle in third-partty/Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbazel enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
The-OpenROAD-Project/OpenROAD#12160 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
odb: Bazel build fails on linux/aarch64 — char fc compared to EOF in def/lef lexersCó thể đã có người làm @shivarammysore đã nhận 33 ngày trước. Đang mởbazel bug odb
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
The-OpenROAD-Project/OpenROAD#12095 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
syn: acd_resynth -apply segfaults on a database resynthesized in an earlier processCó thể làm lại được @povik đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mởbug syn
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
The-OpenROAD-Project/OpenROAD#12046 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày