diff options
author | David Shah <dave@ds0.me> | 2019-12-08 09:54:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-08 09:54:33 +0000 |
commit | dd73a7ff9f6605ef689d5645c06d34585ec0eacc (patch) | |
tree | 5f7ea45d2ba93c2cc1ebc57020a5ef36f4c14500 /ecp5/pack.cc | |
parent | f0887427da28c4993b44e0e7f3e3ac39f29c16fd (diff) | |
parent | 349be76d2693f0c9527c6373d31fae7e711f9270 (diff) | |
download | nextpnr-dd73a7ff9f6605ef689d5645c06d34585ec0eacc.tar.gz nextpnr-dd73a7ff9f6605ef689d5645c06d34585ec0eacc.tar.bz2 nextpnr-dd73a7ff9f6605ef689d5645c06d34585ec0eacc.zip |
Merge pull request #369 from YosysHQ/ecp5-prld
ecp5: Add support for flipflops with preload
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r-- | ecp5/pack.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 09947d88..3867ab3d 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -112,7 +112,8 @@ class Ecp5Packer NetInfo *znet = ci->ports.at(ctx->id("Z")).net; if (znet != nullptr) { CellInfo *ff = net_only_drives(ctx, znet, is_ff, ctx->id("DI"), false); - if (ff != nullptr) { + // Can't combine preload FF with LUT due to conflict on M + if (ff != nullptr && get_net_or_empty(ff, ctx->id("M")) == nullptr) { lutffPairs[ci->name] = ff->name; fflutPairs[ff->name] = ci->name; } @@ -232,6 +233,8 @@ class Ecp5Packer // Return true if a FF can be added to a DPRAM slice bool can_pack_ff_dram(CellInfo *dpram, CellInfo *ff) { + if (get_net_or_empty(ff, ctx->id("M")) != nullptr) + return false; // skip PRLD FFs due to M/DI conflict std::string wckmux = str_or_default(dpram->params, ctx->id("WCKMUX"), "WCK"); std::string clkmux = str_or_default(ff->params, ctx->id("CLKMUX"), "CLK"); if (wckmux != clkmux && !(wckmux == "WCK" && clkmux == "CLK")) @@ -1178,7 +1181,8 @@ class Ecp5Packer CellInfo *ci = cell.second; if (is_ff(ctx, ci)) { bool pack_dense = used_slices > (dense_pack_mode_thresh * available_slices); - if (pack_dense) { + bool requires_m = get_net_or_empty(ci, ctx->id("M")) != nullptr; + if (pack_dense && !requires_m) { // If dense packing threshold exceeded; always try and pack the FF into an existing slice // Find a SLICE with space "near" the flipflop in the netlist std::vector<CellInfo *> ltile; |