Tidying up the SA placer
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
23789b7569
commit
d908928b56
@ -46,7 +46,7 @@ NEXTPNR_NAMESPACE_BEGIN
|
|||||||
class SAPlacer
|
class SAPlacer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SAPlacer(Context *ctx, bool timing_driven) : ctx(ctx), timing_driven(timing_driven)
|
SAPlacer(Context *ctx) : ctx(ctx)
|
||||||
{
|
{
|
||||||
int num_bel_types = 0;
|
int num_bel_types = 0;
|
||||||
for (auto bel : ctx->getBels()) {
|
for (auto bel : ctx->getBels()) {
|
||||||
@ -416,7 +416,6 @@ class SAPlacer
|
|||||||
float curr_tns = 0;
|
float curr_tns = 0;
|
||||||
float temp = 1000;
|
float temp = 1000;
|
||||||
bool improved = false;
|
bool improved = false;
|
||||||
bool timing_driven = true;
|
|
||||||
int n_move, n_accept;
|
int n_move, n_accept;
|
||||||
int diameter = 35, max_x = 1, max_y = 1;
|
int diameter = 35, max_x = 1, max_y = 1;
|
||||||
std::unordered_map<BelType, int> bel_types;
|
std::unordered_map<BelType, int> bel_types;
|
||||||
@ -428,10 +427,10 @@ class SAPlacer
|
|||||||
const float post_legalise_dia_scale = 2;
|
const float post_legalise_dia_scale = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool place_design_sa(Context *ctx, bool timing_driven)
|
bool place_design_sa(Context *ctx)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
SAPlacer placer(ctx, timing_driven);
|
SAPlacer placer(ctx);
|
||||||
placer.place();
|
placer.place();
|
||||||
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
extern bool place_design_sa(Context *ctx, bool timing_driven = true);
|
extern bool place_design_sa(Context *ctx);
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
|
@ -122,7 +122,8 @@ void Worker::place(bool timing_driven)
|
|||||||
{
|
{
|
||||||
Q_EMIT taskStarted();
|
Q_EMIT taskStarted();
|
||||||
try {
|
try {
|
||||||
Q_EMIT place_finished(place_design_sa(ctx, timing_driven));
|
ctx->timing_driven = timing_driven;
|
||||||
|
Q_EMIT place_finished(place_design_sa(ctx));
|
||||||
} catch (WorkerInterruptionRequested) {
|
} catch (WorkerInterruptionRequested) {
|
||||||
Q_EMIT taskCanceled();
|
Q_EMIT taskCanceled();
|
||||||
}
|
}
|
||||||
|
@ -366,11 +366,11 @@ int main(int argc, char *argv[])
|
|||||||
assign_budget(&ctx, freq);
|
assign_budget(&ctx, freq);
|
||||||
ctx.check();
|
ctx.check();
|
||||||
print_utilisation(&ctx);
|
print_utilisation(&ctx);
|
||||||
bool timing_driven = true;
|
ctx.timing_driven = true;
|
||||||
if (vm.count("no-tmdriv"))
|
if (vm.count("no-tmdriv"))
|
||||||
timing_driven = false;
|
ctx.timing_driven = false;
|
||||||
if (!vm.count("pack-only")) {
|
if (!vm.count("pack-only")) {
|
||||||
if (!place_design_sa(&ctx, timing_driven) && !ctx.force)
|
if (!place_design_sa(&ctx) && !ctx.force)
|
||||||
log_error("Placing design failed.\n");
|
log_error("Placing design failed.\n");
|
||||||
ctx.check();
|
ctx.check();
|
||||||
if (!route_design(&ctx) && !ctx.force)
|
if (!route_design(&ctx) && !ctx.force)
|
||||||
|
Loading…
Reference in New Issue
Block a user