Skip to content

Commit e485c11

Browse files
committed
ppl: check slot layer on getSlotIdxByPosition function
Signed-off-by: Eder Monteiro <[email protected]>
1 parent f1a0114 commit e485c11

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ppl/src/HungarianMatching.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ void HungarianMatching::getFinalAssignment(std::vector<IOPin>& assigment,
150150
mirrored_pin.setLayer(slots_[slot_index].layer);
151151
mirrored_pin.setPlaced();
152152
assigment.push_back(mirrored_pin);
153-
slot_index = getSlotIdxByPosition(mirrored_pos);
153+
slot_index
154+
= getSlotIdxByPosition(mirrored_pos, mirrored_pin.getLayer());
154155
if (slot_index < 0) {
155156
odb::dbTechLayer* layer
156157
= db_->getTech()->findRoutingLayer(mirrored_pin.getLayer());
@@ -279,11 +280,12 @@ void HungarianMatching::getAssignmentForGroups(std::vector<IOPin>& assigment)
279280
assignment_.clear();
280281
}
281282

282-
int HungarianMatching::getSlotIdxByPosition(const odb::Point& position) const
283+
int HungarianMatching::getSlotIdxByPosition(const odb::Point& position,
284+
int layer) const
283285
{
284286
int slot_idx = -1;
285287
for (int i = 0; i < slots_.size(); i++) {
286-
if (slots_[i].pos == position) {
288+
if (slots_[i].pos == position && slots_[i].layer == layer) {
287289
slot_idx = i;
288290
break;
289291
}

src/ppl/src/HungarianMatching.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class HungarianMatching
9999

100100
void createMatrix();
101101
void createMatrixForGroups();
102-
int getSlotIdxByPosition(const odb::Point& position) const;
102+
int getSlotIdxByPosition(const odb::Point& position, int layer) const;
103103
};
104104

105105
} // namespace ppl

0 commit comments

Comments
 (0)