Forum Discussion
The cache flush is optional and you only need to use when data is accessed by the CPU and accelerator. Function parameters will be communicated to the accelerator using cache bypassing so you don't have to worry about them. The cache flush is needed if you for example have Nios II populate some buffer, then call the accelerator which then accesses this buffer. The Nios II processor has a writeback cache so the contents written might be still in the cache without the flush. Another example of where the cache flush is needed is if the accelerator writes to a memory location(s) and the CPU needs to access this data after. If you are familiar with cache coherency with multiple processors or processors and DMA engines then the same applies to C2H.