Skip to content

Commit 27e6ac2

Browse files
authored
Merge pull request #10272 from The-OpenROAD-Project-staging/secure-issue10097-repair-timing-journal-stack
rsz: fix repair_timing -setup journal stack double-end crash
2 parents 9e8f835 + 9ae898d commit 27e6ac2

5 files changed

Lines changed: 52 additions & 11 deletions

File tree

src/rsz/src/RepairSetup.cc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,12 +1256,7 @@ void RepairSetup::repairSetup_Legacy(const float setup_slack_margin,
12561256
prev_worst_slack = worst_slack;
12571257
decreasing_slack_passes = 0;
12581258
resizer_->journalEnd();
1259-
if (pass < max_passes) {
1260-
// Progress, Save checkpoint so we can back up to here
1261-
resizer_->journalBegin();
1262-
} else {
1263-
journal_open = false;
1264-
}
1259+
resizer_->journalBegin();
12651260
} else {
12661261
fallback_ = true;
12671262
// Allow slack to increase to get out of local minima.
@@ -3017,13 +3012,12 @@ void RepairSetup::repairSetup_LastGasp(const OptoParams& params,
30173012
prev_tns = curr_tns;
30183013
if (sta::fuzzyGreaterEqual(end_slack, params.setup_slack_margin)) {
30193014
--num_viols;
3020-
}
3021-
resizer_->journalEnd();
3022-
if (pass < max_last_gasp_passes_) {
3023-
resizer_->journalBegin();
3024-
} else {
3015+
resizer_->journalEnd();
30253016
journal_open = false;
3017+
break;
30263018
}
3019+
resizer_->journalEnd();
3020+
resizer_->journalBegin();
30273021
} else {
30283022
debugPrint(logger_,
30293023
RSZ,

src/rsz/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ TESTS = [
102102
"repair_hold9",
103103
"repair_hold9_verbose",
104104
"repair_hold_multi_output_load",
105+
"repair_setup_max_iter",
105106
"repair_setup1",
106107
"repair_setup1_multi",
107108
"repair_setup2",

src/rsz/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ or_integration_tests(
8686
repair_hold14
8787
repair_hold15
8888
repair_hold_multi_output_load
89+
repair_setup_max_iter
8990
repair_setup_sizedown
9091
repair_setup_sizeup_match
9192
repair_setup1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: reg1
3+
[INFO ODB-0130] Created 1 pins.
4+
[INFO ODB-0131] Created 17 components and 92 component-terminals.
5+
[INFO ODB-0132] Created 2 special nets and 34 connections.
6+
[INFO ODB-0133] Created 7 nets and 30 connections.
7+
[INFO RSZ-0100] Repair move sequence: UnbufferMove SizeUpMove SwapPinsMove BufferMove CloneMove SplitLoadMove
8+
[INFO RSZ-0094] Found 4 endpoints with setup violations.
9+
[INFO RSZ-0099] Repairing 4 out of 4 (100.00%) violating endpoints...
10+
Iter | Removed | Resized | Inserted | Cloned | Pin | Area | WNS | StTNS | EnTNS | Viol | Worst
11+
| Buffers | Gates | Buffers | Gates | Swaps | | | | | Endpts | St/EnPt
12+
------------------------------------------------------------------------------------------------------------------------------
13+
0* | 0 | 0 | 0 | 0 | 0 | +0.0% | -0.333 | -0.3 | -0.4 | 4 | r2/D
14+
1* | 0 | 1 | 0 | 0 | 0 | +0.9% | -0.268 | -0.3 | -0.3 | 4 | r2/D
15+
4* | 0 | 1 | 0 | 0 | 0 | +0.9% | -0.268 | -0.3 | -0.3 | 4 | r2/D
16+
final | 0 | 1 | 0 | 0 | 0 | +0.9% | -0.268 | -0.3 | -0.3 | 1 | r2/D
17+
------------------------------------------------------------------------------------------------------------------------------
18+
[INFO RSZ-0051] Resized 1 instances: 1 up, 0 up match, 0 down, 0 VT
19+
[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
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Regression for journal stack invariant at pass==max and LastGasp
2+
# num_viols double-decrement after accept-crosses-margin.
3+
source "helpers.tcl"
4+
read_liberty Nangate45/Nangate45_typ.lib
5+
read_lef Nangate45/Nangate45.lef
6+
read_def repair_setup1.def
7+
create_clock -period 0.3 clk
8+
9+
source Nangate45/Nangate45.rc
10+
set_wire_rc -layer metal3
11+
estimate_parasitics -placement
12+
13+
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)