From e313d051a87f28778c80ea79b14956351360bb0c Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 12 Aug 2020 10:11:52 +0100 Subject: [PATCH 1/2] Add a warning when floorplan constraint doesn't match Signed-off-by: David Shah --- common/nextpnr.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { From e475490992c6890b2f8ddb0d4368e3911e94bb73 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 12 Aug 2020 10:12:10 +0100 Subject: [PATCH 2/2] ecp5: Run fixupHierarchy after packing Signed-off-by: David Shah --- ecp5/pack.cc | 1 + 1 file changed, 1 insertion(+) 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(); }