Skip to content

Commit

Permalink
mpl2: address clang-tidy and format
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Koucher <[email protected]>
  • Loading branch information
AcKoucher committed Sep 26, 2024
1 parent d5281b8 commit ede06cd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/mpl2/src/SimulatedAnnealingCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class SimulatedAnnealingCore
void calWirelength();
void addBoundaryDistToWirelength(const T& macro,
const T& io,
const float net_weight);
float net_weight);
bool isOutsideTheOutline(const T& macro) const;
void calGuidancePenalty();
void calFencePenalty();
Expand Down
12 changes: 7 additions & 5 deletions src/mpl2/src/clusterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,21 @@ Boundary ClusteringEngine::getConstraintBoundary(
const odb::Rect& die,
const odb::Rect& constraint_region)
{
Boundary constraint_boundary = NONE;
if (constraint_region.xMin() == constraint_region.xMax()) {
if (constraint_region.xMin() == die.xMin()) {
return L;
constraint_boundary = L;
} else {
return R;
constraint_boundary = R;
}
} else {
if (constraint_region.yMin() == die.yMin()) {
return B;
constraint_boundary = B;
} else {
return T;
constraint_boundary = T;
}
}
return constraint_boundary;
}

void ClusteringEngine::createIOCluster(
Expand Down Expand Up @@ -2110,7 +2112,7 @@ void ClusteringEngine::printPhysicalHierarchyTree(Cluster* parent, int level)
parent->getMacroArea());
}

logger_->report("{}", line);
logger_->report("{}", line);

for (auto& cluster : parent->getChildren()) {
printPhysicalHierarchyTree(cluster.get(), level + 1);
Expand Down
4 changes: 2 additions & 2 deletions src/mpl2/src/clusterEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ class ClusteringEngine
Boundary getConstraintBoundary(const odb::Rect& die,
const odb::Rect& constraint_region);
void createIOCluster(const odb::Rect& die,
const Boundary constraint_boundary,
Boundary constraint_boundary,
std::map<Boundary, Cluster*>& boundary_to_cluster,
odb::dbBTerm* bterm);
void setIOClusterDimensions(const odb::Rect& die,
const Boundary boundary,
Boundary boundary,
int& x,
int& y,
int& width,
Expand Down
4 changes: 2 additions & 2 deletions src/mpl2/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ std::vector<Cluster*> HierRTLMP::getIOClusters()
// 1) Amount of std cell area in the design.
// 2) Extension of the IO clusters across the design's boundaries.
float HierRTLMP::computePinAccessBlockagesDepth(
std::vector<Cluster*> io_clusters,
const std::vector<Cluster*>& io_clusters,
const Rect& die)
{
float io_clusters_extension = 0.0;
Expand Down Expand Up @@ -3925,7 +3925,7 @@ float HierRTLMP::calculateRealMacroWirelength(odb::dbInst* macro)
for (odb::dbITerm* iterm : net->getITerms()) {
int x, y;
if (iterm->getAvgXY(&x, &y)) {
odb::Rect iterm_rect(x, y, x , y);
odb::Rect iterm_rect(x, y, x, y);
net_box.merge(iterm_rect);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mpl2/src/hier_rtlmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class HierRTLMP
void setTightPackingTilings(Cluster* macro_array);
void setPinAccessBlockages();
std::vector<Cluster*> getIOClusters();
float computePinAccessBlockagesDepth(std::vector<Cluster*> io_clusters,
float computePinAccessBlockagesDepth(const std::vector<Cluster*>& io_clusters,
const Rect& die);
void createPinAccessBlockage(Boundary constraint_boundary,
float depth,
Expand Down

0 comments on commit ede06cd

Please sign in to comment.