Skip to content

Commit f0d4a4d

Browse files
committed
pad: address clang-tidy round 1
Signed-off-by: Peter Gadfort <[email protected]>
1 parent 4e82db6 commit f0d4a4d

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

src/pad/src/ICeWall.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,11 @@ void ICeWall::placeFiller(
943943
"{}{}_{}_{}", kFillPrefix, row->getName(), fill_group, site_offset);
944944
auto* fill_inst = odb::dbInst::create(block, filler, name.c_str());
945945

946-
placer.place(fill_inst,
947-
row_start + site_width * (start_site_index + site_offset),
948-
odb::dbOrientType::R0,
949-
allow_overlap);
946+
placer.place(
947+
fill_inst,
948+
row_start + (site_width * (start_site_index + site_offset)),
949+
odb::dbOrientType::R0,
950+
allow_overlap);
950951

951952
site_offset += fill_width;
952953
sites -= fill_width;

src/pad/src/PadPlacer.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33

44
#include "PadPlacer.h"
55

6+
#include <algorithm>
7+
#include <cmath>
8+
#include <cstdint>
9+
#include <iterator>
10+
#include <limits>
11+
#include <map>
12+
#include <optional>
13+
#include <set>
14+
#include <utility>
15+
#include <vector>
16+
617
#include "gui/gui.h"
718
#include "odb/db.h"
819
#include "odb/dbTransform.h"
20+
#include "odb/dbTypes.h"
921
#include "odb/geom.h"
22+
#include "odb/isotropy.h"
23+
#include "utl/Logger.h"
1024

1125
namespace pad {
1226

@@ -522,7 +536,7 @@ void BumpAlignedPadPlacer::place()
522536
}
523537

524538
// build positions with bump as the center
525-
int target_offset = group_center - group_width / 2;
539+
int target_offset = group_center - (group_width / 2);
526540
for (const auto& [ginst, giterm] : min_terms) {
527541
inst_pos[ginst] = target_offset;
528542
target_offset += getInstWidths().at(ginst);
@@ -582,11 +596,11 @@ int64_t BumpAlignedPadPlacer::computePadBumpDistance(odb::dbInst* inst,
582596
case odb::Direction2D::North:
583597
case odb::Direction2D::South:
584598
return odb::Point::squaredDistance(
585-
odb::Point(center_pos + inst_width / 2, row_center.y()), center);
599+
odb::Point(center_pos + (inst_width / 2), row_center.y()), center);
586600
case odb::Direction2D::West:
587601
case odb::Direction2D::East:
588602
return odb::Point::squaredDistance(
589-
odb::Point(row_center.x(), center_pos + inst_width / 2), center);
603+
odb::Point(row_center.x(), center_pos + (inst_width / 2)), center);
590604
}
591605

592606
return std::numeric_limits<int64_t>::max();

src/pad/src/PadPlacer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55

66
#include <cstdint>
77
#include <map>
8+
#include <set>
9+
#include <utility>
810
#include <vector>
911

1012
#include "odb/db.h"
13+
#include "odb/dbTypes.h"
1114
#include "odb/geom.h"
15+
#include "odb/isotropy.h"
1216

1317
namespace odb {
1418
class dbBlock;

0 commit comments

Comments
 (0)