cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
750 Views
Registered: ‎08-14-2015

XDMA PCI Examples Dont Work As Expected - ReadFile() terminates with insufficient bytes read

We are testing out the example applications provided with the XDMA source code.  One app is called simpledma.  SimpleDMA does one 8 mb ReadFile() and then a similar 8 mb WriteFile() to demonstrated transfers between windows and the PCIe core.  We are using an artix 7.

Both functions work and seem to transfer correct data based on test pattern inspection.  However they terminate early.  When reading we often get 0 bytes back, sometimes 4K, other values, but never is the 8 mb done in a single read.  We added a loop to the read to get statistics of how much was read on each call.  The calls can return with a success code (never a failure) with 0 bytes within a short period of time (tick count delta of 0) so there is not a real timeout issue.  Why don't these readfile and writefile functions wait till the full amount requested is sent.

The behavior we are seeing is not consistent with the demo app simpledma, which should only require 1 readfile() to do a full transfer of 8 mb.

What is going on and how can this be corrected?

Ideally we would like to use overlapped IO to queue up subsequent I/Os for a real time app, but the achieved transfer sizes are so small and often 0 bytes, that this is not practical.

Can someone comment on how to fix the problems with readfile() and writefile() when going through the xdma driver.

0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
638 Views
Registered: ‎08-02-2007

in order to transfer more than 4K in the example design

you will need to modify the file dma_memory_mapped_test.sh (if it is MM interface)

to make sure line below is modified and pointed to other bin file

 

echo "Info: Writing to h2c channel $curChannel at address offset $addrOffset."
    $tool_path/dma_to_device -d /dev/xdma0_h2c_${curChannel} -f data/datafile${i}_4K.bin -s $transferSize -a $addrOffset -c $transferCount &

 

in your application it is the same, could you please check 

------------------------------------------------------------------------------
Don't forget to reply, give kudo and accept as solution
------------------------------------------------------------------------------
0 Kudos
Highlighted
Participant
Participant
621 Views
Registered: ‎08-14-2015

I appreciate someone finally trying to address this.  Perhaps I thought it was obvious from the context, but this is a windows machine not a linux machine that pcie is going to.  Is there some sort of equivalent command for windows?  We are using the standard applications / source code provided by Xilinx.

The above reply makes no sense for windows.

0 Kudos
Highlighted
Visitor
Visitor
167 Views
Registered: ‎07-26-2020

Xdma can't break 200M per second In Xilinx XDMA under Windows, the transmission speed cannot exceed 200M per second. and I was asked to reach 1G per second. What should be done?

0 Kudos