Jump to content


co_memory_readblock question


  • You cannot reply to this topic
1 reply to this topic

#1 Jonathan

    Member

  • Members
  • PipPip
  • 25 posts

Posted 01 June 2009 - 12:19 PM

The CoDeveloper User Guide states for co_memory_readblock that:

QUOTE
co_memory_readblock performs a block DMA transfer between shared memories and local memories. The third argument, buf, is a pointer to an array that represents a block of local RAM. Note that co_memory_readblock is not designed for efficient random access of individual memory locations. Note also that stream interfaces may actually provide better hardware performance than memory block reads and writes if the system contains a CPU.


If I'm implementing a table in external memory, and I will be random accessing for reading and writing, mostly 64-bit chunks, with an occational, larger read and write, is there a better way? Also, what does the system containing a CPU have to do with it? (my system has two PowerPC CPUs connected to the fabric)

Should I be doing all my external memory access through the CPU, using streams, to take advantage of the PowerPC's data cache?

Thanks,
Jonathan

#2 RalphBodenner

    Advanced Member

  • Admin
  • PipPipPip
  • 348 posts

Posted 03 June 2009 - 01:12 PM

QUOTE (Jonathan @ Jun 1 2009, 01:19 PM) <{POST_SNAPBACK}>
If I'm implementing a table in external memory, and I will be random accessing for reading and writing, mostly 64-bit chunks, with an occational, larger read and write, is there a better way?

You could implement some kind of caching (to a local array--block RAM) if the access patterns of your algorithm are not truly random.

QUOTE (Jonathan @ Jun 1 2009, 01:19 PM) <{POST_SNAPBACK}>
Also, what does the system containing a CPU have to do with it? (my system has two PowerPC CPUs connected to the fabric)

The truth of this statement is quite platform-dependent. If the CPU is accessing the same memory over a system bus, then contention on the bus can hurt your performance. Some dedicated stream links (FSL, for example) might give higher performance in such a case. I would say not to worry about this idea unless you can profile the complete application and find the performance bottleneck is there.

Ralph Bodenner
Impulse Accelerated Technologies, Inc.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users