aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-20 17:08:57 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-20 17:08:57 +0200
commit4fc962504028f581cc1db9ada5770900d8dacae2 (patch)
tree3959a054a677dbf24ff8e573b3b5d6475e1fd217 /common
parent15c5c9c42549f61679a6a145d41f0d84208d457d (diff)
downloadnextpnr-4fc962504028f581cc1db9ada5770900d8dacae2.tar.gz
nextpnr-4fc962504028f581cc1db9ada5770900d8dacae2.tar.bz2
nextpnr-4fc962504028f581cc1db9ada5770900d8dacae2.zip
WIP: adding timing budget to placer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/place_sa.cc9
-rw-r--r--common/timing.cc7
2 files changed, 12 insertions, 4 deletions
diff --git a/common/place_sa.cc b/common/place_sa.cc
index 0a60adc8..485ddc88 100644
--- a/common/place_sa.cc
+++ b/common/place_sa.cc
@@ -314,7 +314,9 @@ class SAPlacer
load_cell->bel, ctx->portPinFromId(load.port));
// wirelength += std::abs(load_x - driver_x) + std::abs(load_y -
// driver_y);
- wirelength += ctx->estimateDelay(drv_wire, user_wire);
+ delay_t raw_wl = ctx->estimateDelay(drv_wire, user_wire);
+ wirelength += 100 * (ctx->getDelayNS(raw_wl) / ctx->getDelayNS(load.budget));
+ // wirelength += pow(ctx->estimateDelay(drv_wire, user_wire), 2.0);
}
return wirelength;
}
@@ -376,9 +378,8 @@ class SAPlacer
delta = new_wirelength - curr_wirelength;
n_move++;
// SA acceptance criterea
- if (delta < 0 ||
- (temp > 1e-6 &&
- (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
+ if (delta < 0 || (temp > 1e-6 && (ctx->rng() / float(0x3fffffff)) <=
+ std::exp(-delta / temp))) {
n_accept++;
if (delta < 0)
improved = true;
diff --git a/common/timing.cc b/common/timing.cc
index a4bda3bb..8da26077 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -101,6 +101,8 @@ void assign_budget(Context *ctx, float default_clock)
}
}
}
+ const bool debug = true;
+
// Post-allocation check
for (auto net : ctx->nets) {
for (auto user : net.second->users) {
@@ -109,6 +111,11 @@ void assign_budget(Context *ctx, float default_clock)
"timing budget of %fns\n",
user.cell->name.c_str(ctx), user.port.c_str(ctx),
net.first.c_str(ctx), ctx->getDelayNS(user.budget));
+ if (debug)
+ log_warning("port %s.%s, connected to net '%s', has "
+ "timing budget of %fns\n",
+ user.cell->name.c_str(ctx), user.port.c_str(ctx),
+ net.first.c_str(ctx), ctx->getDelayNS(user.budget));
}
}
}