memory_dff: Fix needlessly duplicating enable bits.
authorMarcelina Kościelnicka <mwk@0x04.net>
Thu, 22 Oct 2020 08:37:44 +0000 (10:37 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Thu, 22 Oct 2020 11:03:42 +0000 (13:03 +0200)
commiteb76d35e8030f4befb596fee6d7682d39628dc69
tree14fd7825e5eabf1e21b40c0d57b886596dbf54c6
parent1a7a597e0720f66b59b896f8e7d537dee8e37744
memory_dff: Fix needlessly duplicating enable bits.

When the register being merged into the EN signal happens to be a $sdff,
the current code creates a new $mux for every bit, even if they happen
to be identical (as is usually the case), preventing proper grouping
further down the flow.  Fix this by adding a simple cache.

Fixes #2409.
passes/memory/memory_dff.cc
tests/arch/ecp5/bug2409.ys [new file with mode: 0644]