aboutsummaryrefslogtreecommitdiffstats
path: root/common/router1.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-21 13:59:48 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-21 13:59:48 -0700
commit5aa4cf2efbf34b89fba39495e66048a09c1d258c (patch)
tree27f609c6b8503a473bca6731d4a4e332ae239317 /common/router1.cc
parent926c186ec78efb086364a05ba7e83e68fa116301 (diff)
downloadnextpnr-5aa4cf2efbf34b89fba39495e66048a09c1d258c.tar.gz
nextpnr-5aa4cf2efbf34b89fba39495e66048a09c1d258c.tar.bz2
nextpnr-5aa4cf2efbf34b89fba39495e66048a09c1d258c.zip
Call now-more-flexibile update_budget() during routing, but using any actual delays that we have
Diffstat (limited to 'common/router1.cc')
-rw-r--r--common/router1.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/common/router1.cc b/common/router1.cc
index 86fb1a44..767e10fd 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -22,6 +22,7 @@
#include "log.h"
#include "router1.h"
+#include "timing.h"
namespace {
@@ -730,8 +731,25 @@ bool router1(Context *ctx)
std::unordered_set<IdString> normalRouteNets, ripupQueue;
- if (ctx->verbose || iterCnt == 1)
- log_info("routing queue contains %d jobs.\n", int(jobQueue.size()));
+ if (iterCnt == 1) {
+ if (ctx->verbose)
+ log_info("routing queue contains %d jobs.\n", int(jobQueue.size()));
+ } else {
+ static auto actual_delay = [](Context *ctx, WireId src, WireId dst) {
+ delay_t total_delay = ctx->getWireDelay(dst).maxDelay();
+ WireId last_wire = dst;
+ for (auto pip : ctx->getPipsDownhill(dst)) {
+ total_delay += ctx->getPipDelay(pip).maxDelay();
+ WireId next_wire = ctx->getPipDstWire(pip);
+ total_delay += ctx->getWireDelay(next_wire).maxDelay();
+ }
+ NPNR_ASSERT(last_wire != WireId());
+ if (last_wire != src)
+ total_delay += ctx->estimateDelay(src, last_wire);
+ return total_delay;
+ };
+ update_budget(ctx, actual_delay);
+ }
bool printNets = ctx->verbose && (jobQueue.size() < 10);