Skip to content

Commit 7218fa9

Browse files
committed
pdn: add option to allow stripes outside core area and add nets to report
Signed-off-by: Peter Gadfort <[email protected]>
1 parent b57cfc6 commit 7218fa9

16 files changed

+2965
-29
lines changed

src/pdn/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ add_pdn_stripe
211211
[-spacing spacing_value]
212212
[-starts_with POWER|GROUND]
213213
[-width width_value]
214+
[-allow_out_of_core]
214215
```
215216

216217
#### Options
@@ -230,6 +231,7 @@ add_pdn_stripe
230231
| `[-spacing]` | Optional specification of the spacing between power/ground pairs within a single pitch (Default: pitch / 2). |
231232
| `[-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). |
232233
| `[-width]` | Value for the width of stripe. |
234+
| `-allow_out_of_core` | Allow stripes to continue beyond the core area. |
233235

234236
### Add Sroute Connect
235237

src/pdn/include/pdn/PdnGen.hh

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

src/pdn/src/PdnGen.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ void PdnGen::makeStrap(Grid* grid,
598598
bool snap,
599599
StartsWith starts_with,
600600
ExtensionMode extend,
601-
const std::vector<odb::dbNet*>& nets)
601+
const std::vector<odb::dbNet*>& nets,
602+
bool allow_out_of_core)
602603
{
603604
auto strap = std::make_unique<Straps>(
604605
grid, layer, width, pitch, spacing, number_of_straps);
@@ -609,6 +610,7 @@ void PdnGen::makeStrap(Grid* grid,
609610
strap->setStartWithPower(starts_with == POWER);
610611
}
611612
strap->setNets(nets);
613+
strap->setAllowOutsideCoreArea(allow_out_of_core);
612614
grid->addStrap(std::move(strap));
613615
}
614616

src/pdn/src/PdnGen.i

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ void make_strap(const char* grid_name,
229229
bool use_grid_power_order,
230230
bool starts_with_power,
231231
pdn::ExtensionMode extend,
232-
const std::vector<odb::dbNet*>& nets)
232+
const std::vector<odb::dbNet*>& nets,
233+
bool allow_out_of_core)
233234
{
234235
PdnGen* pdngen = ord::getPdnGen();
235236
StartsWith starts_with = GRID;
@@ -251,7 +252,8 @@ void make_strap(const char* grid_name,
251252
snap,
252253
starts_with,
253254
extend,
254-
nets);
255+
nets,
256+
allow_out_of_core);
255257
}
256258
}
257259

src/pdn/src/pdn.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,14 @@ sta::define_cmd_args "add_pdn_stripe" {[-grid grid_name] \
265265
[-extend_to_boundary] \
266266
[-snap_to_grid] \
267267
[-number_of_straps count] \
268-
[-nets list_of_nets]
268+
[-nets list_of_nets]\
269+
[-allow_out_of_core]
269270
}
270271

271272
proc add_pdn_stripe { args } {
272273
sta::parse_key_args "add_pdn_stripe" args \
273274
keys {-grid -layer -width -pitch -spacing -offset -starts_with -number_of_straps -nets} \
274-
flags {-followpins -extend_to_core_ring -extend_to_boundary -snap_to_grid}
275+
flags {-followpins -extend_to_core_ring -extend_to_boundary -snap_to_grid -allow_out_of_core}
275276

276277
sta::check_argc_eq0 "add_pdn_stripe" $args
277278

@@ -375,7 +376,8 @@ proc add_pdn_stripe { args } {
375376
$use_grid_power_order \
376377
$start_with_power \
377378
$extend \
378-
$nets
379+
$nets \
380+
[info exists flags(-allow_out_of_core)]
379381
}
380382
}
381383

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
@@ -1653,20 +1676,6 @@ RepairChannelStraps::RepairChannelStraps(
16531676
}
16541677
}
16551678

1656-
std::string RepairChannelStraps::getNetString() const
1657-
{
1658-
std::string nets;
1659-
1660-
for (auto* net : nets_) {
1661-
if (!nets.empty()) {
1662-
nets += ", ";
1663-
}
1664-
nets += net->getName();
1665-
}
1666-
1667-
return nets;
1668-
}
1669-
16701679
int RepairChannelStraps::getMaxLength() const
16711680
{
16721681
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
@@ -57,6 +57,10 @@ class Straps : public GridComponent
5757
{
5858
return direction_ == odb::dbTechLayerDir::HORIZONTAL;
5959
}
60+
void setAllowOutsideCoreArea(bool allow_out_of_core)
61+
{
62+
allow_out_of_core_ = allow_out_of_core;
63+
}
6064

6165
void report() const override;
6266
Type type() const override { return GridComponent::Strap; }
@@ -69,6 +73,7 @@ class Straps : public GridComponent
6973

7074
protected:
7175
bool checkLayerOffsetSpecification(bool error = false) const;
76+
std::string getNetString() const;
7277

7378
private:
7479
odb::dbTechLayer* layer_;
@@ -82,6 +87,7 @@ class Straps : public GridComponent
8287
ExtensionMode extend_mode_ = ExtensionMode::CORE;
8388
int strap_start_ = 0;
8489
int strap_end_ = 0;
90+
bool allow_out_of_core_ = false;
8591

8692
void makeStraps(int x_start,
8793
int y_start,
@@ -272,8 +278,6 @@ class RepairChannelStraps : public Straps
272278
int bisect_dist = 0,
273279
int level = 0);
274280

275-
std::string getNetString() const;
276-
277281
static std::vector<RepairChannelArea> findRepairChannels(
278282
Grid* grid,
279283
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)