diff options
author | David Shah <davey1576@gmail.com> | 2018-06-16 18:45:32 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-16 18:45:48 +0200 |
commit | e497575c8eb2eeef520e1e3b8b90f5d5ce811dd8 (patch) | |
tree | e14de7ac975961de62464fd1f8eb2f2d547edd4b /common | |
parent | 6d68af1e622fb960c64b0bf899d1397c2ba69995 (diff) | |
download | nextpnr-e497575c8eb2eeef520e1e3b8b90f5d5ce811dd8.tar.gz nextpnr-e497575c8eb2eeef520e1e3b8b90f5d5ce811dd8.tar.bz2 nextpnr-e497575c8eb2eeef520e1e3b8b90f5d5ce811dd8.zip |
place: Fix placer validity checks
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/place_sa.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/common/place_sa.cc b/common/place_sa.cc index a6d3040f..9e3d3022 100644 --- a/common/place_sa.cc +++ b/common/place_sa.cc @@ -177,13 +177,16 @@ static bool try_swap_position(Design *design, CellInfo *cell, BelId newBel, } chip.bindBel(newBel, cell->name); + if (other != IdString()) { - if (!isValidBelForCell(design, other_cell, oldBel)) { - chip.unbindBel(newBel); - goto swap_fail; - } else { - chip.bindBel(oldBel, other_cell->name); - } + chip.bindBel(oldBel, other_cell->name); + } + + if (!isBelLocationValid(design, newBel) || ((other != IdString() && !isBelLocationValid(design, oldBel)))) { + chip.unbindBel(newBel); + if (other != IdString()) + chip.unbindBel(oldBel); + goto swap_fail; } cell->bel = newBel; |