From b0b16a344a951c7144783f799232a1b9d85ddc8a Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 27 Jun 2018 12:18:52 +0200 Subject: Improving post-ripup placement in the legaliser Signed-off-by: David Shah --- ice40/main.cc | 2 +- ice40/place_legaliser.cc | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'ice40') diff --git a/ice40/main.cc b/ice40/main.cc index f1736fab..c975db24 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -391,7 +391,7 @@ int main(int argc, char *argv[]) std::vector files = vm["run"].as>(); for (auto filename : files) execute_python_file(filename.c_str()); - + deinit_python(); } #endif diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc index 4b8a204e..00a57866 100644 --- a/ice40/place_legaliser.cc +++ b/ice40/place_legaliser.cc @@ -23,6 +23,7 @@ #include "cells.h" #include "design_utils.h" #include "log.h" +#include "place_common.h" #include "util.h" NEXTPNR_NAMESPACE_BEGIN @@ -379,7 +380,7 @@ class PlacementLegaliser bool success = true; for (auto cell : sorted(rippedCells)) { CellInfo *ci = ctx->cells.at(cell).get(); - bool placed = place_single_cell(ci); + bool placed = place_single_cell(ctx, ci, true); if (!placed) { if (ctx->force) { log_warning("failed to place cell '%s' of type '%s'\n", cell.c_str(ctx), ci->type.c_str(ctx)); @@ -392,19 +393,6 @@ class PlacementLegaliser return success; } - // Place a single cell in the first valid location - bool place_single_cell(CellInfo *cell) - { - BelType tgtType = ctx->belTypeFromId(cell->type); - for (auto bel : ctx->getBels()) { - if (ctx->getBelType(bel) == tgtType && ctx->checkBelAvail(bel) && ctx->isValidBelForCell(cell, bel)) { - ctx->bindBel(bel, cell->name, STRENGTH_WEAK); - return true; - } - } - return false; - } - Context *ctx; std::unordered_set rippedCells; std::unordered_set createdCells; -- cgit v1.2.3