Update dma.py
Added argument for _SGDMAChannel.transfer() method to write BD's to selected memory (for example: in case when buffer descriptors will be stored in PL RAM)
Signed-off-by: Michał Stojke [email protected]
Hi @mstojke, thank you for your PR.
In what context have you used your updated code?
From what I can see, you add bd_allocate_target to PYNQ's allocate function as a target. However, allocate expects target to be a Device class (e.g. XrtDevice), which then calls the device's own allocate function (e.g. XrtDevice.allocate)
https://github.com/Xilinx/PYNQ/blob/19ed17d4fd4ea71f95a97d30f8ccd0d62b8dbaaa/pynq/buffer.py#L138-L158
Hi @jogomojo
I made a mistake in the description of the transfer() function in the _SGDMAChannel() class. It should actually pass a memory device instead of the described PynqBuffer.
https://github.com/Xilinx/PYNQ/blob/e35a66879bcc2b28b6b6a82ce395533e3330b088/pynq/lib/dma.py#L348-L350
I used the modified code to allocate memory space in the PL DDR4. Below is a fragment from my project showing how it was used.
dma_max_transfer_size = 4194304 * 4
overlay.dma = DMA(overlay.ip_dict['axi_dma_0'])
overlay.dma.recvchannel._max_size = dma_max_transfer_size
overlay.dma.recvchannel.transfer(buf, ddr_4_target=overlay.ddr4_0)
Hi @mstojke
Could you share a minimal Vivado tcl design I could build and a Python file for me to run so I can test this out?
Hi @jogomojo
I added you to the repository with the project.