aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-30 16:18:49 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-30 16:18:49 +0200
commit267970c01e02cc197c0d488cc455161402929b34 (patch)
tree172aa956323fd2e03f9c9ca8c72c88c5333047d2 /ice40
parentedc6cf8b23d973aa45a8c22516e7222eb6001391 (diff)
downloadnextpnr-267970c01e02cc197c0d488cc455161402929b34.tar.gz
nextpnr-267970c01e02cc197c0d488cc455161402929b34.tar.bz2
nextpnr-267970c01e02cc197c0d488cc455161402929b34.zip
ice40: Improving legalisation move statistics
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/place_legaliser.cc7
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);