From 267970c01e02cc197c0d488cc455161402929b34 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 30 Jul 2018 16:18:49 +0200 Subject: ice40: Improving legalisation move statistics Signed-off-by: David Shah --- ice40/place_legaliser.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ice40') diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc index ba09e250..0d14fb35 100644 --- a/ice40/place_legaliser.cc +++ b/ice40/place_legaliser.cc @@ -119,9 +119,12 @@ class PlacementLegaliser float distance_sum = 0; float max_distance = 0; int moved_cells = 0; + int unplaced_cells = 0; for (auto orig : originalPositions) { - if (ctx->cells.at(orig.first)->bel == BelId()) + if (ctx->cells.at(orig.first)->bel == BelId()) { + unplaced_cells++; continue; + } Loc newLoc = ctx->getBelLocation(ctx->cells.at(orig.first)->bel); if (newLoc != orig.second) { float distance = std::sqrt(std::pow(newLoc.x - orig.second.x, 2) + pow(newLoc.y - orig.second.y, 2)); @@ -131,7 +134,7 @@ class PlacementLegaliser max_distance = distance; } } - log_info(" moved %d cells (after %s)\n", moved_cells, point); + log_info(" moved %d cells, %d unplaced (after %s)\n", moved_cells, unplaced_cells, point); if (moved_cells > 0) { log_info(" average distance %f\n", (distance_sum / moved_cells)); log_info(" maximum distance %f\n", max_distance); -- cgit v1.2.3