aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch_place.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-08-05 16:32:12 +0200
committerDavid Shah <davey1576@gmail.com>2018-08-05 16:32:12 +0200
commit736f2a07175b85a94ca77cb930be528a4c7671ea (patch)
treeee55b494478154d72fb7f974f8fef68420fbf031 /ecp5/arch_place.cc
parent1ce0b5add2cb06449ae6b759a07aba5078d7b105 (diff)
downloadnextpnr-736f2a07175b85a94ca77cb930be528a4c7671ea.tar.gz
nextpnr-736f2a07175b85a94ca77cb930be528a4c7671ea.tar.bz2
nextpnr-736f2a07175b85a94ca77cb930be528a4c7671ea.zip
API change: Use CellInfo* and NetInfo* as cell/net handles (ECP5)
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/arch_place.cc')
-rw-r--r--ecp5/arch_place.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/ecp5/arch_place.cc b/ecp5/arch_place.cc
index 84432043..dee4f620 100644
--- a/ecp5/arch_place.cc
+++ b/ecp5/arch_place.cc
@@ -68,19 +68,18 @@ bool Arch::isBelLocationValid(BelId bel) const
std::vector<const CellInfo *> bel_cells;
Loc bel_loc = getBelLocation(bel);
for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) {
- IdString cell_other = getBoundBelCell(bel_other);
- if (cell_other != IdString()) {
- const CellInfo *ci_other = cells.at(cell_other).get();
- bel_cells.push_back(ci_other);
+ CellInfo *cell_other = getBoundBelCell(bel_other);
+ if (cell_other != nullptr) {
+ bel_cells.push_back(cell_other);
}
}
return slicesCompatible(bel_cells);
} else {
- IdString cellId = getBoundBelCell(bel);
- if (cellId == IdString())
+ CellInfo *cell = getBoundBelCell(bel);
+ if (cell == nullptr)
return true;
else
- return isValidBelForCell(cells.at(cellId).get(), bel);
+ return isValidBelForCell(cell, bel);
}
}
@@ -92,10 +91,9 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
std::vector<const CellInfo *> bel_cells;
Loc bel_loc = getBelLocation(bel);
for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) {
- IdString cell_other = getBoundBelCell(bel_other);
- if (cell_other != IdString() && bel_other != bel) {
- const CellInfo *ci_other = cells.at(cell_other).get();
- bel_cells.push_back(ci_other);
+ CellInfo *cell_other = getBoundBelCell(bel_other);
+ if (cell_other != nullptr && bel_other != bel) {
+ bel_cells.push_back(cell_other);
}
}