diff options
author | David Shah <davey1576@gmail.com> | 2018-12-20 19:16:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 19:16:11 +0000 |
commit | 580f6fbd213111d2b8b3d5b21b67420c7bfbcba1 (patch) | |
tree | c493eb34fe3d5d562295229a83f69f283db7d830 /ice40 | |
parent | c46a22cb7ff3449464a60c3bc62b22dded78d306 (diff) | |
parent | 75335d4e1a66f10be81a17e4728e7312b36e59bd (diff) | |
download | nextpnr-580f6fbd213111d2b8b3d5b21b67420c7bfbcba1.tar.gz nextpnr-580f6fbd213111d2b8b3d5b21b67420c7bfbcba1.tar.bz2 nextpnr-580f6fbd213111d2b8b3d5b21b67420c7bfbcba1.zip |
Merge pull request #187 from YosysHQ/fix_lock_passthru
ice40: Fix LOCK feedthrough insertion with carry or >8 LUTs
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/pack.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc index 242f8ceb..536b1b16 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1181,20 +1181,26 @@ static void pack_special(Context *ctx) log_info(" PLL '%s' has LOCK output, need to pass all outputs via LUT\n", ci->name.c_str(ctx)); bool found_lut = false; bool all_luts = true; + bool found_carry = false; unsigned int lut_count = 0; for (const auto &user : port.net->users) { NPNR_ASSERT(user.cell != nullptr); if (user.cell->type == ctx->id("ICESTORM_LC")) { - found_lut = true; - lut_count++; + if (bool_or_default(user.cell->params, ctx->id("CARRY_ENABLE"), false)) { + found_carry = true; + all_luts = false; + } else { + found_lut = true; + lut_count++; + } } else { all_luts = false; } } - if (found_lut && all_luts) { + if (found_lut && all_luts && lut_count < 8) { // Every user is a LUT, carry on now. - } else if (found_lut && !all_luts && lut_count < 8) { + } else if (found_lut && !all_luts && !found_carry && lut_count < 8) { // Strategy: create a pass-through LUT, move all non-LUT users behind it. log_info(" LUT strategy for %s: move non-LUT users to new LUT\n", port.name.c_str(ctx)); auto pt = spliceLUT(ctx, packed.get(), port.name, true); |