cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
222 Views
Registered: ‎09-26-2014

Fast memory to memory copy

Hello. I use dma-proxy driver for transfer data packets form PL to PS and write to SATA SSD.

For this i have two buffer. One buffer writes, and in ths time, other buffer write to SATA.

I use memcpy for this

memcpy(args0.data_buf1[row_counter], rx_proxy_interface_p->buffer, row_length);

But this very slow. 

maybe there is some simple example how i copy data faster?

 

 

0 Kudos
5 Replies
Highlighted
Mentor
Mentor
213 Views
Registered: ‎06-16-2013

Re: Fast memory to memory copy

Hi @jack1977 

 

Did you make sure cache condition ?

It seems cache issue...

 

Best regards,

0 Kudos
Highlighted
Explorer
Explorer
206 Views
Registered: ‎09-26-2014

Re: Fast memory to memory copy

Could you tell me where and how this cache
verify?
I don’t understand this at all.

0 Kudos
Highlighted
Mentor
Mentor
201 Views
Registered: ‎06-16-2013

Re: Fast memory to memory copy

0 Kudos
Highlighted
Explorer
Explorer
181 Views
Registered: ‎09-26-2014

Re: Fast memory to memory copy

Yes, i read this document.

Then i add dma-coherent line in device tree, speed is increasing, but i get trash in the buffer - a mix of all my transactions.

dma_proxy {
dma-coherent; 
compatible ="xlnx,dma_proxy";
dmas = <&axi_dma_0 0
&axi_dma_0 1>;
dma-names = "dma_proxy_tx", "dma_proxy_rx";
};

I use petalinux, do i need to set constants in ports ARCACHE[3:0]  AWCACHE[3:0] ARPROT[2:0]  AWPROT[2:0] ?

 

 

 

0 Kudos
Highlighted
Mentor
Mentor
163 Views
Registered: ‎06-16-2013

Re: Fast memory to memory copy

Hi @jack1977 

 

>I use petalinux, do i need to set constants in ports ARCACHE[3:0]  AWCACHE[3:0] ARPROT[2:0]  AWPROT[2:0] ?

 

I'm not familiar with instruction and inplementation of memcpy. But you must consider cache coherency with some memory copy function, like memcpy, dma and so on.

At least, if cache is disable, you got similar result. Speed it to slowly. It depends on your environment and so on.

It's hard to correctly explain it.

 

Hope you are doing well.

 

Best regards,

0 Kudos