cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tony_tse
Visitor
Visitor
550 Views
Registered: ‎01-06-2021

XDMA dma_to_device failed

Hello,

I am a newer to Xdma, I generated a xdma example(xc7k325t-2ffg900/Gen2X8/Axi Stream/1 H2C & 1 C2H,Vivado2020.1),and I want to verify the xdma performance. I got the latest driver in github.com,and install it in my computer(ubuntu16.04).

1.When I use run_test.sh  it worked well

tony_tse_0-1611043231872.png

2. when I try to write larger size data into device,it can not work(../tests$ sudo ./dma_to_device -d /dev/xdma0_h2c_0 -f data/datafile0_4k_bin -s 4096),it  Can not  find this command (as below,the chinese words meas it can not find this command),then I open the driver directory,find dma_to_device is under tools directory,not under tests directory.

tony_tse_2-1611044568384.png

 

3.then I copy data directory from tests directory to tools directory,then under tool directory, I input the command :(../tools$ sudo ./dma_to_device -d /dev/xdma0_h2c_0 -f data/datafile0_4k_bin -s 4096),it can find this command,but the the data is not be written into EP.

tony_tse_1-1611044376990.png

look forward to your reply,Thank you.

0 Kudos
9 Replies
liy
Xilinx Employee
Xilinx Employee
505 Views
Registered: ‎08-02-2007

https://www.xilinx.com/video/technology/dma-for-pci-express.html

In that video it is mentioned that the tests try to DMA from 0x00000000 but most example designs and maybe your custom ones have the xdma core mapped on 0x0000000080000000 (0x80000000 for 32-bit) on the AXI bus.

Thus you need to change the scripts and add this offset as the video explains in 12:15. This will make the scripts call the ./dma_to_device and ./dma_from_device with -a (offset) of 0x80000000

------------------------------------------------------------------------------
Don't forget to reply, give kudo and accept as solution
------------------------------------------------------------------------------
0 Kudos
tony_tse
Visitor
Visitor
494 Views
Registered: ‎01-06-2021

Hi,liy, Tanks for your reply,I will try it as you said and reply to you soon.

0 Kudos
tony_tse
Visitor
Visitor
477 Views
Registered: ‎01-06-2021

Hi,liy,

I have seen the video you linked,But the picture is not clear,So I still don't know how to add the offset,Can you tell me how to do in the driver or my application.Thank you

0 Kudos
tony_tse
Visitor
Visitor
474 Views
Registered: ‎01-06-2021

and I used Axi Stream,not AXI MM.

0 Kudos
liy
Xilinx Employee
Xilinx Employee
438 Views
Registered: ‎08-02-2007

please change  the resolution if it is not clear

liy_0-1611210818246.png

 

------------------------------------------------------------------------------
Don't forget to reply, give kudo and accept as solution
------------------------------------------------------------------------------
0 Kudos
tony_tse
Visitor
Visitor
434 Views
Registered: ‎01-06-2021

Thank you. I will try it,and reply to you .
0 Kudos
tony_tse
Visitor
Visitor
424 Views
Registered: ‎01-06-2021

I have tried it,but it still failed.

1.add addroffset in dma_memory_mapped_test.sh

tony_tse_4-1611212281256.png

tony_tse_5-1611212341138.png

 

 

But I used Axi Stream Interface,not Memory-Mapped.

2.

run sudo ./dma_to_device -d /dev/xdma0_h2c_0 -f data/datafile0_4K.bin -s 4096 under tools directory,it still had a error(Unknown Error 512)

tony_tse_6-1611212405945.png

 

0 Kudos
tony_tse
Visitor
Visitor
406 Views
Registered: ‎01-06-2021

Hello,liy,

When I generated a xdma ip by choosing AXI MEMORY-MAPPED Interface,everything seems ok ! I can write data into PCIe EP by using dma_to_device.I can write 4KB/256KB even 1MB data(I designed a 1MB RAM in my project).Maybe the driver can not support Stream Interface well(I guess),So I decide to use AXI MEMORY-MAPPED Interface for my design.

tony_tse_0-1611223504514.png

Another Question: what's 2573.230469 meaning,throughput? what's the unit,MBPS or Mbps?

Thanks again for your help.

 

0 Kudos
liy
Xilinx Employee
Xilinx Employee
328 Views
Registered: ‎08-02-2007

it is MBps

if can find more in the code below 

fprintf(stdout,

 

" -%c (--%s) size of a single transfer in bytes, default %d.\n",

 

long_opts[i].val, long_opts[i].name, SIZE_DEFAULT);

------------------------------------------------------------------------------
Don't forget to reply, give kudo and accept as solution
------------------------------------------------------------------------------
0 Kudos