software/user: split DMA handling into an API #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this changeset is to provide a clean and simple API to handle DMA reads and writes in user software and examples of it. I know the pull request looks huge, but code is 95% same as before, just reshuffled into different functions/files and deduplicated. It's worth starting looking at it from litepcie_dma_minimal_example.c which should be self-explanatory:
Zero-copy can now be used seamlessly anywhere by passing a flag to litepcie_dma_init().
Note I was still not able to test litepcie_test record and play properly yet even after setting
pcie_dma0.writer.sink.valid.eq(1), pcie_dma0.reader.source.ready.eq(1)
even before these changes - not sure why.litepcie_util dma_test seems to work correctly though.