enjoy-digital / litepcie

Small footprint and configurable PCIe core
Other
451 stars 111 forks source link

remove BufferizeEndpoints of LitePCIeDMAWriter #82

Closed tongchen126 closed 2 years ago

tongchen126 commented 2 years ago

The BufferizeEndpoints used in LitePCIeDMAWriter will cause conflicts between consecutive DMA requests, and the second request will stop earlier before transferring all the data due to this conflict.
The underlying mechanism is that, if BufferizeEndpoints is used, then when the first DMA request finished, the 'end' signal will be kept true and then the second DMA request will start right after it. And due to this and 'stop condition', the 'kept-true' signal will cause the second request stop earlier before transferring all the data(i.e. only 'max_size' of data is transferred).
Found this problem when executing Scatter-Gather DMA requests, where the DMA requests start right after their predecessor. So these conflicts arise. The code used is here.
The problem only arises in LitePCIeDMAWriter as LitePCIeDMAReader doesn't use the 'end' signal.
This problem could also be eliminated by keeping a few clock cycles(larger than 10) interval between consecutive DMA requests, and this trick is not an ideal problem solver. The test platform is Acorn CLE-215.

tongchen126 commented 2 years ago

It seems the git automatic check has failed due to network failure, which is not related to the codebase.

enjoy-digital commented 2 years ago

@tongchen126: Sorry for the delay, can you do a test with https://github.com/enjoy-digital/litepcie/pull/85/files?

tongchen126 commented 2 years ago

@enjoy-digital Yes sure. Thanks for the reply.

enjoy-digital commented 2 years ago

As discussed, the alternative solution in https://github.com/enjoy-digital/litepcie/pull/85/files has been merged. Thanks a lot @tongchen126 for the feedback and suggested solution.