Forum Discussion
Altera_Forum
Honored Contributor
13 years agoStream to Memory sgdma problem
I am having two problems with the sg-dma in my system. My first issue is that the sg-dma ready signal goes low after the first element of streaming data, then returns high on the third. This causes...
Altera_Forum
Honored Contributor
13 years agoYou might be exposed to a race condition, it really depends on how many descriptors are in the chain and how fast the CPU can maintain control over the SGDMA. The problem with circular buffering like this is if the processor gets bogged down, it's possible that the SGDMA ends up overwriting data that your CPU is not done using.
What you describing sounds like it would be more appropriate to implement using ping pong buffering where one buffer is being filled while the other one is being consumed by the processor or whatever uses the data afterwards. With ping pong buffering you could just have two linked lists, one per buffer, and each time the SGDMA hits the end of the list you just point it over to the other list and start it back up.