place_common: Debugging bad relative constraint legalisation
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
8c518cb838
commit
8081249b92
@ -194,7 +194,7 @@ class ConstraintLegaliseWorker
|
|||||||
++diameter;
|
++diameter;
|
||||||
} else {
|
} else {
|
||||||
sign = -1;
|
sign = -1;
|
||||||
if ((start + sign * diameter) > max) {
|
if ((start + sign * diameter) < min) {
|
||||||
sign = 1;
|
sign = 1;
|
||||||
++diameter;
|
++diameter;
|
||||||
}
|
}
|
||||||
@ -257,6 +257,7 @@ class ConstraintLegaliseWorker
|
|||||||
cloc.x = xSearch.get();
|
cloc.x = xSearch.get();
|
||||||
cloc.y = ySearch.get();
|
cloc.y = ySearch.get();
|
||||||
cloc.z = zSearch.get();
|
cloc.z = zSearch.get();
|
||||||
|
log_info(" checking '%s' at (%d, %d, %d)\n", child->name.c_str(ctx), cloc.x, cloc.y, cloc.z);
|
||||||
|
|
||||||
zSearch.next();
|
zSearch.next();
|
||||||
if (zSearch.done()) {
|
if (zSearch.done()) {
|
||||||
@ -304,6 +305,8 @@ class ConstraintLegaliseWorker
|
|||||||
Loc currentLoc;
|
Loc currentLoc;
|
||||||
if (cell->bel != BelId())
|
if (cell->bel != BelId())
|
||||||
currentLoc = ctx->getBelLocation(cell->bel);
|
currentLoc = ctx->getBelLocation(cell->bel);
|
||||||
|
else
|
||||||
|
currentLoc = oldLocations[cell->name];
|
||||||
if (cell->constr_x == cell->UNCONSTR)
|
if (cell->constr_x == cell->UNCONSTR)
|
||||||
xRootSearch = IncreasingDiameterSearch(currentLoc.x, 0, ctx->getGridDimX() - 1);
|
xRootSearch = IncreasingDiameterSearch(currentLoc.x, 0, ctx->getGridDimX() - 1);
|
||||||
else
|
else
|
||||||
@ -320,9 +323,12 @@ class ConstraintLegaliseWorker
|
|||||||
zRootSearch = IncreasingDiameterSearch(cell->constr_z);
|
zRootSearch = IncreasingDiameterSearch(cell->constr_z);
|
||||||
while (!xRootSearch.done()) {
|
while (!xRootSearch.done()) {
|
||||||
Loc rootLoc;
|
Loc rootLoc;
|
||||||
|
|
||||||
rootLoc.x = xRootSearch.get();
|
rootLoc.x = xRootSearch.get();
|
||||||
rootLoc.y = yRootSearch.get();
|
rootLoc.y = yRootSearch.get();
|
||||||
rootLoc.z = zRootSearch.get();
|
rootLoc.z = zRootSearch.get();
|
||||||
|
if (ctx->verbose)
|
||||||
|
log_info(" trying (%d, %d, %d)\n", rootLoc.x, rootLoc.y, rootLoc.z);
|
||||||
zRootSearch.next();
|
zRootSearch.next();
|
||||||
if (zRootSearch.done()) {
|
if (zRootSearch.done()) {
|
||||||
zRootSearch.reset();
|
zRootSearch.reset();
|
||||||
@ -374,6 +380,28 @@ class ConstraintLegaliseWorker
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ConstraintLegaliseWorker(Context *ctx) : ctx(ctx) {};
|
ConstraintLegaliseWorker(Context *ctx) : ctx(ctx) {};
|
||||||
|
|
||||||
|
void print_chain(CellInfo *cell, int depth = 0) {
|
||||||
|
for (int i = 0; i < depth; i++)
|
||||||
|
log(" ");
|
||||||
|
log("'%s' (", cell->name.c_str(ctx));
|
||||||
|
if (cell->constr_x != cell->UNCONSTR)
|
||||||
|
log("%d, ", cell->constr_x);
|
||||||
|
else
|
||||||
|
log("*, ");
|
||||||
|
if (cell->constr_y != cell->UNCONSTR)
|
||||||
|
log("%d, ", cell->constr_y);
|
||||||
|
else
|
||||||
|
log("*, ");
|
||||||
|
if (cell->constr_z != cell->UNCONSTR)
|
||||||
|
log("%d", cell->constr_z);
|
||||||
|
else
|
||||||
|
log("*");
|
||||||
|
log(")\n");
|
||||||
|
for (auto child : cell->constr_children)
|
||||||
|
print_chain(child, depth+1);
|
||||||
|
}
|
||||||
|
|
||||||
bool legalise_constraints() {
|
bool legalise_constraints() {
|
||||||
log_info("Legalising relative constraints...\n");
|
log_info("Legalising relative constraints...\n");
|
||||||
for (auto cell : sorted(ctx->cells)) {
|
for (auto cell : sorted(ctx->cells)) {
|
||||||
@ -382,6 +410,8 @@ public:
|
|||||||
for (auto cell : sorted(ctx->cells)) {
|
for (auto cell : sorted(ctx->cells)) {
|
||||||
bool res = legalise_cell(cell.second);
|
bool res = legalise_cell(cell.second);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
if(ctx->verbose)
|
||||||
|
print_chain(cell.second);
|
||||||
log_error("failed to place chain starting at cell '%s'\n", cell.first.c_str(ctx));
|
log_error("failed to place chain starting at cell '%s'\n", cell.first.c_str(ctx));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user