Use scope in router1/2 and placer1.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
parent
77a5a60a66
commit
99a2262d61
@ -42,6 +42,7 @@
|
|||||||
#include "fast_bels.h"
|
#include "fast_bels.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "place_common.h"
|
#include "place_common.h"
|
||||||
|
#include "scope_lock.h"
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -142,7 +143,8 @@ class SAPlacer
|
|||||||
bool place(bool refine = false)
|
bool place(bool refine = false)
|
||||||
{
|
{
|
||||||
log_break();
|
log_break();
|
||||||
ctx->lock();
|
|
||||||
|
nextpnr::ScopeLock<Context> lock(ctx);
|
||||||
|
|
||||||
size_t placed_cells = 0;
|
size_t placed_cells = 0;
|
||||||
std::vector<CellInfo *> autoplaced;
|
std::vector<CellInfo *> autoplaced;
|
||||||
@ -421,7 +423,7 @@ class SAPlacer
|
|||||||
log_error("constraint satisfaction check failed for cell '%s' at Bel '%s'\n", cell.first.c_str(ctx),
|
log_error("constraint satisfaction check failed for cell '%s' at Bel '%s'\n", cell.first.c_str(ctx),
|
||||||
ctx->nameOfBel(cell.second->bel));
|
ctx->nameOfBel(cell.second->bel));
|
||||||
timing_analysis(ctx);
|
timing_analysis(ctx);
|
||||||
ctx->unlock();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1251,9 +1253,10 @@ bool placer1(Context *ctx, Placer1Cfg cfg)
|
|||||||
return true;
|
return true;
|
||||||
} catch (log_execution_error_exception) {
|
} catch (log_execution_error_exception) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
ctx->lock();
|
||||||
ctx->check();
|
ctx->check();
|
||||||
#endif
|
|
||||||
ctx->unlock();
|
ctx->unlock();
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1272,9 +1275,10 @@ bool placer1_refine(Context *ctx, Placer1Cfg cfg)
|
|||||||
return true;
|
return true;
|
||||||
} catch (log_execution_error_exception) {
|
} catch (log_execution_error_exception) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
ctx->lock();
|
||||||
ctx->check();
|
ctx->check();
|
||||||
#endif
|
|
||||||
ctx->unlock();
|
ctx->unlock();
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,8 +331,6 @@ class HeAPPlacer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock.unlock_early();
|
|
||||||
|
|
||||||
auto endtt = std::chrono::high_resolution_clock::now();
|
auto endtt = std::chrono::high_resolution_clock::now();
|
||||||
log_info("HeAP Placer Time: %.02fs\n", std::chrono::duration<double>(endtt - startt).count());
|
log_info("HeAP Placer Time: %.02fs\n", std::chrono::duration<double>(endtt - startt).count());
|
||||||
log_info(" of which solving equations: %.02fs\n", solve_time);
|
log_info(" of which solving equations: %.02fs\n", solve_time);
|
||||||
@ -340,6 +338,7 @@ class HeAPPlacer
|
|||||||
log_info(" of which strict legalisation: %.02fs\n", sl_time);
|
log_info(" of which strict legalisation: %.02fs\n", sl_time);
|
||||||
|
|
||||||
ctx->check();
|
ctx->check();
|
||||||
|
lock.unlock_early();
|
||||||
|
|
||||||
if (!placer1_refine(ctx, Placer1Cfg(ctx))) {
|
if (!placer1_refine(ctx, Placer1Cfg(ctx))) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
|
#include "scope_lock.h"
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -805,7 +806,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
|
|||||||
try {
|
try {
|
||||||
log_break();
|
log_break();
|
||||||
log_info("Routing..\n");
|
log_info("Routing..\n");
|
||||||
ctx->lock();
|
nextpnr::ScopeLock<Context> lock(ctx);
|
||||||
auto rstart = std::chrono::high_resolution_clock::now();
|
auto rstart = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
log_info("Setting up routing queue.\n");
|
log_info("Setting up routing queue.\n");
|
||||||
@ -854,7 +855,6 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
|
|||||||
router.check();
|
router.check();
|
||||||
ctx->check();
|
ctx->check();
|
||||||
#endif
|
#endif
|
||||||
ctx->unlock();
|
|
||||||
return false;
|
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 */,
|
timing_analysis(ctx, true /* slack_histogram */, true /* print_fmax */, true /* print_path */,
|
||||||
true /* warn_on_failure */);
|
true /* warn_on_failure */);
|
||||||
|
|
||||||
ctx->unlock();
|
|
||||||
return true;
|
return true;
|
||||||
} catch (log_execution_error_exception) {
|
} catch (log_execution_error_exception) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
ctx->lock();
|
||||||
ctx->check();
|
ctx->check();
|
||||||
#endif
|
|
||||||
ctx->unlock();
|
ctx->unlock();
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
|
#include "scope_lock.h"
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -1161,6 +1162,8 @@ struct Router2
|
|||||||
ThreadContext st;
|
ThreadContext st;
|
||||||
int iter = 1;
|
int iter = 1;
|
||||||
|
|
||||||
|
nextpnr::ScopeLock<Context> lock(ctx);
|
||||||
|
|
||||||
for (size_t i = 0; i < nets_by_udata.size(); i++)
|
for (size_t i = 0; i < nets_by_udata.size(); i++)
|
||||||
route_queue.push_back(i);
|
route_queue.push_back(i);
|
||||||
|
|
||||||
@ -1237,6 +1240,8 @@ struct Router2
|
|||||||
|
|
||||||
log_info("Running router1 to check that route is legal...\n");
|
log_info("Running router1 to check that route is legal...\n");
|
||||||
|
|
||||||
|
lock.unlock_early();
|
||||||
|
|
||||||
router1(ctx, Router1Cfg(ctx));
|
router1(ctx, Router1Cfg(ctx));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user