From aa26ba7ea1024dde73f537dcae5cf1c01c4d3ea5 Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 20 Feb 2024 10:25:35 +0100 Subject: [PATCH] static: Improve singleton handling Signed-off-by: gatecat --- common/place/placer_static.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index 7346821b..9b3d8556 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -408,7 +408,17 @@ class StaticPlacer StaticRect rect; // Mismatched group case if (!lookup_group(ci->type, cell_group, rect)) { - // TODO: what is the best thing to do here? singletons/odd cells we can probably mostly randomly place + for (auto bel : ctx->getBels()) { + if (ctx->isValidBelForCellType(ci->type, bel) && ctx->checkBelAvail(bel)) { + ctx->bindBel(bel, ci, STRENGTH_STRONG); + if (!ctx->isBelLocationValid(bel)) { + ctx->unbindBel(bel); + } else { + log_info(" placed potpourri cell '%s' at bel '%s'\n", ctx->nameOf(ci), ctx->nameOfBel(bel)); + break; + } + } + } continue; } if (ci->cluster != ClusterId()) {