diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/place_sa.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/place_sa.cc b/common/place_sa.cc index 7325c557..4a2fc86e 100644 --- a/common/place_sa.cc +++ b/common/place_sa.cc @@ -30,7 +30,6 @@ #include <map> #include <ostream> #include <queue> -#include <random> #include <set> #include <stdarg.h> #include <stdio.h> @@ -213,6 +212,15 @@ class SAPlacer temp *= 0.8; } } + + // Recalculate total wirelength entirely to avoid rounding errors + // accumulating over time + curr_wirelength = 0; + for (auto net : ctx->nets) { + float wl = get_wirelength(net.second); + wirelengths[net.first] = wl; + curr_wirelength += wl; + } } // Final post-pacement validitiy check for (auto bel : ctx->getBels()) { |