aboutsummaryrefslogtreecommitdiffstats
path: root/common/placer_heap.cc
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-01 07:26:54 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-02 07:43:38 -0800
commit1deab29b0591dd23da0c1d5c2c4fd8190abd6920 (patch)
tree93e7f4202ee41f6d84513052fd840ddfdd52ce0a /common/placer_heap.cc
parent9089ee2d1631fe2346143823c2896a2a85a27e8b (diff)
downloadnextpnr-1deab29b0591dd23da0c1d5c2c4fd8190abd6920.tar.gz
nextpnr-1deab29b0591dd23da0c1d5c2c4fd8190abd6920.tar.bz2
nextpnr-1deab29b0591dd23da0c1d5c2c4fd8190abd6920.zip
Moving missing empty check into initial placement loop.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'common/placer_heap.cc')
-rw-r--r--common/placer_heap.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc
index 9b581bb1..e14a4660 100644
--- a/common/placer_heap.cc
+++ b/common/placer_heap.cc
@@ -523,20 +523,29 @@ class HeAPPlacer
bool placed = false;
int attempt_count = 0;
while (!placed) {
- if (!available_bels.count(ci->type) || available_bels.at(ci->type).empty()) {
- log_error("Unable to place cell '%s', no BELs remaining to implement cell type '%s'\n",
- ci->name.c_str(ctx),
- ci->type.c_str(ctx));
- }
++attempt_count;
if (attempt_count > 25000) {
log_error("Unable to find a placement location for cell '%s'\n", ci->name.c_str(ctx));
}
+ // Make sure this cell type is in the available BEL map at
+ // all.
+ if (!available_bels.count(ci->type)) {
+ log_error("Unable to place cell '%s', no BELs remaining to implement cell type '%s'\n",
+ ci->name.c_str(ctx),
+ ci->type.c_str(ctx));
+ }
+
// Find an unused BEL from bels_for_cell_type.
auto &bels_for_cell_type = available_bels.at(ci->type);
BelId bel;
while(true) {
+ if (bels_for_cell_type.empty()) {
+ log_error("Unable to place cell '%s', no BELs remaining to implement cell type '%s'\n",
+ ci->name.c_str(ctx),
+ ci->type.c_str(ctx));
+ }
+
BelId candidate_bel = bels_for_cell_type.back();
bels_for_cell_type.pop_back();
if(bels_used.count(candidate_bel)) {