Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions openroad/dpl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cc_library(
"src/Opendp.cpp",
"src/OptMirror.cpp",
"src/Optdp.cpp",
"src/PinAccessRepair.cpp",
"src/Place.cpp",
"src/PlacementDRC.cpp",
"src/PlacementDRC.h",
Expand Down Expand Up @@ -90,6 +91,7 @@ cc_library(
"//openroad/dpl:__subpackages__",
],
deps = [
"//openroad/drt:pin_access_service",
"//openroad/odb/src/db",
"//openroad/utl",
"@boost.container_hash",
Expand Down Expand Up @@ -140,6 +142,7 @@ cc_library(
deps = [
":dpl_impl",
"//:ord",
"//openroad/drt:pin_access_service",
"//openroad/odb/src/db",
"//openroad/utl",
"//openroad/web:core",
Expand Down
19 changes: 19 additions & 0 deletions openroad/dpl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ Run `global_connect` after buffer insertion or resizing and before
`detailed_placement -pdn_aware` when global connection rules define the
supply bindings.

### Repair Pin Access

The `repair_pin_access` command moves standard cells with unusable pin access to
nearby legal sites. Run successful `pin_access` in the current session first.
DRT checks each candidate against routing rules and fixed supply geometry.
The command preserves orientation, placement constraints, and usable access in
previously healthy cells. It returns the number of unresolved cells.

```tcl
repair_pin_access
[-max_displacement {sites rows}]
[-max_rounds count]
```

| Option | Description |
| ----- | ----- |
| `-max_displacement` | Nonnegative displacement from the input placement, in sites and rows. Default: `{20 2}`. |
| `-max_rounds` | Positive maximum number of improving move batches. Default: `3`. |

### Set Placement Padding

The `set_placement_padding` command sets left and right padding in multiples
Expand Down
13 changes: 12 additions & 1 deletion openroad/dpl/include/dpl/Opendp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include "odb/dbTypes.h"
#include "odb/geom.h"

namespace drt {
class PinAccessService;
}

namespace odb {
class dbBlockCallBackObj;
}
Expand Down Expand Up @@ -126,6 +130,10 @@ class Opendp
bool pdn_aware = false);
// C++ equivalent of `detailed_placement -quiet`.
void detailedPlacementQuiet();
int repairPinAccess(drt::PinAccessService* pa,
int max_displacement_x,
int max_displacement_y,
int max_rounds);
void reportLegalizationStats() const;
void reportLegalizationSummary(double runtime);

Expand Down Expand Up @@ -220,6 +228,8 @@ class Opendp
friend class Graphics;
friend class CellPlaceOrderLess;
friend class NegotiationLegalizer;
friend class PinAccessRepair;
friend class PinAccessRepairTest_ReleasesGridPixels_Test;
void findDisplacementStats();
DbuPt pointOffMacro(const Node& cell);
void convertDbToCell(odb::dbInst* db_inst, Node& cell);
Expand Down Expand Up @@ -264,7 +274,8 @@ class Opendp
GridX x,
GridY y,
GridX x_end,
GridY y_end) const;
GridY y_end,
const odb::dbOrientType* candidate_orient = nullptr) const;
bool checkMasterSym(unsigned masterSym, unsigned cellOri) const;
bool checkRowPowerCompatible(const Node* cell, GridY y) const;
bool ripUpAndReplace(Node* cell);
Expand Down
13 changes: 13 additions & 0 deletions openroad/dpl/src/Opendp.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include "graphics/Graphics.h"
#include "graphics/DplObserver.h"
#include "dpl/Opendp.h"
#include "drt/PinAccessService.h"
#include "utl/Logger.h"
#include "utl/ServiceRegistry.h"

%}

Expand All @@ -23,6 +25,17 @@

namespace dpl {

int
repair_pin_access_cmd(int max_displacement_x,
int max_displacement_y,
int max_rounds)
{
auto* openroad = ord::OpenRoad::openRoad();
auto* pa = openroad->getServiceRegistry()->find<drt::PinAccessService>();
return openroad->getOpendp()->repairPinAccess(
pa, max_displacement_x, max_displacement_y, max_rounds);
}

void
detailed_placement_cmd(int max_displacment_x,
int max_displacment_y,
Expand Down
32 changes: 32 additions & 0 deletions openroad/dpl/src/Opendp.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ proc detailed_placement { args } {
}
}

sta::define_cmd_args "repair_pin_access" {[-max_displacement {sites rows}] \
[-max_rounds count]}

proc repair_pin_access { args } {
sta::parse_key_args "repair_pin_access" args \
keys {-max_displacement -max_rounds} flags {}
sta::check_argc_eq0 "repair_pin_access" $args

set max_displacement_x 20
set max_displacement_y 2
if { [info exists keys(-max_displacement)] } {
if { [llength $keys(-max_displacement)] != 2 } {
utl::error DPL 350 "-max_displacement requires {sites rows}."
}
lassign $keys(-max_displacement) max_displacement_x max_displacement_y
}
foreach value [list $max_displacement_x $max_displacement_y] {
if { ![string is integer -strict $value] || $value < 0 } {
utl::error DPL 349 "-max_displacement requires nonnegative integers."
}
}
set max_rounds 3
if { [info exists keys(-max_rounds)] } {
set max_rounds $keys(-max_rounds)
}
if { ![string is integer -strict $max_rounds] || $max_rounds < 1 } {
utl::error DPL 351 "-max_rounds requires a positive integer."
}
return [dpl::repair_pin_access_cmd \
$max_displacement_x $max_displacement_y $max_rounds]
}

sta::define_cmd_args "set_placement_padding" { -global|-masters masters|-instances insts\
[-right site_count]\
[-left site_count] \
Expand Down
Loading
Loading