interchange: Fix illegal placements

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-03-30 14:44:18 +01:00
parent 99298d0aba
commit 8863b962fd
2 changed files with 8 additions and 7 deletions

View File

@ -552,7 +552,9 @@ class SAPlacer
add_move_cell(moveChange, other_cell, newBel);
}
if (!ctx->isBelLocationValid(newBel) || ((other_cell != nullptr && !ctx->isBelLocationValid(oldBel)))) {
// Always check both the new and old locations; as in some cases of dedicated routing ripping up a cell can deny
// use of a dedicated path and thus make a site illegal
if (!ctx->isBelLocationValid(newBel) || !ctx->isBelLocationValid(oldBel)) {
ctx->unbindBel(newBel);
if (other_cell != nullptr)
ctx->unbindBel(oldBel);

View File

@ -808,9 +808,7 @@ struct Arch : ArchAPI<ArchRanges>
}
const TileStatus &tile_status = iter->second;
const CellInfo *cell = tile_status.boundcells[bel.index];
if (cell == nullptr) {
return true;
} else {
if (cell != nullptr) {
if (!dedicated_interconnect.isBelLocationValid(bel, cell)) {
return false;
}
@ -825,10 +823,11 @@ struct Arch : ArchAPI<ArchRanges>
if (!is_cell_valid_constraints(cell, tile_status, explain_constraints)) {
return false;
}
auto &bel_data = bel_info(chip_info, bel);
return get_site_status(tile_status, bel_data).checkSiteRouting(getCtx(), tile_status);
}
// Still check site status if cell is nullptr; as other bels in the site could be illegal (for example when
// dedicated paths can no longer be used after ripping up a cell)
auto &bel_data = bel_info(chip_info, bel);
return get_site_status(tile_status, bel_data).checkSiteRouting(getCtx(), tile_status);
}
IdString get_bel_tiletype(BelId bel) const { return IdString(loc_info(chip_info, bel).name); }