aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch_place.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-16 11:52:16 +0000
committergatecat <gatecat@ds0.me>2021-02-16 13:31:36 +0000
commitc7c13cd95f7a25b2c8932ca00ad667ffca381c70 (patch)
tree222496d567bd217e6958660a1e1153a1b273ca36 /ecp5/arch_place.cc
parent815b57b9e1f0c0a7176d146a29cef763bebf343f (diff)
downloadnextpnr-c7c13cd95f7a25b2c8932ca00ad667ffca381c70.tar.gz
nextpnr-c7c13cd95f7a25b2c8932ca00ad667ffca381c70.tar.bz2
nextpnr-c7c13cd95f7a25b2c8932ca00ad667ffca381c70.zip
Remove isValidBelForCell
This Arch API dates from when we were first working out how to implement placement validity checking, and in practice is little used by the core parts of placer1/HeAP and the Arch implementation involves a lot of duplication with isBelLocationValid. In the short term; placement validity checking is better served by the combination of checkBelAvail and isValidBelForCellType before placement; followed by isBelLocationValid after placement (potentially after moving/swapping multiple cells). Longer term, removing this API makes things a bit cleaner for a new validity checking API. Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'ecp5/arch_place.cc')
-rw-r--r--ecp5/arch_place.cc36
1 files changed, 6 insertions, 30 deletions
diff --git a/ecp5/arch_place.cc b/ecp5/arch_place.cc
index 668b3141..5565a01c 100644
--- a/ecp5/arch_place.cc
+++ b/ecp5/arch_place.cc
@@ -82,38 +82,14 @@ bool Arch::isBelLocationValid(BelId bel) const
return slices_compatible(bel_cells);
} else {
CellInfo *cell = getBoundBelCell(bel);
- if (cell == nullptr)
+ if (cell == nullptr) {
+ return true;
+ } else if (cell->type == id_DCUA || cell->type == id_EXTREFB || cell->type == id_PCSCLKDIV) {
+ return args.type != ArchArgs::LFE5U_25F && args.type != ArchArgs::LFE5U_45F &&
+ args.type != ArchArgs::LFE5U_85F;
+ } else {
return true;
- else
- return isValidBelForCell(cell, bel);
- }
-}
-
-bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
-{
- if (cell->type == id_TRELLIS_SLICE) {
- NPNR_ASSERT(getBelType(bel) == id_TRELLIS_SLICE);
-
- std::vector<const CellInfo *> bel_cells;
- Loc bel_loc = getBelLocation(bel);
-
- if (cell->sliceInfo.has_l6mux && ((bel_loc.z % 2) == 1))
- return false;
-
- for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) {
- CellInfo *cell_other = getBoundBelCell(bel_other);
- if (cell_other != nullptr && bel_other != bel) {
- bel_cells.push_back(cell_other);
- }
}
-
- bel_cells.push_back(cell);
- return slices_compatible(bel_cells);
- } else if (cell->type == id_DCUA || cell->type == id_EXTREFB || cell->type == id_PCSCLKDIV) {
- return args.type != ArchArgs::LFE5U_25F && args.type != ArchArgs::LFE5U_45F && args.type != ArchArgs::LFE5U_85F;
- } else {
- // other checks
- return true;
}
}