diff options
author | David Shah <davey1576@gmail.com> | 2018-08-01 14:39:56 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-01 14:39:56 +0200 |
commit | 1a34d6d33438671c8704388c3911a90bb2184a9b (patch) | |
tree | 19045d5c30454ae2f54ffd53067115a13be1aeab /ecp5 | |
parent | f041f0189597d10fee7e2ecb8bfdb3324dea3a43 (diff) | |
download | nextpnr-1a34d6d33438671c8704388c3911a90bb2184a9b.tar.gz nextpnr-1a34d6d33438671c8704388c3911a90bb2184a9b.tar.bz2 nextpnr-1a34d6d33438671c8704388c3911a90bb2184a9b.zip |
ecp5: Memory fixes in packer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/pack.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 11cc2647..786f543e 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -325,19 +325,22 @@ class Ecp5Packer lut_to_slice(ctx, lut0, slice.get(), 0); lut_to_slice(ctx, lut1, slice.get(), 1); - auto ff0 = lutffPairs.find(lut0->name), ff1 = lutffPairs.find(lut1->name); + auto ff0 = lutffPairs.find(lut0->name); if (ff0 != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff0->second).get(), slice.get(), 0, true); packed_cells.insert(ff0->second); - lutffPairs.erase(lut0->name); fflutPairs.erase(ff0->second); + lutffPairs.erase(lut0->name); } + + auto ff1 = lutffPairs.find(lut1->name); + if (ff1 != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff1->second).get(), slice.get(), 1, true); packed_cells.insert(ff1->second); - lutffPairs.erase(lut1->name); fflutPairs.erase(ff1->second); + lutffPairs.erase(lut1->name); } new_cells.push_back(std::move(slice)); @@ -363,8 +366,8 @@ class Ecp5Packer if (ff != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff->second).get(), slice.get(), 0, true); packed_cells.insert(ff->second); - lutffPairs.erase(ci->name); fflutPairs.erase(ff->second); + lutffPairs.erase(ci->name); } new_cells.push_back(std::move(slice)); |