Skip to content

Commit cce72ce

Browse files
committed
rsz: clamp all buffers to core and make clamp log debug-only
Make insertBufferPostProcess unconditionally clamp every buffer (including port buffers from bufferInputs/bufferOutputs) to the core area. Previously port buffers passed loc=nullptr and skipped the clamp; they can now land in the die-core gap on designs where die != core, causing the same DPL legalization failures as wire repeaters. Demote the per-buffer RSZ-0077 clamp message from info to debugPrint (category "buffer_clamp", level 1) so it only appears when explicitly enabled with -set_debug rsz buffer_clamp 1. This keeps logs clean while still allowing diagnosis when needed. Updated 18 golden files: removed RSZ-0077 info lines from 12 .ok files and updated 4 .defok files where port buffers now land inside the core. Signed-off-by: minjukim55 <mkim@precisioninno.com>
1 parent afb03b6 commit cce72ce

18 files changed

Lines changed: 55 additions & 93 deletions

src/rsz/include/rsz/Resizer.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ class Resizer : public sta::dbStaState, public sta::dbNetworkObserver
778778
sta::Instance* parent,
779779
const odb::Point& loc);
780780

781-
void insertBufferPostProcess(odb::dbInst* buffer_inst, const odb::Point* loc);
781+
void insertBufferPostProcess(odb::dbInst* buffer_inst);
782782

783783
void setLocation(odb::dbInst* db_inst, const odb::Point& pt);
784784
odb::Point clampLocToCore(const odb::Point& loc, odb::dbMaster* master) const;

src/rsz/src/Resizer.cc

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4907,7 +4907,7 @@ odb::dbInst* Resizer::insertBufferAfterDriver(
49074907
}
49084908

49094909
// Legalize the buffer position and update the design area
4910-
insertBufferPostProcess(buffer_inst, loc);
4910+
insertBufferPostProcess(buffer_inst);
49114911

49124912
return buffer_inst;
49134913
}
@@ -4997,7 +4997,7 @@ odb::dbInst* Resizer::insertBufferBeforeLoad(
49974997
}
49984998

49994999
// Legalize the buffer position and update the design area
5000-
insertBufferPostProcess(buffer_inst, loc);
5000+
insertBufferPostProcess(buffer_inst);
50015001

50025002
return buffer_inst;
50035003
}
@@ -5120,7 +5120,7 @@ odb::dbInst* Resizer::insertBufferBeforeLoads(
51205120
}
51215121

51225122
// Legalize the buffer position and update the design area
5123-
insertBufferPostProcess(buffer_inst, loc);
5123+
insertBufferPostProcess(buffer_inst);
51245124

51255125
return buffer_inst;
51265126
}
@@ -5155,20 +5155,12 @@ sta::Instance* Resizer::makeInstance(sta::LibertyCell* cell,
51555155
return inst;
51565156
}
51575157

