Forum Discussion
111 Replies
- Altera_Forum
Honored Contributor
DMA is Avalon-MM (memory map) and SGDMA is Avalon-ST (streaming memory)
memory-to-memory (onchip to sdram, sram to sdram) stream-to-memory (buffer array to sdram, buffer to sram) memory-to-stream (sdram to buffer array, sram to buffer). You should read more about Avalon Interface Spec. Sean - Altera_Forum
Honored Contributor
So, is it cannot use DMA to transfer data between peripheral and memory?
- Altera_Forum
Honored Contributor
What are you trying to do with DMA? You can transfer data from peripheral to your sdram, but you have to write your interface protocols and make connected to it.
- Altera_Forum
Honored Contributor
I am trying to transfer data from peripheral (adding number) to SDRAM. Is there any reference or tutorial to write the interface protocol?
- Altera_Forum
Honored Contributor
If you are using DMA (Avalon-MM), there is Avalon-MM templates already at Altera website.
If you are using SGDMA (Avalon-ST), then you have to write your own protocols to connect your peripheral to Avalon-ST. Sean - Altera_Forum
Honored Contributor
In my SOPC, i saw everything is Avalon MM Slave/Master. So is it consider as Avalon MM? Besides, my SDRAM is Avalon MM too, how to change to Avalon ST? Sorry, i am new. I can hardly understand. Thanks!
- Altera_Forum
Honored Contributor
I would use the following rather than the stock ACDS SGDMA:
http://www.altera.com/support/examples/nios2/exm-modular-scatter-gather-dma.html Cheers, slacker - Altera_Forum
Honored Contributor
I have done my DMA, which means I have to re-do to use SGDMA?
- Altera_Forum
Honored Contributor
For Avalon-ST the typical minimal signals are data, ready, and valid. You connect a ST source (provider of data) to a ST sink (receiver of data). The data transfers between the source and sink when valid (from source) and ready (from sink) are both high. So if you have a component that provides/accepts a stream of data then ST is probably your best choice for an interface.
There are three DMAs discussed in this thread: 1) DMA on ACDS (old DMA that only supports MM transfers) 2) SGDMA on ACDS (DMA that supports MM and MM to/from ST transfers) 3) mSGDMA design example (hybrid of# 1 and# 2.... kinda) All three DMAs are not software compatible so before choosing a DMA make sure you are picking the right one for the task. So figure out what interface your custom component is going to use first then pick the DMA that makes the most sense to pair up with it. Also consider if you need scatter-gather or if having the CPU starting up the DMA for each transfer is sufficient for what you are doing. # 1 and# 3 have similar usage models whereas# 2 in my opinion is very different and the most difficult to program software around it. We won't be able to make a recommendation until knowing more about what your requirements are. - Altera_Forum
Honored Contributor
My requirement is connecting the DMA to a peripheral(eg adder of 2 number) to SDRAM. The input to the peripheral is user defined and once the adding process is completed, it will transfer the result to SDRAM. I wish to use DMA on the transferring of the result. Of course, real project is for image processing. I just used simple example to enhance understanding since I am starting from zero.