diff options
author | gatecat <gatecat@ds0.me> | 2021-03-02 08:27:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 08:27:12 +0000 |
commit | 27fbee523301be074abd06a3568dc9591d98e0fa (patch) | |
tree | 3ec0f59c35cb1107adc3a2f5043e19e4ffde3adc /common/router1.cc | |
parent | 6ff02248a3f625829c9bd041c369247ee926d8d0 (diff) | |
parent | 392156c25095aa93fdf847ef51dfa571b5d2ce88 (diff) | |
download | nextpnr-27fbee523301be074abd06a3568dc9591d98e0fa.tar.gz nextpnr-27fbee523301be074abd06a3568dc9591d98e0fa.tar.bz2 nextpnr-27fbee523301be074abd06a3568dc9591d98e0fa.zip |
Merge pull request #605 from litghost/add_placement_sanity_check
Add placement sanity check in placer_heap.
Diffstat (limited to 'common/router1.cc')
-rw-r--r-- | common/router1.cc | 8 |
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; } } |