Skip to content

Commit 7984c88

Browse files
authored
Merge pull request #9020 from gadfort/pdn-arb-straps
pdn: add option to allow stripes outside core area and add nets to report
2 parents 746586d + 5b70d21 commit 7984c88

16 files changed

+2971
-29
lines changed

src/pdn/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ add_pdn_stripe
215215
[-spacing spacing_value]
216216
[-starts_with POWER|GROUND]
217217
[-width width_value]
218+
[-allow_out_of_core]
218219
```
219220

220221
#### Options
@@ -234,6 +235,7 @@ add_pdn_stripe
234235
| `[-spacing]` | Optional specification of the spacing between power/ground pairs within a single pitch (Default: pitch / 2). |
235236
| `[-starts_with]` | Specifies whether the first strap placed will be POWER or GROUND (Default: grid setting). This cannot be used with -followpins (Flip sites when initializing floorplan to change followpin power/ground order). |
236237
| `[-width]` | Value for the width of stripe. |
238+
| `-allow_out_of_core` | Allow stripes to continue beyond the core area. |
237239

238240
### Add Sroute Connect
239241

src/pdn/include/pdn/PdnGen.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ class PdnGen
143143
bool snap,
144144
StartsWith starts_with,
145145
ExtensionMode extend,
146-
const std::vector<odb::dbNet*>& nets);
146+
const std::vector<odb::dbNet*>& nets,
147+
bool allow_out_of_core);
147148
void makeConnect(
148149
Grid* grid,
149150
odb::dbTechLayer* layer0,

src/pdn/src/PdnGen.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ void PdnGen::makeStrap(Grid* grid,
609609
bool snap,
610610
StartsWith starts_with,
611611
ExtensionMode extend,
612-
const std::vector<odb::dbNet*>& nets)
612+
const std::vector<odb::dbNet*>& nets,
613+
bool allow_out_of_core)
613614
{
614615
auto strap = std::make_unique<Straps>(
615616
grid, layer, width, pitch, spacing, number_of_straps);
@@ -620,6 +621,7 @@ void PdnGen::makeStrap(Grid* grid,
620621
strap->setStartWithPower(starts_with == POWER);
621622
}
622623
strap->setNets(nets);
624+
strap->setAllowOutsideCoreArea(allow_out_of_core);
623625
grid->addStrap(std::move(strap));
624626
}
625627

src/pdn/src/PdnGen.i

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ void make_strap(const char* grid_name,
231231
bool use_grid_power_order,
232232
bool starts_with_power,
233233
pdn::ExtensionMode extend,
234-
const std::vector<odb::dbNet*>& nets)
234+
const std::vector<odb::dbNet*>& nets,
235+
bool allow_out_of_core)
235236
{
236237
PdnGen* pdngen = ord::getPdnGen();
237238
StartsWith starts_with = GRID;
@@ -253,7 +254,8 @@ void make_strap(const char* grid_name,
253254
snap,
254255
starts_with,
255256
extend,
256-
nets);
257+
nets,
258+
allow_out_of_core);
257259
}
258260
}
259261

src/pdn/src/pdn.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,14 @@ sta::define_cmd_args "add_pdn_stripe" {[-grid grid_name] \
267267
[-extend_to_boundary] \
268268
[-snap_to_grid] \
269269
[-number_of_straps count] \
270-
[-nets list_of_nets]
270+
[-nets list_of_nets]\
271+
[-allow_out_of_core]
271272
}
272273

273274
proc add_pdn_stripe { args } {
274275
sta::parse_key_args "add_pdn_stripe" args \
275276
keys {-grid -layer -width -pitch -spacing -offset -starts_with -number_of_straps -nets} \
276-
flags {-followpins -extend_to_core_ring -extend_to_boundary -snap_to_grid}
277+
flags {-followpins -extend_to_core_ring -extend_to_boundary -snap_to_grid -allow_out_of_core}
277278

278279
sta::check_argc_eq0 "add_pdn_stripe" $args
279280

@@ -377,7 +378,8 @@ proc add_pdn_stripe { args } {
377378
$use_grid_power_order \
378379
$start_with_power \
379380
$extend \
380-
$nets
381+
$nets \
382+
[info exists flags(-allow_out_of_core)]
381383
}
382384
}
383385

src/pdn/src/straps.cpp

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ void Straps::checkLayerSpecifications() const
9898
bool Straps::checkLayerOffsetSpecification(bool error) const
9999
{
100100
const int strap_width = getStrapGroupWidth();
101-
const odb::Rect grid_area = getGrid()->getDomainArea();
101+
odb::Rect grid_area = getGrid()->getDomainArea();
102+
if (allow_out_of_core_) {
103+
const odb::Rect die = getGrid()->getBlock()->getDieArea();
104+
grid_area.set_xhi(die.xMax());
105+
grid_area.set_yhi(die.yMax());
106+
}
102107
int grid_width = 0;
103108
if (isHorizontal()) {
104109
grid_width = grid_area.dy();
@@ -216,7 +221,7 @@ void Straps::makeShapes(const Shape::ShapeTreeMap& other_shapes)
216221
makeStraps(x_start,
217222
core.yMin(),
218223
x_end,
219-
core.yMax(),
224+
allow_out_of_core_ ? die.yMax() : core.yMax(),
220225
abs_min,
221226
abs_max,
222227
false,
@@ -231,7 +236,7 @@ void Straps::makeShapes(const Shape::ShapeTreeMap& other_shapes)
231236

232237
makeStraps(core.xMin(),
233238
y_start,
234-
core.xMax(),
239+
allow_out_of_core_ ? die.xMax() : core.xMax(),
235240
y_end,
236241
abs_min,
237242
abs_max,
@@ -366,6 +371,9 @@ void Straps::report() const
366371
if (number_of_straps_ > 0) {
367372
logger->report(" Number of strap sets: {}", number_of_straps_);
368373
}
374+
if (getNets() != getGrid()->getNets()) {
375+
logger->report(" Nets: {}", getNetString());
376+
}
369377
}
370378

371379
int Straps::getStrapGroupWidth() const
@@ -379,6 +387,20 @@ int Straps::getStrapGroupWidth() const
379387
return width;
380388
}
381389

390+
std::string Straps::getNetString() const
391+
{
392+
std::string nets;
393+
394+
for (auto* net : getNets()) {
395+
if (!nets.empty()) {
396+
nets += ", ";
397+
}
398+
nets += net->getName();
399+
}
400+
401+
return nets;
402+
}
403+
382404
////
383405

384406
FollowPins::FollowPins(Grid* grid, odb::dbTechLayer* layer, int width)
@@ -886,6 +908,7 @@ void PadDirectConnectionStraps::report() const
886908
if (type_ == ConnectionType::Edge) {
887909
logger->report(" Edge: {}", pad_edge_.getString());
888910
}
911+
logger->report(" Net: {}", iterm_->getNet()->getName());
889912
}
890913

891914
std::string PadDirectConnectionStraps::getName() const
@@ -1678,20 +1701,6 @@ RepairChannelStraps::RepairChannelStraps(
16781701
}
16791702
}
16801703

1681-
std::string RepairChannelStraps::getNetString() const
1682-
{
1683-
std::string nets;
1684-
1685-
for (auto* net : nets_) {
1686-
if (!nets.empty()) {
1687-
nets += ", ";
1688-
}
1689-
nets += net->getName();
1690-
}
1691-
1692-
return nets;
1693-
}
1694-
16951704
int RepairChannelStraps::getMaxLength() const
16961705
{
16971706
const odb::Rect core = getGrid()->getDomainArea();

src/pdn/src/straps.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class Straps : public GridComponent
5858
{
5959
return direction_ == odb::dbTechLayerDir::HORIZONTAL;
6060
}
61+
void setAllowOutsideCoreArea(bool allow_out_of_core)
62+
{
63+
allow_out_of_core_ = allow_out_of_core;
64+
}
6165

6266
void report() const override;
6367
Type type() const override { return GridComponent::Strap; }
@@ -70,6 +74,7 @@ class Straps : public GridComponent
7074

7175
protected:
7276
bool checkLayerOffsetSpecification(bool error = false) const;
77+
std::string getNetString() const;
7378

7479
private:
7580
odb::dbTechLayer* layer_;
@@ -83,6 +88,7 @@ class Straps : public GridComponent
8388
ExtensionMode extend_mode_ = ExtensionMode::CORE;
8489
int strap_start_ = 0;
8590
int strap_end_ = 0;
91+
bool allow_out_of_core_ = false;
8692

8793
void makeStraps(int x_start,
8894
int y_start,
@@ -276,8 +282,6 @@ class RepairChannelStraps : public Straps
276282
int bisect_dist = 0,
277283
int level = 0);
278284

279-
std::string getNetString() const;
280-
281285
static std::vector<RepairChannelArea> findRepairChannels(
282286
Grid* grid,
283287
const Shape::ShapeTree& shapes,

src/pdn/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ COMPULSORY_TESTS = [
4747
"core_grid_start_power",
4848
"core_grid_start_power_strap_ground",
4949
"core_grid_strap_count",
50+
"core_grid_strap_outside_core",
5051
"core_grid_via_snap",
5152
"core_grid_with_M6_min_area",
5253
"core_grid_with_M7_pins",

src/pdn/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ or_integration_tests(
4444
core_grid_start_power
4545
core_grid_start_power_strap_ground
4646
core_grid_strap_count
47+
core_grid_strap_outside_core
4748
core_grid_via_snap
4849
core_grid_with_M6_min_area
4950
core_grid_with_M7_pins

0 commit comments

Comments
 (0)