cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
281 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
Teacher
Teacher
272 Views
Registered: ‎06-16-2013

Hi @jack1977 

 

Did you make sure cache condition ?

It seems cache issue...

 

Best regards,

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

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

0 Kudos
Highlighted
Teacher
Teacher
260 Views
Registered: ‎06-16-2013

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

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
Teacher
Teacher
222 Views
Registered: ‎06-16-2013

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