Skip to content

Commit 9ae898d

Browse files
minjukim55mkim
authored andcommitted
rsz: avoid double-decrementing num_viols in LastGasp
Previously, when an endpoint met the slack margin inside the `better` branch of the LastGasp pass loop, `--num_viols` ran but the loop did not break. The next pass's start-of-loop margin check then decremented `num_viols` a second time for the same endpoint. Break the inner loop right after the in-`better` decrement to avoid recounting. Mirrors the existing structure of the start-of-loop check. Signed-off-by: Minju Kim <mkim@precisioninno.com>
1 parent f1105af commit 9ae898d

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/rsz/src/RepairSetup.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,6 +3013,9 @@ void RepairSetup::repairSetup_LastGasp(const OptoParams& params,
30133013
prev_tns = curr_tns;
30143014
if (sta::fuzzyGreaterEqual(end_slack, params.setup_slack_margin)) {
30153015
--num_viols;
3016+
resizer_->journalEnd();
3017+
journal_open = false;
3018+
break;
30163019
}
30173020
resizer_->journalEnd();
30183021
resizer_->journalBegin();

src/rsz/test/repair_setup_max_iter.ok

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@
1717
------------------------------------------------------------------------------------------------------------------------------
1818
[INFO RSZ-0051] Resized 1 instances: 1 up, 0 up match, 0 down, 0 VT
1919
[WARNING RSZ-0062] Unable to repair all setup violations.
20+
[INFO RSZ-0100] Repair move sequence: UnbufferMove SizeUpMove SwapPinsMove BufferMove CloneMove SplitLoadMove
21+
[INFO RSZ-0094] Found 1 endpoints with setup violations.
22+
[INFO RSZ-0099] Repairing 1 out of 1 (100.00%) violating endpoints...
23+
[INFO RSZ-0221] Using custom phase sequence: LAST_GASP
24+
Iter | Removed | Resized | Inserted | Cloned | Pin | Area | WNS | StTNS | EnTNS | Viol | Worst
25+
| Buffers | Gates | Buffers | Gates | Swaps | | | | | Endpts | St/EnPt
26+
------------------------------------------------------------------------------------------------------------------------------
27+
0* | 0 | 0 | 0 | 0 | 0 | +0.0% | -0.268 | -0.3 | -0.3 | 1 | r2/D
28+
6* | 0 | 6 | 0 | 0 | 0 | +3.2% | -0.147 | -0.1 | -0.1 | 1 | r2/D
29+
final | 0 | 6 | 0 | 0 | 0 | +3.2% | -0.147 | 0.0 | -0.1 | 0 | r2/D
30+
------------------------------------------------------------------------------------------------------------------------------
31+
[INFO RSZ-0051] Resized 6 instances: 6 up, 0 up match, 0 down, 0 VT

src/rsz/test/repair_setup_max_iter.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Regression: repair_timing -setup must not crash when -max_passes and
2-
# -max_iterations are small enough to exit the inner loop on a pass where the
3-
# `better` branch would otherwise leave the journal double-closed.
1+
# Regression for journal stack invariant at pass==max and LastGasp
2+
# num_viols double-decrement after accept-crosses-margin.
43
source "helpers.tcl"
54
read_liberty Nangate45/Nangate45_typ.lib
65
read_lef Nangate45/Nangate45.lef
@@ -12,3 +11,4 @@ set_wire_rc -layer metal3
1211
estimate_parasitics -placement
1312

1413
repair_timing -setup -max_passes 1 -max_iterations 1
14+
repair_timing -setup -phases LAST_GASP -setup_margin -0.15 -verbose

0 commit comments

Comments
 (0)