From 6c54d4f93c4f76db0280af73d9a84fcbde1d74f6 Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 17 Jul 2018 15:48:34 +0200 Subject: ecp5: FF packer Signed-off-by: David Shah --- ecp5/pack.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 056f457c..4f864b89 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -318,7 +318,7 @@ class Ecp5Packer // with an optional FF also void pack_remaining_luts() { - log_info("Unpaired LUTs into a SLICE...\n"); + log_info("Packing unpaired LUTs into a SLICE...\n"); for (auto cell : sorted(ctx->cells)) { CellInfo *ci = cell.second; if (is_lut(ctx, ci)) { @@ -339,6 +339,23 @@ class Ecp5Packer flush_cells(); } + // Pack flipflops that weren't paired with a LUT + void pack_remaining_ffs() + { + log_info("Packing unpaired FFs into a SLICE...\n"); + for (auto cell : sorted(ctx->cells)) { + CellInfo *ci = cell.second; + if (is_ff(ctx, ci)) { + std::unique_ptr slice = + create_ecp5_cell(ctx, ctx->id("TRELLIS_SLICE"), ci->name.str(ctx) + "_SLICE"); + ff_to_slice(ctx, ci, slice.get(), 0, false); + new_cells.push_back(std::move(slice)); + packed_cells.insert(ci->name); + } + } + flush_cells(); + } + public: void pack() { @@ -348,6 +365,7 @@ class Ecp5Packer pair_luts(); pack_lut_pairs(); pack_remaining_luts(); + pack_remaining_ffs(); } private: -- cgit v1.2.3