Skip to content

Commit f9ead99

Browse files
committed
gpl: use regions instead of power domains
Signed-off-by: osamahammad21 <[email protected]>
1 parent 6dadf2d commit f9ead99

File tree

2 files changed

+22
-36
lines changed

2 files changed

+22
-36
lines changed

src/gpl/src/placerBase.cpp

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,6 @@ void PlacerBase::init()
10681068
void PlacerBase::initInstsForUnusableSites()
10691069
{
10701070
dbSet<dbRow> rows = db_->getChip()->getBlock()->getRows();
1071-
dbSet<dbPowerDomain> pds = db_->getChip()->getBlock()->getPowerDomains();
10721071

10731072
int64_t siteCountX = (die_.coreUx() - die_.coreLx()) / siteSizeX_;
10741073
int64_t siteCountY = (die_.coreUy() - die_.coreLy()) / siteSizeY_;
@@ -1161,29 +1160,19 @@ void PlacerBase::initInstsForUnusableSites()
11611160
// In the case of top level power domain i.e no group,
11621161
// mark all other power domains as empty
11631162
if (group_ == nullptr) {
1164-
for (dbPowerDomain* pd : pds) {
1165-
if (pd->getGroup() != nullptr) {
1166-
for (auto boundary : pd->getGroup()->getRegion()->getBoundaries()) {
1167-
Rect rect = boundary->getBox();
1168-
1169-
std::pair<int, int> pairX = getMinMaxIdx(rect.xMin(),
1170-
rect.xMax(),
1171-
die_.coreLx(),
1172-
siteSizeX_,
1173-
0,
1174-
siteCountX);
1175-
1176-
std::pair<int, int> pairY = getMinMaxIdx(rect.yMin(),
1177-
rect.yMax(),
1178-
die_.coreLy(),
1179-
siteSizeY_,
1180-
0,
1181-
siteCountY);
1182-
1183-
for (int i = pairX.first; i < pairX.second; i++) {
1184-
for (int j = pairY.first; j < pairY.second; j++) {
1185-
siteGrid[j * siteCountX + i] = Empty;
1186-
}
1163+
for (auto region : db_->getChip()->getBlock()->getRegions()) {
1164+
for (auto boundary : region->getBoundaries()) {
1165+
Rect rect = boundary->getBox();
1166+
1167+
std::pair<int, int> pairX = getMinMaxIdx(
1168+
rect.xMin(), rect.xMax(), die_.coreLx(), siteSizeX_, 0, siteCountX);
1169+
1170+
std::pair<int, int> pairY = getMinMaxIdx(
1171+
rect.yMin(), rect.yMax(), die_.coreLy(), siteSizeY_, 0, siteCountY);
1172+
1173+
for (int i = pairX.first; i < pairX.second; i++) {
1174+
for (int j = pairY.first; j < pairY.second; j++) {
1175+
siteGrid[j * siteCountX + i] = Empty;
11871176
}
11881177
}
11891178
}

src/gpl/src/replace.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ void Replace::doIncrementalPlace(int threads)
118118

119119
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_));
120120

121-
for (auto pd : db_->getChip()->getBlock()->getPowerDomains()) {
122-
if (pd->getGroup()) {
123-
pbVec_.push_back(
124-
std::make_shared<PlacerBase>(db_, pbc_, log_, pd->getGroup()));
121+
for (auto pd : db_->getChip()->getBlock()->getRegions()) {
122+
for (auto group : pd->getGroups()) {
123+
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_, group));
125124
}
126125
}
127126

@@ -197,10 +196,9 @@ void Replace::doInitialPlace(int threads)
197196

198197
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_));
199198

200-
for (auto pd : db_->getChip()->getBlock()->getPowerDomains()) {
201-
if (pd->getGroup()) {
202-
pbVec_.push_back(
203-
std::make_shared<PlacerBase>(db_, pbc_, log_, pd->getGroup()));
199+
for (auto pd : db_->getChip()->getBlock()->getRegions()) {
200+
for (auto group : pd->getGroups()) {
201+
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_, group));
204202
}
205203
}
206204

@@ -250,10 +248,9 @@ bool Replace::initNesterovPlace(int threads)
250248

251249
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_));
252250

253-
for (auto pd : db_->getChip()->getBlock()->getPowerDomains()) {
254-
if (pd->getGroup()) {
255-
pbVec_.push_back(
256-
std::make_shared<PlacerBase>(db_, pbc_, log_, pd->getGroup()));
251+
for (auto pd : db_->getChip()->getBlock()->getRegions()) {
252+
for (auto group : pd->getGroups()) {
253+
pbVec_.push_back(std::make_shared<PlacerBase>(db_, pbc_, log_, group));
257254
}
258255
}
259256

0 commit comments

Comments
 (0)