[libre-riscv-dev] [Bug 216] LOAD STORE buffer needed
bugzilla-daemon at libre-riscv.org
bugzilla-daemon at libre-riscv.org
Fri Mar 13 20:16:34 GMT 2020
http://bugs.libre-riscv.org/show_bug.cgi?id=216
--- Comment #9 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
here's some links to existing code:
the MemFunctionUnits:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/scoreboard/memfu.py;hb=HEAD
this is the "top level" of the mem-matrices, so quite boring
still boring:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/scoreboard/mem_fu_matrix.py;hb=HEAD
ok *now* we are cooking:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/scoreboard/mem_dependence_cell.py;hb=HEAD
however this is really the key bit:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/scoreboard/addr_match.py;hb=HEAD
that is where you get a Pascal's Triangle of address-comparators
*only in the bottom 10 bits*.
the actual algorithm is described in Mitch's book chapters, 11.4.12
i'll attach screenshots for the diagrams in a second.
the code i would like to connect to is here:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/minerva/units/loadstore.py;hb=HEAD
CachedLoadStoreUnit
and here is where the LOADs/STOREs actually get fired off:
https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/experiment/compldst.py;h=206f44876b00b6c1d94716e624a03e81208120d4;hb=HEAD#l277
here, rather than have that code *arbitrarily* fire off the LD/ST, and *assume*
it will complete in a single cycle:
* stwd_mem_o must be PREVENTED from asserting UNTIL it is absolutely known that
the store will succeed
* load_mem_o must likewise be prevented from asserting until the load is known
to succeed
thus, it is perfectly fine for LOAD (or STORE) to take more than one cycle
(just like any other Function Unit).
yes, i know, if the LD/ST cannot complete (raises an exception) this is a type
of "result", which must result in the cancellation of the instruction (and all
downstream instructions), and an exception raised.
this is TODO however it is important that the information propagate back
through the LOAD/STORE buffer as a potential "result": "LOAD could not take
place due to exception".
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-riscv-dev
mailing list