[libre-riscv-dev] buffered pipeline

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Mar 12 13:33:02 GMT 2019


i experimentally-implemented the above buffered pipeline, here:

it is... very confusing.  the names stb/busy, there are pairs: input
and output, however the connection for previous and next is crossed.

in the john dawson code, the stb / ack signals act effectively as a
clock.  you *must* raise and then lower the "ack" signal each and
every time that data is ready, and the sender will *not* initiate a
new data send until it has seen that raise *and* lower.

this means that the john dawson code's data receive and transmit rate
is *half* that of the clock.

by contrast, dan gisselquist's code is designed to keep on receiving
(or transmitting) data on every clock, for as long as stb is true and
busy is false.  it also seems to cope with all the situations such as
when input is ready and output is not (this activates "store incoming
data in buffer") and allows the stage to tell the input to stop
sending any more data (without losing the *current* data).

there may however be a bug in what dan has published:
if (!o_stb)
   o_data <= i_data;

i believe this should be "r_data <= i_data" according to the comments,
given that it says "store incoming data in temporary".

insights and comments appreciated.


More information about the libre-riscv-dev mailing list