aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/place_legaliser.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-28 16:31:52 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-28 16:31:52 +0200
commit66670831b89d934ef00c47c0527137f6ec38a0b0 (patch)
tree9f57e33c932c9264612c0746f3e9feb7dbf707c4 /ice40/place_legaliser.cc
parent27a9850921c73f7d6605fd70b868ee8f1769fd13 (diff)
downloadnextpnr-66670831b89d934ef00c47c0527137f6ec38a0b0.tar.gz
nextpnr-66670831b89d934ef00c47c0527137f6ec38a0b0.tar.bz2
nextpnr-66670831b89d934ef00c47c0527137f6ec38a0b0.zip
ice40: PLace legaliser produces a design that is at least routable for picosoc
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/place_legaliser.cc')
-rw-r--r--ice40/place_legaliser.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc
index 1292d094..91350c2b 100644
--- a/ice40/place_legaliser.cc
+++ b/ice40/place_legaliser.cc
@@ -155,6 +155,22 @@ class PlacementLegaliser
return i3_next;*/
return (CellInfo *)nullptr;
});
+ std::unordered_set<IdString> chained;
+ for (auto &base_chain : carry_chains) {
+ for (auto c : base_chain.cells)
+ chained.insert(c->name);
+ }
+ // Any cells not in chains, but with carry enabled, must also be put in a single-carry chain
+ // for correct processing
+ for (auto cell : sorted(ctx->cells)) {
+ CellInfo *ci = cell.second;
+ if (chained.find(cell.first) == chained.end() && is_lc(ctx, ci) && bool_or_default(ci->params, ctx->id("CARRY_ENABLE"))) {
+ CellChain sChain;
+ sChain.cells.push_back(ci);
+ chained.insert(cell.first);
+ carry_chains.push_back(sChain);
+ }
+ }
bool success = true;
// Find midpoints for all chains, before we start tearing them up
std::vector<CellChain> all_chains;
@@ -274,6 +290,7 @@ class PlacementLegaliser
CellInfo *passout = make_carry_pass_out(cell->ports.at(ctx->id("COUT")));
chains.back().cells.push_back(passout);
tile.push_back(passout);
+ start_of_chain = true;
}
}
++curr_cell;