1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-04-25 20:01:22 +00:00

Reworking packer and placer to use new generic rel legaliser

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah
2018-08-03 15:00:32 +02:00
parent e5dea28dbd
commit 7e9209878c
4 changed files with 18 additions and 10 deletions

View File

@@ -189,9 +189,15 @@ class ConstraintLegaliseWorker
diameter = 1;
} else if (sign == -1) {
sign = 1;
if ((start + sign * diameter) > max)
sign = -1;
++diameter;
} else {
sign = -1;
if ((start + sign * diameter) > max) {
sign = 1;
++diameter;
}
}
}

View File

@@ -224,7 +224,7 @@ class SAPlacer
// Once cooled below legalise threshold, run legalisation and start requiring
// legal moves only
if (temp < legalise_temp && !require_legal) {
// legalise_design(ctx);
legalise_relative_constraints(ctx);
// FIXME
require_legal = true;
autoplaced.clear();
@@ -294,7 +294,7 @@ class SAPlacer
}
BelType targetType = ctx->belTypeFromId(cell->type);
for (auto bel : ctx->getBels()) {
if (ctx->getBelType(bel) == targetType && (ctx->isValidBelForCell(cell, bel) || !require_legal)) {
if (ctx->getBelType(bel) == targetType && ctx->isValidBelForCell(cell, bel)) {
if (ctx->checkBelAvail(bel)) {
uint64_t score = ctx->rng64();
if (score <= best_score) {
@@ -364,15 +364,14 @@ class SAPlacer
if (other != IdString()) {
ctx->bindBel(oldBel, other_cell->name, STRENGTH_WEAK);
}
if (require_legal) {
if (!ctx->isBelLocationValid(newBel) || ((other != IdString() && !ctx->isBelLocationValid(oldBel)))) {
ctx->unbindBel(newBel);
if (other != IdString())
ctx->unbindBel(oldBel);
goto swap_fail;
}
if (!ctx->isBelLocationValid(newBel) || ((other != IdString() && !ctx->isBelLocationValid(oldBel)))) {
ctx->unbindBel(newBel);
if (other != IdString())
ctx->unbindBel(oldBel);
goto swap_fail;
}
new_metric = curr_metric;
// Recalculate metrics for all nets touched by the peturbation