Altera_Forum
Honored Contributor
11 years agoSGDMA streaming to memory, how to start and stop?
I've read a couple of posts about the SGDMA on this forum, but can't see an answer to the specific problem I'm having.
Our design has a streaming source that runs continuously. We need to capture a chunk of data from this stream into memory. The stream is running quite fast (64bits of data valid every 4 clock cycles), and uses burst writes to move this into memory via a 64 bit bus. The problem I've come up against is how do I control the flow data into the SGDMA? Even when the SGDMA isn't busy it looks like the FIFO in the SGDMA is filled up. The first samples in my captured data are clearly from some old data. Also because the system is starting with a full FIFO it can't ever run it down to a point where it doesn't overflow again. The only solution I can see at the moment is to put some logic in so that the Nios can disable the valid from the source to the SGDMA. The Nios would then setup and start the SGDMA before enabling the valid. This problem here is that I'd still end up with data left in the SGDMA FIFO when the capture to memory is completed, as I wouldn't be able to switch off the valid at the instant the SGDMA is finished. I can't see any way to flush this unwanted data out of the SGDMA. Is there any way that my streaming source can detect that the SGDMA is busy? The 'ready' signal doesn't give me this information as it is asserted when there is space in the SGDMAs FIFO. Any ideas would be appreciated.