Forum Discussion
Altera_Forum
Honored Contributor
15 years agoYou need to use uncached addresses when the memory area you want to read/write is also accessed by hardware. It is the case for the frame buffer that is read by a DMA. If you don't use the uncached functions, in some cases the CPU can delay the write operation, and the DMA will read the previous contents of the frame buffer instead of what you just wrote.
But if you are writing a lot of data on consecutive words, you can use the CPU cache to speed up things, it will be a lot faster than using the unmapped area. To do that, don't use the unmapped functions and write to the address as usual, and at the end call the flush function. It will ensure that everything is written on the DDR before the hardware reads it. You should also enable the burst transfers from the cache in the Nios II configuration.