aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/mem.cc
Commit message (Collapse)AuthorAgeFilesLines
* kernel/mem: Add read-first semantic emulation code.Marcelina Kościelnicka2022-01-281-0/+104
|
* kernel/mem: Add functions to emulate read port enable/init/reset signals.Marcelina Kościelnicka2022-01-271-0/+208
|
* Fix null pointer dereference after failing to extract DFF from memory.Catherine2021-12-141-1/+2
| | | | Fixes #3110.
* FfData: some refactoring.Marcelina Kościelnicka2021-10-071-4/+4
| | | | | | | | | | - FfData now keeps track of the module and underlying cell, if any (so calling emit on FfData created from a cell will replace the existing cell) - FfData implementation is split off to its own .cc file for faster compilation - the "flip FF data sense by inserting inverters in front and after" functionality that zinit uses is moved onto FfData class and beefed up to have dffsr support, to support more use cases
* kernel/ff: Refactor FfData to enable FFs with async load.Marcelina Kościelnicka2021-10-021-8/+7
| | | | | | | | | | - *_en is split into *_ce (clock enable) and *_aload (async load aka latch gate enable), so both can be present at once - has_d is removed - has_gclk is added (to have a clear marker for $ff) - d_is_const and val_d leftovers are removed - async2sync, clk2fflogic, opt_dff are updated to operate correctly on FFs with async load
* kernel/mem: Remove old parameter when upgrading $mem to $mem_v2.Marcelina Kościelnicka2021-08-161-0/+1
| | | | Fixes #2967.
* Add v2 memory cells.Marcelina Kościelnicka2021-08-111-135/+224
|
* kernel/mem: Introduce transparency masks.Marcelina Kościelnicka2021-08-111-16/+297
|
* memory: Introduce $meminit_v2 cell, with EN input.Marcelina Kościelnicka2021-07-281-4/+37
|
* kernel/mem: Add a coalesce_inits helper.Marcelina Kościelnicka2021-07-131-0/+72
| | | | | | | While this helper is already useful to squash sequential initializations into one in cxxrtl, its main purpose is to squash overlapping masked memory initializations (when they land) and avoid having to deal with them in cxxrtl runtime.
* kernel/mem: Use delayed removal for inits as well.Marcelina Kościelnicka2021-07-121-3/+18
|
* kernel/mem: Commit new values of attributes in emit.Marcelina Kościelnicka2021-07-121-0/+4
|
* kernel/mem: Recognize some deprecated memory port configs.Marcelina Kościelnicka2021-06-011-0/+10
| | | | | | | | | | Transparency is meaningless for asynchronous ports, so we assume transparent == false to simplify the code in this case. Likewise, enable is meaningless, and we assume it is const-1. However, turns out that nMigen emits the former, and Verilog frontend emits the latter, so squash these issues when ingesting a $memrd cell. Fixes #2811.
* Make a few passes auto-call Mem::narrow instead of rejecting wide ports.Marcelina Kościelnicka2021-05-281-0/+3
| | | | | | This essentially adds wide port support for free in passes that don't have a usefully better way of handling wide ports than just breaking them up to narrow ports, avoiding "please run memory_narrow" annoyance.
* kernel/mem: Add helpers for write port widening.Marcelina Kościelnicka2021-05-271-0/+46
|
* kernel/mem: Add sub_addr helpers.Marcelina Kościelnicka2021-05-261-20/+12
|
* kernel/mem: Add prepare_wr_merge helper.Marcelina Kościelnicka2021-05-261-0/+20
|
* mem/extract_rdff: Fix "no FF made" edge case.Marcelina Kościelnicka2021-05-251-1/+4
| | | | | | | 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.
* mem/extract_rdff: Add alternate transparency handling.Marcelina Kościelnicka2021-05-251-18/+80
| | | | | | | | | | When extracting read register from a transparent port that has an enable, reset, or initial value, the usual trick of putting a register on the address instead of data doesn't work. In this case, create soft transparency logic instead. When transparency masks land, this will also be used to handle ports that are transparent to only a subset of write ports.
* kernel/mem: Add model support for read port init value and resets.Marcelina Kościelnicka2021-05-251-2/+70
| | | | | | | Like wide port support, this is still completely unusable, and support in various passes will be gradually added later. It also has no support at all in the cell library, so attempting to create a read port with a reset or initial value will cause an assert failure for now.
* mem/extract_rdff: Fix wire naming and wide port support.Marcelina Kościelnicka2021-05-251-6/+22
|
* kernel/mem: Add emulate_priority helper.Marcelina Kościelnicka2021-05-251-0/+38
|
* kernel/mem: Add a Mem::narrow helper to split up wide ports.Marcelina Kościelnicka2021-05-251-0/+51
|
* kernel/mem: Emit support for wide ports in packed mode.Marcelina Kościelnicka2021-05-251-30/+34
| | | | | | | Since the packed cell doesn't actually support wide ports yet, we just auto-narrow them on emit. The future packed cell will add RD_WIDE_CONTINUATION and WR_WIDE_CONTINUATION parameters so the transform will be trivially reversible for proper serialization.
* kernel/mem: Add model for wide ports.Marcelina Kościelnicka2021-05-251-6/+26
| | | | | | Such ports cannot actually be created or used yet, this just adds the necessary plumbing in the helper. Subsequent commits will gradually add wide port support to various yosys passes.
* kernel/mem: Add priority_mask to model.Marcelina Kościelnicka2021-05-251-1/+46
| | | | | | | | This is going to be used to store arbitrary priority masks in the future. Right now, it is not supported by our cell library, so the priority_mask is computed from port order on helper construction, and discarded when emitted. However, this allows us to already convert helper-using passes to the new model.
* extract_rdff: Add initvals parameter.Marcelina Kościelnicka2021-05-231-1/+1
| | | | | This is not used yet, but will be needed when read port reset/initial value support lands.
* kernel/mem: Add a check() function.Marcelina Kościelnicka2021-05-221-0/+25
|
* kernel/mem: defer port removal to emit()Marcelina Kościelnicka2021-05-221-14/+34
|
* Add new helper structures to represent memories.Marcelina Kościelnicka2020-10-211-0/+436