aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-17 15:48:34 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-17 15:48:34 +0200
commit6c54d4f93c4f76db0280af73d9a84fcbde1d74f6 (patch)
tree96479ba63473c65d320ea4c6f58f1286caa8b86a /ecp5
parentb52269bc198eb8fcc647100d4891379b7fd7346a (diff)
downloadnextpnr-6c54d4f93c4f76db0280af73d9a84fcbde1d74f6.tar.gz
nextpnr-6c54d4f93c4f76db0280af73d9a84fcbde1d74f6.tar.bz2
nextpnr-6c54d4f93c4f76db0280af73d9a84fcbde1d74f6.zip
ecp5: FF packer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/pack.cc20
1 files changed, 19 insertions, 1 deletions
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<CellInfo> 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: