diff options
author | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-20 18:34:59 +0100 |
---|---|---|
committer | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-20 18:34:59 +0100 |
commit | 0311a27a53922783363ab607ca8f3832980990c6 (patch) | |
tree | 9cb3555b233b6224d946a263dceb1ebff6569d80 /common/router1.cc | |
parent | 5d0dbe9db961f6dbd2494bd8ab730d8926d01626 (diff) | |
download | nextpnr-0311a27a53922783363ab607ca8f3832980990c6.tar.gz nextpnr-0311a27a53922783363ab607ca8f3832980990c6.tar.bz2 nextpnr-0311a27a53922783363ab607ca8f3832980990c6.zip |
Use UI lock for yielding
Diffstat (limited to 'common/router1.cc')
-rw-r--r-- | common/router1.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/router1.cc b/common/router1.cc index 3a0aa19b..3e4416df 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -495,8 +495,6 @@ bool router1(Context *ctx) #endif return false; } - ctx->yield(); - ctx->lock(); iterCnt++; if (ctx->verbose) @@ -533,9 +531,11 @@ bool router1(Context *ctx) ripupQueue.insert(net_name); } - if ((ctx->verbose || iterCnt == 1) && !printNets && (netCnt % 100 == 0)) + if ((ctx->verbose || iterCnt == 1) && !printNets && (netCnt % 100 == 0)) { log_info(" processed %d nets. (%d routed, %d failed)\n", netCnt, netCnt - int(ripupQueue.size()), int(ripupQueue.size())); + ctx->yield(); + } } int normalRouteCnt = netCnt - int(ripupQueue.size()); @@ -596,8 +596,10 @@ bool router1(Context *ctx) ripCnt += router.rippedNets.size(); - if ((ctx->verbose || iterCnt == 1) && !printNets && (netCnt % 100 == 0)) + if ((ctx->verbose || iterCnt == 1) && !printNets && (netCnt % 100 == 0)) { log_info(" routed %d nets, ripped %d nets.\n", netCnt, ripCnt); + ctx->yield(); + } } if ((ctx->verbose || iterCnt == 1) && (netCnt % 100 != 0)) @@ -626,7 +628,7 @@ bool router1(Context *ctx) if (iterCnt == 8 || iterCnt == 16 || iterCnt == 32 || iterCnt == 64 || iterCnt == 128) ripup_penalty += ctx->getRipupDelayPenalty(); - ctx->unlock(); + ctx->yield(); } log_info("routing complete after %d iterations.\n", iterCnt); |