aboutsummaryrefslogtreecommitdiffstats
path: root/common/router1.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-23 18:58:57 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-23 18:58:57 -0700
commitee2e6ed1c6c6f7fe13f7d20a2310626f445d8612 (patch)
tree0949c8c445cf72732d42b5beb55ca213a158ffc4 /common/router1.cc
parent9149012fd1555e4e47d65988612be8da514ec0fb (diff)
downloadnextpnr-ee2e6ed1c6c6f7fe13f7d20a2310626f445d8612.tar.gz
nextpnr-ee2e6ed1c6c6f7fe13f7d20a2310626f445d8612.tar.bz2
nextpnr-ee2e6ed1c6c6f7fe13f7d20a2310626f445d8612.zip
Simplify and use Arch::getNetinfoRouteDelay() for update_budget()
Diffstat (limited to 'common/router1.cc')
-rw-r--r--common/router1.cc36
1 files changed, 4 insertions, 32 deletions
diff --git a/common/router1.cc b/common/router1.cc
index 431770da..f4f0d75b 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -613,38 +613,10 @@ bool router1(Context *ctx)
std::unordered_set<IdString> normalRouteNets, ripupQueue;
- 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 = 0;
- WireId last = dst;
- auto net_name = ctx->getBoundWireNet(src);
- if (net_name != IdString()) {
- auto net = ctx->nets.at(net_name).get();
- while (last != src) {
- total_delay += ctx->getWireDelay(last).maxDelay();
- auto pip = net->wires.at(last).pip;
- NPNR_ASSERT(ctx->getBoundPipNet(pip) == net_name);
- total_delay += ctx->getPipDelay(pip).maxDelay();
- last = ctx->getPipSrcWire(pip);
- if (ctx->getBoundWireNet(last) != net_name) {
- log_warning("Wire %s bound to %s not %s!\n", ctx->getWireName(last).c_str(ctx), ctx->getBoundWireNet(last).c_str(ctx), net_name.c_str(ctx));
- break;
- }
- NPNR_ASSERT(ctx->getBoundWireNet(last) == net_name);
- }
- NPNR_ASSERT(last != WireId());
- }
- if (last != src)
- total_delay += ctx->estimateDelay(src, last);
- else
- total_delay += ctx->getWireDelay(last).maxDelay();
- return total_delay;
- };
- update_budget(ctx, actual_delay);
- }
+ if (iterCnt == 1 && ctx->verbose)
+ log_info("routing queue contains %d jobs.\n", int(jobQueue.size()));
+
+ update_budget(ctx);
bool printNets = ctx->verbose && (jobQueue.size() < 10);