ice40: Fix carry packing in some degenerate cases
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
1aa4be770c
commit
3b90f3698f
@ -188,7 +188,6 @@ static void pack_carries(Context *ctx)
|
|||||||
if (carry_ci_lc && carry_lcs.find(carry_ci_lc->name) != carry_lcs.end()) {
|
if (carry_ci_lc && carry_lcs.find(carry_ci_lc->name) != carry_lcs.end()) {
|
||||||
carry_lc = carry_ci_lc;
|
carry_lc = carry_ci_lc;
|
||||||
} else {
|
} else {
|
||||||
if (carry_lcs.empty()) {
|
|
||||||
// No LC to pack into matching I0/I1, insert a new one
|
// No LC to pack into matching I0/I1, insert a new one
|
||||||
std::unique_ptr<CellInfo> created_lc =
|
std::unique_ptr<CellInfo> created_lc =
|
||||||
create_ice_cell(ctx, ctx->id("ICESTORM_LC"), cell.first.str(ctx) + "$CARRY");
|
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);
|
i1_net->users.push_back(pr);
|
||||||
}
|
}
|
||||||
new_cells.push_back(std::move(created_lc));
|
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";
|
carry_lc->params[ctx->id("CARRY_ENABLE")] = "1";
|
||||||
replace_port(ci, ctx->id("CI"), carry_lc, ctx->id("CIN"));
|
replace_port(ci, ctx->id("CI"), carry_lc, ctx->id("CIN"));
|
||||||
|
Loading…
Reference in New Issue
Block a user