Adding constraint satisfaction checks for debugging
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
fd2174149c
commit
dc4ab55b27
@ -281,7 +281,7 @@ struct CellInfo : ArchCellInfo
|
||||
std::unordered_map<IdString, IdString> pins;
|
||||
|
||||
// placement constraints
|
||||
CellInfo *constr_parent;
|
||||
CellInfo *constr_parent = nullptr;
|
||||
std::vector<CellInfo *> constr_children;
|
||||
const int UNCONSTR = INT_MIN;
|
||||
int constr_x = UNCONSTR; // this.x - parent.x
|
||||
|
@ -438,13 +438,17 @@ class ConstraintLegaliseWorker
|
||||
}
|
||||
}
|
||||
for (auto rippedCell : rippedCells) {
|
||||
bool res = place_single_cell(ctx, rippedCell, STRENGTH_WEAK);
|
||||
bool res = place_single_cell(ctx, rippedCell, true);
|
||||
if (!res) {
|
||||
log_error("failed to place cell '%s' after relative constraint legalisation\n",
|
||||
rippedCell->name.c_str(ctx));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (auto cell : sorted(ctx->cells))
|
||||
if (get_constraints_distance(ctx, cell.second) != 0)
|
||||
log_error("constraint satisfaction check failed for cell '%s' at Bel '%s'\n", cell.first.c_str(ctx),
|
||||
ctx->getBelName(cell.second->bel).c_str(ctx));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "place_common.h"
|
||||
#include "timing.h"
|
||||
#include "util.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class SAPlacer
|
||||
@ -272,6 +273,10 @@ class SAPlacer
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto cell : sorted(ctx->cells))
|
||||
if (get_constraints_distance(ctx, cell.second) != 0)
|
||||
log_error("constraint satisfaction check failed for cell '%s' at Bel '%s'\n", cell.first.c_str(ctx),
|
||||
ctx->getBelName(cell.second->bel).c_str(ctx));
|
||||
timing_analysis(ctx, true /* print_fmax */);
|
||||
ctx->unlock();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user