Merge pull request #335 from YosysHQ/dave/fix-334

ice40: Fix carry feed-out when we have to split the chain next
This commit is contained in:
David Shah 2019-09-23 16:30:58 +01:00 committed by GitHub
commit 395db49b21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,8 @@ class ChainConstrainer
auto curr_cell = carryc.cells.begin();
while (curr_cell != carryc.cells.end()) {
CellInfo *cell = *curr_cell;
if (ctx->debug)
log_info(" processing cell %s\n", ctx->nameOf(cell));
if (tile.size() >= 8) {
tile.clear();
}
@ -76,8 +78,23 @@ class ChainConstrainer
(net_only_drives(ctx, carry_net, is_lc, ctx->id("I3"), false) !=
net_only_drives(ctx, carry_net, is_lc, ctx->id("CIN"), false)) ||
(at_end && !net_only_drives(ctx, carry_net, is_lc, ctx->id("I3"), true))) {
CellInfo *passout = make_carry_pass_out(cell->ports.at(ctx->id("COUT")),
at_end ? nullptr : *(curr_cell + 1));
if (ctx->debug)
log_info(" inserting feed-%s\n", at_end ? "out" : "out-in");
CellInfo *passout;
if (!at_end) {
// See if we need to split chain anyway
tile.push_back(*(curr_cell + 1));
bool split_chain_next = (!ctx->logicCellsCompatible(tile.data(), tile.size())) ||
(int(chains.back().cells.size()) > max_length);
tile.pop_back();
if (split_chain_next)
start_of_chain = true;
passout = make_carry_pass_out(cell->ports.at(ctx->id("COUT")),
split_chain_next ? nullptr : *(curr_cell + 1));
} else {
passout = make_carry_pass_out(cell->ports.at(ctx->id("COUT")), nullptr);
}
chains.back().cells.push_back(passout);
tile.push_back(passout);
++feedio_lcs;