5158-
void Resizer::insertBufferPostProcess(dbInst* buffer_inst,
5159-
const odb::Point* loc)
5158+
void Resizer::insertBufferPostProcess(dbInst* buffer_inst)
51605159
{
5161-
// Clamp to core if the caller provided a target location. ODB's
5162-
// insertBuffer* already placed the instance at *loc; setLocation will
5163-
// re-place it if clamping changed the point.
5164-
//
5165-
// Port buffers (bufferInputs / bufferOutputs) intentionally pass
5166-
// loc=nullptr so we do not clamp them: they are placed near their
5167-
// BTerm location, which can sit at the die edge outside the core.
5168-
// That is by design -- port buffers should stay adjacent to the port.
5169-
if (loc) {
5170-
setLocation(buffer_inst, *loc);
5171-
}
5160+
// ODB's insertBuffer* already placed the instance; re-run through
5161+
// setLocation so clampLocToCore can pull it back inside the core if
5162+
// the insertion point landed in the die-core gap.
5163+
setLocation(buffer_inst, buffer_inst->getLocation());
51725164

51735165
// Legalize the cell position for accurate parasitic estimation
51745166
if (estimate_parasitics_->getParasiticsSrc()
@@ -5196,14 +5188,16 @@ void Resizer::setLocation(dbInst* db_inst, const odb::Point& pt)
51965188
db_inst->setPlacementStatus(dbPlacementStatus::PLACED);
51975189
db_inst->setLocation(loc.x(), loc.y());
51985190
if (loc != pt) {
5199-
logger_->info(RSZ,
5200-
77,
5201-
"{} clamped to core ({}, {}) -> ({}, {})",
5202-
db_inst->getName(),
5203-
pt.x(),
5204-
pt.y(),
5205-
loc.x(),
5206-
loc.y());
5191+
debugPrint(logger_,
5192+
RSZ,
5193+
"buffer_clamp",
5194+
1,
5195+
"{} clamped to core ({}, {}) -> ({}, {})",
5196+
db_inst->getName(),
5197+
pt.x(),
5198+
pt.y(),
5199+
loc.x(),
5200+
loc.y());
52075201
}
52085202
}
52095203

src/rsz/test/buffer_ports10.defok

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ TRACKS Y 3340 DO 62 STEP 3200 LAYER metal9 ;
8181
TRACKS X 3390 DO 62 STEP 3200 LAYER metal10 ;
8282
TRACKS Y 3340 DO 62 STEP 3200 LAYER metal10 ;
8383
COMPONENTS 5 ;
84-
- input1 BUF_X1 + SOURCE TIMING + PLACED ( 101270 199930 ) N ;
85-
- input2 BUF_X1 + SOURCE TIMING + PLACED ( 99750 199930 ) N ;
86-
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 100510 199930 ) N ;
87-
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 98990 199930 ) N ;
84+
- input1 BUF_X1 + SOURCE TIMING + PLACED ( 101270 176400 ) N ;
85+
- input2 BUF_X1 + SOURCE TIMING + PLACED ( 99750 176400 ) N ;
86+
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 100510 176400 ) N ;
87+
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 98990 176400 ) N ;
8888
- r1 DFF_X1 + PLACED ( 96726 170871 ) N ;
8989
END COMPONENTS
9090
PINS 4 ;

src/rsz/test/buffer_ports8.defok

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ TRACKS Y 3340 DO 62 STEP 3200 LAYER metal9 ;
8181
TRACKS X 3390 DO 62 STEP 3200 LAYER metal10 ;
8282
TRACKS Y 3340 DO 62 STEP 3200 LAYER metal10 ;
8383
COMPONENTS 5 ;
84-
- input1 BUF_X1 + SOURCE TIMING + PLACED ( 101270 199930 ) N ;
85-
- input2 BUF_X1 + SOURCE TIMING + PLACED ( 99750 199930 ) N ;
86-
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 100510 199930 ) N ;
87-
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 98990 199930 ) N ;
84+
- input1 BUF_X1 + SOURCE TIMING + PLACED ( 101270 176400 ) N ;
85+
- input2 BUF_X1 + SOURCE TIMING + PLACED ( 99750 176400 ) N ;
86+
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 100510 176400 ) N ;
87+
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 98990 176400 ) N ;
8888
- r1 DFF_X1 + PLACED ( 96726 170871 ) N ;
8989
END COMPONENTS
9090
PINS 4 ;

src/rsz/test/buffer_ports9.defok

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ TRACKS Y 3340 DO 62 STEP 3200 LAYER metal9 ;
8181
TRACKS X 3390 DO 62 STEP 3200 LAYER metal10 ;
8282
TRACKS Y 3340 DO 62 STEP 3200 LAYER metal10 ;
8383
COMPONENTS 5 ;
84-
- input1 BUF_X16 + SOURCE TIMING + PLACED ( 101270 199930 ) N ;
85-
- input2 BUF_X16 + SOURCE TIMING + PLACED ( 99750 199930 ) N ;
86-
- output3 BUF_X16 + SOURCE TIMING + PLACED ( 100510 199930 ) N ;
87-
- output4 BUF_X16 + SOURCE TIMING + PLACED ( 98990 199930 ) N ;
84+
- input1 BUF_X16 + SOURCE TIMING + PLACED ( 101270 176400 ) N ;
85+
- input2 BUF_X16 + SOURCE TIMING + PLACED ( 99750 176400 ) N ;
86+
- output3 BUF_X16 + SOURCE TIMING + PLACED ( 100510 176400 ) N ;
87+
- output4 BUF_X16 + SOURCE TIMING + PLACED ( 98990 176400 ) N ;
8888
- r1 DFF_X1 + PLACED ( 96726 170871 ) N ;
8989
END COMPONENTS
9090
PINS 4 ;

