Open timsherwood opened 2 years ago
There are two different classes of question to answer here:
1) How do we expose such a change to the user (e.g. MaskedWrite as discussed above or extend EnabledWrite to simply allow for multiple bits?)
2) How do we implement this in pyrtl hardware model given that right now a 1-bit enable is hard coded into the "core" (e.g. we could modify core write-ports @
to extend enable to multiple bits for all memories, we could extend core with both 1-bit and multi-bit enables, some other way?)
Add a bit-masked write operations for memories that only update a subset of the bits in the wordline.
An example from openpiton that's meant to infer properly on xilinx FPGAs (this chunk specifically is for a one read-write port bram) https://github.com/PrincetonUniversity/openpiton/blob/openpiton/piton/tools/bin/pyhplib_sram.py#L196-L246
pyhplib_sram.py
BW is "bit write", it's a mask of the bits you want to replace in the line you're writing to
so the key part is the bottom bit:
CE is chip enable, so just whether you should do any access at all RDWEN is read vs write DIN is your input data
The thought is you could have something, MaskedWrite, similar to EnabledWrite, which gave the bitmask instead of a single bit. If any bit were 1, then it's an enabled write, and for the particular bits that are 1, they're replaced with the bits from the data you provide.