Skip to content

Commit

Permalink
mpl2: prevent io clusters from get moved after root's SoftSA
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Koucher <arthurckoucher@gmail.com>
  • Loading branch information
AcKoucher committed Nov 17, 2023
1 parent 4759105 commit ca5619a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/mpl2/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4074,12 +4074,8 @@ void HierRTLMP::multiLevelMacroPlacement(Cluster* parent)
}
file.close();

// update the shapes and locations for children clusters based on simulated
// annealing results
for (auto& cluster : parent->getChildren()) {
*(cluster->getSoftMacro())
= shaped_macros[soft_macro_id_map[cluster->getName()]];
}
updateChildrenShapesAndLocations(parent, shaped_macros, soft_macro_id_map);

// check if the parent cluster still need bus planning
for (auto& child : parent->getChildren()) {
if (child->getClusterType() == MixedCluster) {
Expand Down Expand Up @@ -4626,12 +4622,7 @@ void HierRTLMP::multiLevelMacroPlacementWithoutBusPlanning(Cluster* parent)
}
file.close();

// update the shapes and locations for children clusters based on simulated
// annealing results
for (auto& cluster : parent->getChildren()) {
*(cluster->getSoftMacro())
= shaped_macros[soft_macro_id_map[cluster->getName()]];
}
updateChildrenShapesAndLocations(parent, shaped_macros, soft_macro_id_map);

// update the location of children cluster to their real location
for (auto& cluster : parent->getChildren()) {
Expand Down Expand Up @@ -5123,12 +5114,7 @@ void HierRTLMP::enhancedMacroPlacement(Cluster* parent)
}
file.close();

// update the shapes and locations for children clusters based on simulated
// annealing results
for (auto& cluster : parent->getChildren()) {
*(cluster->getSoftMacro())
= shaped_macros[soft_macro_id_map[cluster->getName()]];
}
updateChildrenShapesAndLocations(parent, shaped_macros, soft_macro_id_map);

// update the location of children cluster to their real location
for (auto& cluster : parent->getChildren()) {
Expand Down Expand Up @@ -5981,6 +5967,22 @@ void HierRTLMP::alignHardMacroGlobal(Cluster* parent)
}
}

// Update the location from the perspective of the SA outline
void HierRTLMP::updateChildrenShapesAndLocations(
Cluster* parent,
const std::vector<SoftMacro>& shaped_macros,
const std::map<std::string, int>& soft_macro_id_map)
{
for (auto& child : parent->getChildren()) {
// IO clusters are fixed and have no area,
// so their shapes and locations should not be updated
if (!child->isIOCluster()) {
*(child->getSoftMacro())
= shaped_macros[soft_macro_id_map.at(child->getName())];
}
}
}

// force-directed placement to generate guides for macros
// Attractive force and Repulsive force should be normalied separately
// Because their values can vary a lot.
Expand Down
5 changes: 5 additions & 0 deletions src/mpl2/src/hier_rtlmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ class HierRTLMP
void alignHardMacroGlobal(Cluster* parent); // call this function after
// multilevel macro placement

void updateChildrenShapesAndLocations(
Cluster* parent,
const std::vector<SoftMacro>& shaped_macros,
const std::map<std::string, int>& soft_macro_id_map);

// force-directed placement to generate guides for macros
void FDPlacement(std::vector<Rect>& blocks,
const std::vector<BundledNet>& nets,
Expand Down

0 comments on commit ca5619a

Please sign in to comment.