src/rsz/test/gcd_resize.defok

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -745,24 +745,24 @@ COMPONENTS 673 ;
745745
- hold97 CLKBUF_X1 + SOURCE TIMING + PLACED ( 61811 108365 ) N ;
746746
- hold98 CLKBUF_X1 + SOURCE TIMING + PLACED ( 124175 137055 ) N ;
747747
- hold99 CLKBUF_X1 + SOURCE TIMING + PLACED ( 115635 138174 ) N ;
748-
- output1 BUF_X1 + SOURCE TIMING + PLACED ( 200190 111020 ) N ;
749-
- output10 BUF_X1 + SOURCE TIMING + PLACED ( 70 77700 ) N ;
750-
- output11 BUF_X1 + SOURCE TIMING + PLACED ( 200190 85260 ) N ;
751-
- output12 BUF_X1 + SOURCE TIMING + PLACED ( 200190 188580 ) N ;
752-
- output13 BUF_X1 + SOURCE TIMING + PLACED ( 130150 201530 ) N ;
753-
- output14 BUF_X1 + SOURCE TIMING + PLACED ( 200190 33460 ) N ;
754-
- output15 BUF_X1 + SOURCE TIMING + PLACED ( 200190 162820 ) N ;
755-
- output16 BUF_X1 + SOURCE TIMING + PLACED ( 147630 201530 ) N ;
756-
- output17 BUF_X1 + SOURCE TIMING + PLACED ( 70 13020 ) N ;
757-
- output18 BUF_X1 + SOURCE TIMING + PLACED ( 112670 201530 ) N ;
758-
- output2 BUF_X1 + SOURCE TIMING + PLACED ( 200070 201530 ) N ;
759-
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 200190 72380 ) N ;
760-
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 200190 149940 ) N ;
761-
- output5 BUF_X1 + SOURCE TIMING + PLACED ( 94810 201530 ) N ;
762-
- output6 BUF_X1 + SOURCE TIMING + PLACED ( 165110 201530 ) N ;
763-
- output7 BUF_X1 + SOURCE TIMING + PLACED ( 17670 70 ) N ;
764-
- output8 BUF_X1 + SOURCE TIMING + PLACED ( 70 129220 ) N ;
765-
- output9 BUF_X1 + SOURCE TIMING + PLACED ( 70 193900 ) N ;
748+
- output1 BUF_X1 + SOURCE TIMING + PLACED ( 179360 111020 ) N ;
749+
- output10 BUF_X1 + SOURCE TIMING + PLACED ( 20140 77700 ) N ;
750+
- output11 BUF_X1 + SOURCE TIMING + PLACED ( 179360 85260 ) N ;
751+
- output12 BUF_X1 + SOURCE TIMING + PLACED ( 179360 179200 ) N ;
752+
- output13 BUF_X1 + SOURCE TIMING + PLACED ( 130150 179200 ) N ;
753+
- output14 BUF_X1 + SOURCE TIMING + PLACED ( 179360 33460 ) N ;
754+
- output15 BUF_X1 + SOURCE TIMING + PLACED ( 179360 162820 ) N ;
755+
- output16 BUF_X1 + SOURCE TIMING + PLACED ( 147630 179200 ) N ;
756+
- output17 BUF_X1 + SOURCE TIMING + PLACED ( 20140 22400 ) N ;
757+
- output18 BUF_X1 + SOURCE TIMING + PLACED ( 112670 179200 ) N ;
758+
- output2 BUF_X1 + SOURCE TIMING + PLACED ( 179360 179200 ) N ;
759+
- output3 BUF_X1 + SOURCE TIMING + PLACED ( 179360 72380 ) N ;
760+
- output4 BUF_X1 + SOURCE TIMING + PLACED ( 179360 149940 ) N ;
761+
- output5 BUF_X1 + SOURCE TIMING + PLACED ( 94810 179200 ) N ;
762+
- output6 BUF_X1 + SOURCE TIMING + PLACED ( 165110 179200 ) N ;
763+
- output7 BUF_X1 + SOURCE TIMING + PLACED ( 20140 22400 ) N ;
764+
- output8 BUF_X1 + SOURCE TIMING + PLACED ( 20140 129220 ) N ;
765+
- output9 BUF_X1 + SOURCE TIMING + PLACED ( 20140 179200 ) N ;
766766
END COMPONENTS
767767
PINS 54 ;
768768
- clk + NET clk + DIRECTION INPUT + USE SIGNAL

