Skip to content

Commit 08e488f

Browse files
authored
Merge pull request #9968 from tnguy19/ram-pdn-size-check
ram: add PDN strap pitch vs die size error check in ramPdngen() to prevent segfault
2 parents 77806f9 + 9b785fa commit 08e488f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/ram/src/ram.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,28 @@ void RamGen::ramPdngen(const char* power_pin,
465465
int hor_width,
466466
int hor_pitch)
467467
{
468+
const odb::Rect& die = block_->getDieArea();
469+
const double dbu_per_um = block_->getDb()->getDbuPerMicron();
470+
471+
if (die.dy() < hor_pitch) {
472+
logger_->error(RAM,
473+
31,
474+
"Die height ({:.2f} um) is less than horizontal strap pitch "
475+
"({:.2f} um). "
476+
"Use a smaller -hor_layer pitch.",
477+
die.dy() / dbu_per_um,
478+
hor_pitch / dbu_per_um);
479+
}
480+
if (die.dx() < ver_pitch) {
481+
logger_->error(
482+
RAM,
483+
32,
484+
"Die width ({:.2f} um) is less than vertical strap pitch ({:.2f} um). "
485+
"Use a smaller -ver_layer pitch.",
486+
die.dx() / dbu_per_um,
487+
ver_pitch / dbu_per_um);
488+
}
489+
468490
// need parameters for power and ground nets
469491
auto power_net = dbNet::create(block_, "VDD");
470492
auto ground_net = dbNet::create(block_, "VSS");

0 commit comments

Comments
 (0)