cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
legendbb
Voyager
Voyager
512 Views
Registered: ‎07-28-2008

How to implement memset(), memcpy() to PL memory space

In the past, I've done some designs with DMA engine accessing PL memory space.

Just wondering how to implement memset(), memcpy() functions to work with PL memory space.

Please give some hints.

Thanks,

0 Kudos
Reply
1 Reply
dgisselq
Scholar
Scholar
459 Views
Registered: ‎05-21-2015

@legendbb,

If you are trying to move or copy memory from PL addresses using the PS, then your standard mem* functions should work.  They'll be slow and non-optimal, as others on the forums have noticed, but they should work.  You can often adjust cache settings to speed these operations up.

If you are trying to use the PL to copy memory from one place in the DDR to another, then you might want to use a DMA of some type.  A memset command could easily be made from a stream to memory DMA.   memcmp could be done from two memory to stream DMAs.  For open source examples of how you might build some of these functions, see this repo.  Xilinx also provides official examples of functions such as these.  Just beware of the bugs in Xilinx's stream to memory mapped (S2MM) design--they can be annoying to work around.

Dan