diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-08-05 16:46:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-05 16:46:24 +0200 |
commit | 6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba (patch) | |
tree | 8b289ec41872e8f907e001500ff2d237c9350342 /ecp5/arch_place.cc | |
parent | b3acd8095fdcffe0dc116218d824a6c03562b69e (diff) | |
parent | 736f2a07175b85a94ca77cb930be528a4c7671ea (diff) | |
download | nextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.tar.gz nextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.tar.bz2 nextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.zip |
Merge pull request #37 from YosysHQ/ngapi
API change: Use CellInfo* and NetInfo* as cell/net handles
Diffstat (limited to 'ecp5/arch_place.cc')
-rw-r--r-- | ecp5/arch_place.cc | 20 |
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); } } |