diff options
author | David Shah <davey1576@gmail.com> | 2018-07-30 16:18:49 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-30 16:18:49 +0200 |
commit | 267970c01e02cc197c0d488cc455161402929b34 (patch) | |
tree | 172aa956323fd2e03f9c9ca8c72c88c5333047d2 | |
parent | edc6cf8b23d973aa45a8c22516e7222eb6001391 (diff) | |
download | nextpnr-267970c01e02cc197c0d488cc455161402929b34.tar.gz nextpnr-267970c01e02cc197c0d488cc455161402929b34.tar.bz2 nextpnr-267970c01e02cc197c0d488cc455161402929b34.zip |
ice40: Improving legalisation move statistics
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r-- | ice40/place_legaliser.cc | 7 |
1 files changed, 5 insertions, 2 deletions
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); |