src/rsz/test/gcd_resize.ok

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ Pin Limit Cap Slack
4242
_449_/ZN 10.47 3.45 7.02 (MET)
4343

4444
Driver length delay
45-
_759_/Z manhtn 105.4 steiner 105.4 0.00
46-
_850_/Z manhtn 95.8 steiner 95.8 0.00
45+
_759_/Z manhtn 83.9 steiner 83.9 0.00
46+
_850_/Z manhtn 80.7 steiner 80.7 0.00
4747
_786_/Z manhtn 80.4 steiner 80.4 0.00
4848
_813_/Z manhtn 78.4 steiner 78.4 0.00
49-
_847_/Z manhtn 77.7 steiner 77.7 0.00
5049
_839_/Z manhtn 76.3 steiner 76.3 0.00
5150
_551_/Z manhtn 73.6 steiner 73.7 0.00
52-
_851_/Z manhtn 69.5 steiner 69.5 0.00
5351
reset manhtn 67.3 steiner 67.3 0.00
54-
_725_/Z manhtn 67.2 steiner 67.2 0.00
55-
_849_/Z manhtn 64.8 steiner 64.8 0.00
52+
_461_/Z manhtn 63.8 steiner 84.8 0.00
53+
req_msg[18] manhtn 61.4 steiner 61.4 0.00
54+
_847_/Z manhtn 60.3 steiner 60.3 0.00
55+
_851_/Z manhtn 58.3 steiner 58.3 0.00
5656
Design area 751 um^2 12% utilization.
5757
No differences found.

src/rsz/test/repair_design_outside_core.ok

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
Iteration | Area | Resized | Buffers | Nets repaired | Remaining
1212
---------------------------------------------------------------------
1313
0 | +0.0% | 0 | 0 | 0 | 24
14-
[INFO RSZ-0077] fanout1 clamped to core (51780, 1230) -> (51780, 22400)
15-
[INFO RSZ-0077] fanout2 clamped to core (1780, 101230) -> (20140, 101230)
16-
[INFO RSZ-0077] wire3 clamped to core (1780, 191480) -> (20140, 176400)
1714
final | +7.5% | 0 | 4 | 1 | 0
1815
---------------------------------------------------------------------
1916
[INFO RSZ-0035] Found 1 fanout violations.

src/rsz/test/repair_hold11.ok

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ worst slack max 1.27
99
Iteration | Resized | Buffers | Cloned Gates | Area | WNS | TNS | Endpoint
1010
--------------------------------------------------------------------------------------
1111
0 | 0 | 0 | 0 | +0.0% | -0.260 | -0.421 | r2/D
12-
[INFO RSZ-0077] hold1 clamped to core (60980, 42785) -> (80180, 81200)
13-
[INFO RSZ-0077] hold4 clamped to core (70980, 41215) -> (80180, 81200)
14-
[INFO RSZ-0077] hold5 clamped to core (60225, 41212) -> (80180, 81200)
15-
[INFO RSZ-0077] hold7 clamped to core (70225, 41212) -> (80180, 81200)
16-
[INFO RSZ-0077] hold8 clamped to core (60225, 41212) -> (80180, 81200)
1712
final | 0 | 9 | 0 | +32.9% | 0.002 | 0.000 | r3/D
1813
--------------------------------------------------------------------------------------
1914
[INFO RSZ-0032] Inserted 9 hold buffers.

src/rsz/test/repair_hold12.ok

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Iteration | Resized | Buffers | Cloned Gates | Area | WNS | TNS | Endpoint
99
--------------------------------------------------------------------------------------
1010
0 | 0 | 0 | 0 | +0.0% | -0.045 | -0.082 | out
11-
[INFO RSZ-0077] hold1 clamped to core (46455, 41295) -> (80180, 81200)
1211
final | 0 | 4 | 0 | +14.6% | 0.012 | 0.000 | r3/D
1312
--------------------------------------------------------------------------------------
1413
[INFO RSZ-0032] Inserted 4 hold buffers.

0 commit comments

Comments
 (0)