ice40: Fix carry packing in some degenerate cases

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-06-29 15:10:29 +02:00
parent 1aa4be770c
commit 3b90f3698f

View File

@ -188,7 +188,6 @@ static void pack_carries(Context *ctx)
if (carry_ci_lc && carry_lcs.find(carry_ci_lc->name) != carry_lcs.end()) {
carry_lc = carry_ci_lc;
} else {
if (carry_lcs.empty()) {
// No LC to pack into matching I0/I1, insert a new one
std::unique_ptr<CellInfo> created_lc =
create_ice_cell(ctx, ctx->id("ICESTORM_LC"), cell.first.str(ctx) + "$CARRY");
@ -208,10 +207,6 @@ static void pack_carries(Context *ctx)
i1_net->users.push_back(pr);
}
new_cells.push_back(std::move(created_lc));
} else {
carry_lc = ctx->cells.at(*(carry_lcs.begin())).get();
}
}
carry_lc->params[ctx->id("CARRY_ENABLE")] = "1";
replace_port(ci, ctx->id("CI"), carry_lc, ctx->id("CIN"));