diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2022-01-27 16:08:33 +0100 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2022-01-27 19:28:07 +0100 |
commit | 5e4c6915c96f21c4cf647bcdf5687f431a7df9ed (patch) | |
tree | bd26fd3897a0e4f460617f0845702591da3878d7 /kernel/mem.h | |
parent | 84f0df1c9590572f339b62c8210837f01a024c76 (diff) | |
download | yosys-5e4c6915c96f21c4cf647bcdf5687f431a7df9ed.tar.gz yosys-5e4c6915c96f21c4cf647bcdf5687f431a7df9ed.tar.bz2 yosys-5e4c6915c96f21c4cf647bcdf5687f431a7df9ed.zip |
kernel/mem: Add functions to emulate read port enable/init/reset signals.
Diffstat (limited to 'kernel/mem.h')
-rw-r--r-- | kernel/mem.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/mem.h b/kernel/mem.h index 87a148beb..4d0a1d702 100644 --- a/kernel/mem.h +++ b/kernel/mem.h @@ -191,6 +191,24 @@ struct Mem : RTLIL::AttrObject { // original address. void widen_wr_port(int idx, int wide_log2); + // Emulates a sync read port's enable functionality in soft logic, + // changing the actual read port's enable to be always-on. + void emulate_rden(int idx, FfInitVals *initvals); + + // Emulates a sync read port's initial/reset value functionality in + // soft logic, removing it from the actual read port. + void emulate_reset(int idx, bool emu_init, bool emu_arst, bool emu_srst, FfInitVals *initvals); + + // Given a read port with ce_over_srst set, converts it to a port + // with ce_over_srst unset without changing its behavior by adding + // emulation logic. + void emulate_rd_ce_over_srst(int idx); + + // Given a read port with ce_over_srst unset, converts it to a port + // with ce_over_srst set without changing its behavior by adding + // emulation logic. + void emulate_rd_srst_over_ce(int idx); + Mem(Module *module, IdString memid, int width, int start_offset, int size) : module(module), memid(memid), packed(false), mem(nullptr), cell(nullptr), width(width), start_offset(start_offset), size(size) {} }; |