Merge pull request #487 from YosysHQ/dave/hierfix

Hierarchical floorplanning fixes
This commit is contained in:
David Shah 2020-08-12 12:32:31 +01:00 committed by GitHub
commit b299c64973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -537,15 +537,21 @@ void BaseCtx::addBelToRegion(IdString name, BelId bel) { region[name]->bels.inse
void BaseCtx::constrainCellToRegion(IdString cell, IdString region_name)
{
// Support hierarchical cells as well as leaf ones
bool matched = false;
if (hierarchy.count(cell)) {
auto &hc = hierarchy.at(cell);
for (auto &lc : hc.leaf_cells)
constrainCellToRegion(lc.second, region_name);
for (auto &hsc : hc.hier_cells)
constrainCellToRegion(hsc.second, region_name);
matched = true;
}
if (cells.count(cell))
if (cells.count(cell)) {
cells.at(cell)->region = region[region_name].get();
matched = true;
}
if (!matched)
log_warning("No cell matched '%s' when constraining to region '%s'\n", nameOf(cell), nameOf(region_name));
}
DecalXY BaseCtx::constructDecalXY(DecalId decal, float x, float y)
{

View File

@ -2956,6 +2956,7 @@ class Ecp5Packer
pack_remaining_ffs();
generate_constraints();
promote_ecp5_globals(ctx);
ctx->fixupHierarchy();
ctx->check();
}