aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-08-12 12:32:31 +0100
committerGitHub <noreply@github.com>2020-08-12 12:32:31 +0100
commitb299c649730a21f6fb12c86b4eb29da55046593d (patch)
treea0f51b1355166f0405b0465351fb7c00b95e7a4e
parentfbe486df459909065d6852a7495a212dfd2accef (diff)
parente475490992c6890b2f8ddb0d4368e3911e94bb73 (diff)
downloadnextpnr-b299c649730a21f6fb12c86b4eb29da55046593d.tar.gz
nextpnr-b299c649730a21f6fb12c86b4eb29da55046593d.tar.bz2
nextpnr-b299c649730a21f6fb12c86b4eb29da55046593d.zip
Merge pull request #487 from YosysHQ/dave/hierfix
Hierarchical floorplanning fixes
-rw-r--r--common/nextpnr.cc8
-rw-r--r--ecp5/pack.cc1
2 files changed, 8 insertions, 1 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index f6d873f0..c44cec02 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -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)
{
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index 501f55b6..78a7ce91 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -2956,6 +2956,7 @@ class Ecp5Packer
pack_remaining_ffs();
generate_constraints();
promote_ecp5_globals(ctx);
+ ctx->fixupHierarchy();
ctx->check();
}