diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-25 22:39:50 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-25 23:42:31 +0200 |
commit | d99fce3bc77a42563e1e270172e08ec25d58c7ab (patch) | |
tree | 6e7f5cd961356735acfd5fe987a9f4ae3b88b5c6 /passes | |
parent | 18806f1ef653f29654533ee47fd8a1b0cf1d645a (diff) | |
download | yosys-d99fce3bc77a42563e1e270172e08ec25d58c7ab.tar.gz yosys-d99fce3bc77a42563e1e270172e08ec25d58c7ab.tar.bz2 yosys-d99fce3bc77a42563e1e270172e08ec25d58c7ab.zip |
mem/extract_rdff: Fix "no FF made" edge case.
When converting a sync transparent read port with const address to async
read port, nothing at all needs to be done other than clk_enable change,
and thus we have no FF cell to return. Handle this case correctly in
the helper and in its users.
Diffstat (limited to 'passes')
-rw-r--r-- | passes/memory/memory_nordff.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/passes/memory/memory_nordff.cc b/passes/memory/memory_nordff.cc index 665efceb2..80f78ca77 100644 --- a/passes/memory/memory_nordff.cc +++ b/passes/memory/memory_nordff.cc @@ -57,9 +57,12 @@ struct MemoryNordffPass : public Pass { for (auto &mem : Mem::get_selected_memories(module)) { bool changed = false; - for (int i = 0; i < GetSize(mem.rd_ports); i++) - if (mem.extract_rdff(i, &initvals)) + for (int i = 0; i < GetSize(mem.rd_ports); i++) { + if (mem.rd_ports[i].clk_enable) { + mem.extract_rdff(i, &initvals); changed = true; + } + } if (changed) mem.emit(); |