Skip to content

Commit f09a2a9

Browse files
committed
ppl: coverity fixes
Signed-off-by: Eder Monteiro <[email protected]>
1 parent fffec72 commit f09a2a9

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/ppl/src/IOPlacer.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ void IOPlacer::findSections(int begin,
10041004
n_sec.used_slots = 0;
10051005
n_sec.edge = edge;
10061006

1007-
sections.push_back(n_sec);
1007+
sections.push_back(std::move(n_sec));
10081008
begin = ++end_slot;
10091009
}
10101010
}
@@ -3023,14 +3023,16 @@ void IOPlacer::filterObstructedSlotsForTopLayer()
30233023

30243024
// check for slots that go beyond the die boundary
30253025
odb::Rect die_area = getBlock()->getDieArea();
3026-
for (auto& slot : top_layer_slots_) {
3027-
odb::Point& point = slot.pos;
3028-
if (point.x() - top_grid_->pin_width / 2 < die_area.xMin()
3029-
|| point.y() - top_grid_->pin_height / 2 < die_area.yMin()
3030-
|| point.x() + top_grid_->pin_width / 2 > die_area.xMax()
3031-
|| point.y() + top_grid_->pin_height / 2 > die_area.yMax()) {
3032-
// mark slot as blocked since it extends beyond the die area
3033-
slot.blocked = true;
3026+
if (top_grid_ != nullptr) {
3027+
for (auto& slot : top_layer_slots_) {
3028+
odb::Point& point = slot.pos;
3029+
if (point.x() - top_grid_->pin_width / 2 < die_area.xMin()
3030+
|| point.y() - top_grid_->pin_height / 2 < die_area.yMin()
3031+
|| point.x() + top_grid_->pin_width / 2 > die_area.xMax()
3032+
|| point.y() + top_grid_->pin_height / 2 > die_area.yMax()) {
3033+
// mark slot as blocked since it extends beyond the die area
3034+
slot.blocked = true;
3035+
}
30343036
}
30353037
}
30363038

@@ -3102,7 +3104,7 @@ std::vector<Section> IOPlacer::findSectionsForTopLayer(const odb::Rect& region)
31023104
n_sec.used_slots = 0;
31033105
n_sec.edge = Edge::invalid;
31043106

3105-
sections.push_back(n_sec);
3107+
sections.push_back(std::move(n_sec));
31063108
edge_begin = ++end_slot;
31073109
}
31083110
}

src/ppl/src/SimulatedAnnealing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void SimulatedAnnealing::run(float init_temperature,
117117
for (int pin_idx = 0; pin_idx < pins.size(); pin_idx++) {
118118
std::vector<ppl::InstancePin> pin_sinks;
119119
netlist_->getSinksOfIO(pin_idx, pin_sinks);
120-
all_sinks.push_back(pin_sinks);
120+
all_sinks.push_back(std::move(pin_sinks));
121121
}
122122

123123
annealingStateVisualization(pins, all_sinks, iter);

0 commit comments

Comments
 (0)