Skip to content

Commit 1b749e9

Browse files
committed
mpl: remove ignore-std-cell-area mechanism
Signed-off-by: Arthur Koucher <[email protected]>
1 parent 0aa3f6a commit 1b749e9

File tree

2 files changed

+46
-85
lines changed

2 files changed

+46
-85
lines changed

src/mpl/src/hier_rtlmp.cpp

Lines changed: 45 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,48 +1317,27 @@ void HierRTLMP::adjustMacroBlockageWeight()
13171317
}
13181318
}
13191319

1320-
void HierRTLMP::placeChildren(Cluster* parent, bool ignore_std_cell_area)
1320+
void HierRTLMP::placeChildren(Cluster* parent)
13211321
{
1322-
if (!ignore_std_cell_area) {
1323-
if (parent->getClusterType() == HardMacroCluster) {
1324-
placeMacros(parent);
1325-
return;
1326-
}
1327-
1328-
// Cover IO Clusters, Leaf Std Cells and Fixed Macros.
1329-
if (parent->isLeaf()) {
1330-
return;
1331-
}
1332-
1333-
debugPrint(logger_,
1334-
MPL,
1335-
"hierarchical_macro_placement",
1336-
1,
1337-
"Placing children of cluster {}",
1338-
parent->getName());
1322+
if (parent->getClusterType() == HardMacroCluster) {
1323+
placeMacros(parent);
1324+
return;
1325+
}
13391326

1340-
for (auto& cluster : parent->getChildren()) {
1341-
clustering_engine_->updateInstancesAssociation(cluster.get());
1342-
}
1343-
} else {
1344-
if (parent->getClusterType() != MixedCluster) {
1345-
return;
1346-
}
1327+
// Cover IO Clusters, Leaf Std Cells and Fixed Macros.
1328+
if (parent->isLeaf()) {
1329+
return;
1330+
}
13471331

1348-
// We only run this enhanced cluster placement version if there are no
1349-
// further levels ahead in the current branch of the physical hierarchy.
1350-
for (auto& cluster : parent->getChildren()) {
1351-
if (cluster->getClusterType() == MixedCluster) {
1352-
return;
1353-
}
1354-
}
1332+
debugPrint(logger_,
1333+
MPL,
1334+
"hierarchical_macro_placement",
1335+
1,
1336+
"Placing children of cluster {}",
1337+
parent->getName());
13551338

1356-
debugPrint(logger_,
1357-
MPL,
1358-
"hierarchical_macro_placement",
1359-
1,
1360-
"Conventional cluster placement failed. Attempting with minimum "
1361-
"target utilization.");
1339+
for (auto& cluster : parent->getChildren()) {
1340+
clustering_engine_->updateInstancesAssociation(cluster.get());
13621341
}
13631342

13641343
if (graphics_) {
@@ -1476,11 +1455,10 @@ void HierRTLMP::placeChildren(Cluster* parent, bool ignore_std_cell_area)
14761455
writeNetFile(file_name_prefix, macros, nets);
14771456
}
14781457

1479-
// Call Simulated Annealing Engine to place children
1480-
// set the action probabilities
1481-
// the summation of probabilities should be one.
1458+
// The sum of probabilities should be equal to 1.0.
14821459
const float action_sum = pos_swap_prob_ + neg_swap_prob_ + double_swap_prob_
14831460
+ exchange_swap_prob_ + resize_prob_;
1461+
14841462
// In our implementation, target_util and target_dead_space are different
14851463
// target_util is used to determine the utilization for MixedCluster
14861464
// target_dead_space is used to determine the utilization for
@@ -1489,27 +1467,17 @@ void HierRTLMP::placeChildren(Cluster* parent, bool ignore_std_cell_area)
14891467
std::vector<float> target_utils;
14901468
std::vector<float> target_dead_spaces;
14911469

1492-
if (!ignore_std_cell_area) {
1493-
// In our implementation, the utilization can be larger than 1.
1494-
for (int i = 0; i < num_target_util_; i++) {
1495-
target_utils.push_back(target_util_ + i * target_util_step_);
1496-
}
1497-
// In our implementation, the target_dead_space should be less than 1.0.
1498-
// The larger the target dead space, the higher the utilization.
1499-
for (int i = 0; i < num_target_dead_space_; i++) {
1500-
if (target_dead_space_ + i * target_dead_space_step_ < 1.0) {
1501-
target_dead_spaces.push_back(target_dead_space_
1502-
+ i * target_dead_space_step_);
1503-
}
1470+
// In our implementation, the utilization can be larger than 1.
1471+
for (int i = 0; i < num_target_util_; i++) {
1472+
target_utils.push_back(target_util_ + i * target_util_step_);
1473+
}
1474+
// In our implementation, the target_dead_space should be less than 1.0.
1475+
// The larger the target dead space, the higher the utilization.
1476+
for (int i = 0; i < num_target_dead_space_; i++) {
1477+
if (target_dead_space_ + i * target_dead_space_step_ < 1.0) {
1478+
target_dead_spaces.push_back(target_dead_space_
1479+
+ i * target_dead_space_step_);
15041480
}
1505-
} else {
1506-
// A high target util minimizes the std cells area inside mixed clusters
1507-
const float target_util = 1e6;
1508-
// A dead space closer to 1 minizes the std cell cluster area
1509-
const float target_dead_space = 0.99999;
1510-
1511-
target_utils.push_back(target_util);
1512-
target_dead_spaces.push_back(target_dead_space);
15131481
}
15141482

15151483
// Since target_util and target_dead_space are independent variables
@@ -1632,7 +1600,6 @@ void HierRTLMP::placeChildren(Cluster* parent, bool ignore_std_cell_area)
16321600

16331601
remaining_runs -= run_thread;
16341602

1635-
// add macro tilings
16361603
for (auto& sa : sa_batch) {
16371604
sa_containers.push_back(std::move(sa));
16381605
}
@@ -1657,36 +1624,30 @@ void HierRTLMP::placeChildren(Cluster* parent, bool ignore_std_cell_area)
16571624
}
16581625
}
16591626

1660-
if (best_sa == nullptr) {
1661-
if (!ignore_std_cell_area) {
1662-
placeChildren(parent, true);
1663-
} else {
1664-
logger_->error(MPL, 40, "Failed on cluster {}", parent->getName());
1665-
}
1666-
} else {
1667-
best_sa->fillDeadSpace();
1627+
if (!best_sa) {
1628+
logger_->error(MPL, 40, "Failed on cluster {}", parent->getName());
1629+
}
16681630

1669-
std::vector<SoftMacro> shaped_macros = best_sa->getMacros();
1631+
best_sa->fillDeadSpace();
16701632

1671-
if (logger_->debugCheck(MPL, "hierarchical_macro_placement", 1)) {
1672-
logger_->report("Cluster Placement Summary");
1673-
printPlacementResult(parent, outline, best_sa);
1633+
std::vector<SoftMacro> shaped_macros = best_sa->getMacros();
16741634

1675-
writeFloorplanFile(file_name_prefix, shaped_macros);
1676-
writeCostFile(file_name_prefix, best_sa);
1677-
}
1635+
if (logger_->debugCheck(MPL, "hierarchical_macro_placement", 1)) {
1636+
logger_->report("Cluster Placement Summary");
1637+
printPlacementResult(parent, outline, best_sa);
16781638

1679-
updateChildrenShapesAndLocations(parent, shaped_macros, soft_macro_id_map);
1680-
updateChildrenRealLocation(parent, outline.xMin(), outline.yMin());
1639+
writeFloorplanFile(file_name_prefix, shaped_macros);
1640+
writeCostFile(file_name_prefix, best_sa);
16811641
}
16821642

1683-
if (!ignore_std_cell_area) {
1684-
for (auto& cluster : parent->getChildren()) {
1685-
placeChildren(cluster.get());
1686-
}
1643+
updateChildrenShapesAndLocations(parent, shaped_macros, soft_macro_id_map);
1644+
updateChildrenRealLocation(parent, outline.xMin(), outline.yMin());
16871645

1688-
clustering_engine_->updateInstancesAssociation(parent);
1646+
for (auto& cluster : parent->getChildren()) {
1647+
placeChildren(cluster.get());
16891648
}
1649+
1650+
clustering_engine_->updateInstancesAssociation(parent);
16901651
}
16911652

16921653
// Find the area of blockages that are inside the outline.

src/mpl/src/hier_rtlmp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class HierRTLMP
173173

174174
// Hierarchical Macro Placement 1st stage: Cluster Placement
175175
void adjustMacroBlockageWeight();
176-
void placeChildren(Cluster* parent, bool ignore_std_cell_area = false);
176+
void placeChildren(Cluster* parent);
177177

178178
std::vector<odb::Rect> findBlockagesWithinOutline(
179179
const odb::Rect& outline) const;

0 commit comments

Comments
 (0)