aboutsummaryrefslogtreecommitdiffstats
path: root/common/router1.cc
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-01 09:41:29 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-01 09:43:39 -0800
commit99a2262d61c20019b2a4ce5321df48a9d5d43864 (patch)
tree538c1bfee2f9799d8df0a1d1042579fea0dd8e24 /common/router1.cc
parent77a5a60a66b0cfc1602edb61aadf392dc651bf46 (diff)
downloadnextpnr-99a2262d61c20019b2a4ce5321df48a9d5d43864.tar.gz
nextpnr-99a2262d61c20019b2a4ce5321df48a9d5d43864.tar.bz2
nextpnr-99a2262d61c20019b2a4ce5321df48a9d5d43864.zip
Use scope in router1/2 and placer1.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'common/router1.cc')
-rw-r--r--common/router1.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/router1.cc b/common/router1.cc
index efc06b06..bffbc9f9 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -23,6 +23,7 @@
#include "log.h"
#include "router1.h"
+#include "scope_lock.h"
#include "timing.h"
namespace {
@@ -805,7 +806,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
try {
log_break();
log_info("Routing..\n");
- ctx->lock();
+ nextpnr::ScopeLock<Context> lock(ctx);
auto rstart = std::chrono::high_resolution_clock::now();
log_info("Setting up routing queue.\n");
@@ -854,7 +855,6 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
router.check();
ctx->check();
#endif
- ctx->unlock();
return false;
}
}
@@ -878,13 +878,13 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
timing_analysis(ctx, true /* slack_histogram */, true /* print_fmax */, true /* print_path */,
true /* warn_on_failure */);
- ctx->unlock();
return true;
} catch (log_execution_error_exception) {
#ifndef NDEBUG
+ ctx->lock();
ctx->check();
-#endif
ctx->unlock();
+#endif
return false;
}
}