Skip to content

Commit 974d64f

Browse files
authored
Merge pull request #9072 from AcKoucher/mpl-dbu-checks
mpl: fix some remaining floating point inconsistencies
2 parents 7930002 + f2560b5 commit 974d64f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/mpl/src/SACoreSoftMacro.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ void SACoreSoftMacro::fillDeadSpace()
855855
y_point.insert(macros_[macro_id].getY());
856856
y_point.insert(macros_[macro_id].getY() + macros_[macro_id].getHeight());
857857
}
858-
x_point.insert(0.0);
859-
y_point.insert(0.0);
858+
x_point.insert(0);
859+
y_point.insert(0);
860860
x_point.insert(outline_.dx());
861861
y_point.insert(outline_.dy());
862862
// create grid
@@ -872,7 +872,7 @@ void SACoreSoftMacro::fillDeadSpace()
872872
}
873873

874874
for (int macro_id = 0; macro_id < pos_seq_.size(); macro_id++) {
875-
if (macros_[macro_id].getArea() <= 0.0) {
875+
if (macros_[macro_id].getArea() == 0) {
876876
continue;
877877
}
878878

@@ -892,7 +892,7 @@ void SACoreSoftMacro::fillDeadSpace()
892892
// propagate from the MixedCluster and then StdCellCluster
893893
for (int order = 0; order <= 1; order++) {
894894
for (int macro_id = 0; macro_id < pos_seq_.size(); macro_id++) {
895-
if (macros_[macro_id].getArea() <= 0.0) {
895+
if (macros_[macro_id].getArea() == 0) {
896896
continue;
897897
}
898898
const bool forward_flag = (order == 0)

src/mpl/src/clusterEngine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ void ClusteringEngine::setClusterMetrics(Cluster* cluster)
11951195
std_cell_area += computeArea(std_cell);
11961196
}
11971197

1198-
int64_t macro_area = 0.0f;
1198+
int64_t macro_area = 0;
11991199
for (odb::dbInst* macro : cluster->getLeafMacros()) {
12001200
macro_area += computeArea(macro);
12011201
}
@@ -2525,13 +2525,13 @@ void ClusteringEngine::printPhysicalHierarchyTree(Cluster* parent, int level)
25252525
line += fmt::format(" {}", parent->getIsLeafString());
25262526

25272527
// Using 'or' on purpose to certify that there is no discrepancy going on.
2528-
if (parent->getNumStdCell() != 0 || parent->getStdCellArea() != 0.0f) {
2528+
if (parent->getNumStdCell() != 0 || parent->getStdCellArea() != 0) {
25292529
line += fmt::format(", StdCells: {} ({} μ²)",
25302530
parent->getNumStdCell(),
25312531
parent->getStdCellArea());
25322532
}
25332533

2534-
if (parent->getNumMacro() != 0 || parent->getMacroArea() != 0.0f) {
2534+
if (parent->getNumMacro() != 0 || parent->getMacroArea() != 0) {
25352535
line += fmt::format(", Macros: {} ({} μ²),",
25362536
parent->getNumMacro(),
25372537
parent->getMacroArea());

src/mpl/src/hier_rtlmp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ void HierRTLMP::createPinAccessBlockages()
912912
= tree_->maps.module_to_metrics.at(block_->getTopModule()).get();
913913

914914
// Avoid creating blockages with zero depth.
915-
if (top_module_metrics->getStdCellArea() == 0.0) {
915+
if (top_module_metrics->getStdCellArea() == 0) {
916916
return;
917917
}
918918

@@ -1805,8 +1805,8 @@ void HierRTLMP::createFixedTerminal(Cluster* cluster,
18051805
// A conventional fixed terminal is just a point without
18061806
// the cluster data.
18071807
odb::Point location = cluster->getCenter();
1808-
float width = 0.0f;
1809-
float height = 0.0f;
1808+
int width = 0;
1809+
int height = 0;
18101810
Cluster* terminal_cluster = nullptr;
18111811

18121812
if (cluster->isClusterOfUnplacedIOPins()) {

0 commit comments

Comments
 (0)