Repository navigation
rsz: clamp buffer locations to core area during insertion #10141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1001,7 +1001,6 @@ void Resizer::bufferInputs(sta::LibertyCell* buffer_cell, bool verbose) | |
|
|
||
| sta_->ensureClkNetwork(sta_->cmdMode()); | ||
| inserted_buffer_count_ = 0; | ||
| buffer_moved_into_core_ = false; | ||
|
|
||
| { | ||
| est::IncrementalParasiticsGuard guard(estimate_parasitics_); | ||
|
|
@@ -1139,7 +1138,6 @@ void Resizer::bufferOutputs(sta::LibertyCell* buffer_cell, bool verbose) | |
| } | ||
|
|
||
| inserted_buffer_count_ = 0; | ||
| buffer_moved_into_core_ = false; | ||
|
|
||
| { | ||
| est::IncrementalParasiticsGuard guard(estimate_parasitics_); | ||
|
|
@@ -5123,6 +5121,11 @@ sta::Instance* Resizer::makeInstance(sta::LibertyCell* cell, | |
|
|
||
| void Resizer::insertBufferPostProcess(dbInst* buffer_inst) | ||
| { | ||
| // ODB's insertBuffer* already placed the instance; re-run through | ||
| // setLocation so clampLocToCore can pull it back inside the core if | ||
| // the insertion point landed in the die-core gap. | ||
| setLocation(buffer_inst, buffer_inst->getLocation()); | ||
|
|
||
| // Legalize the cell position for accurate parasitic estimation | ||
| if (estimate_parasitics_->getParasiticsSrc() | ||
| == est::ParasiticsSrc::kGlobalRouting | ||
|
|
@@ -5145,33 +5148,35 @@ void Resizer::insertBufferPostProcess(dbInst* buffer_inst) | |
|
|
||
| void Resizer::setLocation(dbInst* db_inst, const odb::Point& pt) | ||
| { | ||
| int x = pt.x(); | ||
| int y = pt.y(); | ||
| // Stay inside the lines. | ||
| if (core_exists_) { | ||
| dbMaster* master = db_inst->getMaster(); | ||
| int width = master->getWidth(); | ||
| if (x < core_.xMin()) { | ||
| x = core_.xMin(); | ||
| buffer_moved_into_core_ = true; | ||
| } else if (x > core_.xMax() - width) { | ||
| // Make sure the instance is entirely inside core. | ||
| x = core_.xMax() - width; | ||
| buffer_moved_into_core_ = true; | ||
| } | ||
|
|
||
| int height = master->getHeight(); | ||
| if (y < core_.yMin()) { | ||
| y = core_.yMin(); | ||
| buffer_moved_into_core_ = true; | ||
| } else if (y > core_.yMax() - height) { | ||
| y = core_.yMax() - height; | ||
| buffer_moved_into_core_ = true; | ||
| } | ||
| const odb::Point loc = clampLocToCore(pt, db_inst->getMaster()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main change |
||
| db_inst->setPlacementStatus(dbPlacementStatus::PLACED); | ||
| db_inst->setLocation(loc.x(), loc.y()); | ||
| if (loc != pt) { | ||
| debugPrint(logger_, | ||
| RSZ, | ||
| "buffer_clamp", | ||
| 1, | ||
| "{} clamped to core ({}, {}) -> ({}, {})", | ||
| db_inst->getName(), | ||
| pt.x(), | ||
| pt.y(), | ||
| loc.x(), | ||
| loc.y()); | ||
| } | ||
| } | ||
|
|
||
| db_inst->setPlacementStatus(dbPlacementStatus::PLACED); | ||
| db_inst->setLocation(x, y); | ||
| odb::Point Resizer::clampLocToCore(const odb::Point& loc, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main fix |
||
| odb::dbMaster* master) const | ||
| { | ||
| if (!core_exists_) { | ||
| return loc; | ||
| } | ||
| const int x_max = std::max( | ||
| core_.xMin(), core_.xMax() - static_cast<int>(master->getWidth())); | ||
| const int y_max = std::max( | ||
| core_.yMin(), core_.yMax() - static_cast<int>(master->getHeight())); | ||
| return {std::clamp(loc.x(), core_.xMin(), x_max), | ||
| std::clamp(loc.y(), core_.yMin(), y_max)}; | ||
| } | ||
|
|
||
| float Resizer::portCapacitance(sta::LibertyPort* input, | ||
|
|
@@ -5281,13 +5286,6 @@ void Resizer::checkLoadSlews(const sta::Pin* drvr_pin, | |
| delete pin_iter; | ||
| } | ||
|
|
||
| void Resizer::warnBufferMovedIntoCore() | ||
| { | ||
| if (buffer_moved_into_core_) { | ||
| logger_->warn(RSZ, 77, "some buffers were moved inside the core."); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed unnecessary comment (It’s only implemented in code, but it’s not actually written to the log) |
||
| } | ||
| } | ||
|
|
||
| void Resizer::setDebugPin(const sta::Pin* pin) | ||
| { | ||
| debug_pin_ = pin; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| VERSION 5.8 ; | ||
| DIVIDERCHAR "/" ; | ||
| BUSBITCHARS "[]" ; | ||
| DESIGN outside_core ; | ||
| UNITS DISTANCE MICRONS 2000 ; | ||
| DIEAREA ( 0 0 ) ( 400000 400000 ) ; | ||
| ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 420 BY 1 STEP 380 0 ; | ||
| ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 420 BY 1 STEP 380 0 ; | ||
| COMPONENTS 7 ; | ||
| - drvr DFF_X1 + PLACED ( 50000 50000 ) N ; | ||
| - load0 DFF_X1 + PLACED ( 0 0 ) N ; | ||
| - load1 DFF_X1 + PLACED ( 195000 0 ) N ; | ||
| - load2 DFF_X1 + PLACED ( 0 195000 ) N ; | ||
| - load3 DFF_X1 + PLACED ( 195000 195000 ) N ; | ||
| - load4 DFF_X1 + PLACED ( 100000 0 ) N ; | ||
| - load5 DFF_X1 + PLACED ( 0 100000 ) N ; | ||
| END COMPONENTS | ||
| PINS 8 ; | ||
| - clk + NET clk + DIRECTION INPUT + USE SIGNAL ; | ||
| - in1 + NET in1 + DIRECTION INPUT + USE SIGNAL ; | ||
| - out0 + NET out0 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| - out1 + NET out1 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| - out2 + NET out2 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| - out3 + NET out3 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| - out4 + NET out4 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| - out5 + NET out5 + DIRECTION OUTPUT + USE SIGNAL ; | ||
| END PINS | ||
| NETS 9 ; | ||
| - clk ( PIN clk ) ( load5 CK ) ( load4 CK ) ( load3 CK ) ( load2 CK ) ( load1 CK ) ( load0 CK ) | ||
| ( drvr CK ) + USE SIGNAL ; | ||
| - in1 ( PIN in1 ) ( drvr D ) + USE SIGNAL ; | ||
| - net0 ( load5 D ) ( load4 D ) ( load3 D ) ( load2 D ) ( load1 D ) ( load0 D ) ( drvr Q ) + USE SIGNAL ; | ||
| - out0 ( PIN out0 ) ( load0 Q ) + USE SIGNAL ; | ||
| - out1 ( PIN out1 ) ( load1 Q ) + USE SIGNAL ; | ||
| - out2 ( PIN out2 ) ( load2 Q ) + USE SIGNAL ; | ||
| - out3 ( PIN out3 ) ( load3 Q ) + USE SIGNAL ; | ||
| - out4 ( PIN out4 ) ( load4 Q ) + USE SIGNAL ; | ||
| - out5 ( PIN out5 ) ( load5 Q ) + USE SIGNAL ; | ||
| END NETS | ||
| END DESIGN |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells | ||
| [INFO ODB-0128] Design: outside_core | ||
| [INFO ODB-0252] Updated 8 pins. | ||
| [INFO ODB-0253] Updated 7 components. | ||
| [INFO ODB-0254] Updated 9 nets and 21 connections. | ||
| [WARNING RSZ-0065] max wire length less than 693u increases wire delays. | ||
| Iteration | Area | Resized | Buffers | Nets repaired | Remaining | ||
| --------------------------------------------------------------------- | ||
| 0 | +0.0% | 0 | 0 | 0 | 16 | ||
| [DEBUG RSZ-buffer_clamp] fanout1 clamped to core (101780, 1230) -> (101780, 22400) | ||
| [DEBUG RSZ-buffer_clamp] wire2 clamped to core (101780, 1230) -> (101780, 22400) | ||
| [DEBUG RSZ-buffer_clamp] wire3 clamped to core (192030, 1230) -> (178220, 22400) | ||
| final | +9.2% | 0 | 3 | 1 | 0 | ||
| --------------------------------------------------------------------- | ||
| [INFO RSZ-0035] Found 1 fanout violations. | ||
| [INFO RSZ-0038] Inserted 3 buffers in 1 nets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about replacing the
setLocation()call in the following API?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeInstance -> setLocation() path don't call placeBufferLocation() so rsz module's clamp() is still needed.
sta::Instance* Resizer::makeInstance(sta::LibertyCell* cell,
const char* name,
sta::Instance* parent,
const odb::Point& loc,
const odb::dbNameUniquifyType& uniquify)
{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I see.
Resizer::setLocation()can see the core area (Resizer::core_attribute), andResizer::setLocation()cannot be called inodb::dbInsertBuffer::placeBufferAtLocation().