PYNQ icon indicating copy to clipboard operation
PYNQ copied to clipboard

_SGDMAChannel.transfer() ignores start offset

Open sebastianpetersFAU opened this issue 2 years ago • 2 comments

I just noticed that in dma.py, when using the _SGDMAChannel.transfer(array, start, nbytes) function, the start parameter (offset into array) is ignored in lines 427 and 429 when the descriptors are filled out.

This leads to the data ending up at the wrong address as if start was always set to 0.

In line 382 the start parameter is used as expected ... (array.physical_address + start) ... when checking for alignment,


Suggestion: Add + start in line 427 (and 429):

old: (array.physical_address + (i * blk_size)) & 0xffffffff new: (array.physical_address + start + (i * blk_size)) & 0xffffffff

sebastianpetersFAU avatar Oct 04 '22 14:10 sebastianpetersFAU

Hi @sebastianpetersFAU,

The version 3.0 has just been released.

However, I suggest you create a Pull Request with these changes, and they will be reviewed.

Mario

mariodruiz avatar Oct 17 '22 07:10 mariodruiz

Hi @mariodruiz

I have created a pull request (https://github.com/Xilinx/PYNQ/pull/1401) since this issue exists in version 3.0 as well.

Sebastian

sebastianpetersFAU avatar Oct 24 '22 14:10 sebastianpetersFAU