enjoy-digital / litesata

Small footprint and configurable SATA core
Other
130 stars 34 forks source link

Fix flow control during read operation #26

Closed rniwase closed 1 year ago

rniwase commented 1 year ago

I am validating read/write operations using LiteSATAStriping with multiple SSDs (Samsung 860 EVO).

I noticed that during Read operations, when source.ready=0 in LiteSATACore, the rx_buffer of LiteSATALink becomes full, causing the flow control to malfunction.

To resolve this issue, I made a modification to continuously send HOLD primitives to the device even when LiteSATALinkRX's FSM is in the COPY state, even if HOLDA primitives are being received from the device.

Additionally, since the stability was not achieved solely by this change, I increased the depth of the receive buffer from 128 to 256. Further investigation may be necessary regarding this modification.

Furthermore, I fixed the duplicate definition of CONT in litesata/common.py.

At least, I have confirmed that these fixes resolved the issue and I am able to perform Read or Write operations using LiteSATAStriping.

enjoy-digital commented 1 year ago

Thanks a lot @rniwase, this looks good to me.