Forum Discussion
The problem of SGDMA descriptor
Hi:
I am trying to use the SGDMA to transfer data,but I find it's hard to write the descriptor.I spend o lot of time to read the desgin example SG-DMA,it's hard to be understand. Is there someone can give me a simple example of the SGDMA. thanks a lot.8 Replies
- Altera_Forum
Honored Contributor
I wouldn't waste your time with the existing SGDMA, but rather use the one that is provided here (http://www.altera.com/support/examples/nios2/exm-modular-scatter-gather-dma.html).
The latter is both more capable and designed more sensibly. It's what I advocate for any designs that require SGDMA capabilities going forward. Cheers, - slacker - Altera_Forum
Honored Contributor
thank you for your suggestion.
but i want to know the Scatter-Gather DMA Controller Core PDF shows the mode of the descriptor data struct is: typedef struct { alt_u32 *read_addr; alt_u32 read_addr_pad; alt_u32 *write_addr; alt_u32 write_addr_pad; alt_u32 *next; alt_u32 next_pad; alt_u16 bytes_to_transfer; alt_u8 read_burst; /* Reserved field. Set to 0. */ alt_u8 write_burst;/* Reserved field. Set to 0. */ alt_u16 actual_bytes_transferred; alt_u8 status; alt_u8 control; } alt_avalon_sgdma_packed alt_sgdma_descriptor; but in the code i didn't find the structure. thank you very much. - Altera_Forum
Honored Contributor
Take a look at this software: http://www.nioswiki.com/exampledesigns/sgdma
Really though you shouldn't need to modify the structure directly, there is an API for creating descriptors and sending them to memory for the SGDMA to access. There are a lot of pitfalls you can run into since the SGDMA accesses the descriptors in memory so you have to be very careful how you synchronize between the CPU and SGDMA engine. - Altera_Forum
Honored Contributor
thank you for your suggestion!
- Altera_Forum
Honored Contributor
Dear BadOmen,
Above link seems to be very old and it opens wiki home page when i click. Kindly provide an updated link for Design Example of SGDMA. Nandish Jasani. - Altera_Forum
Honored Contributor
It's probably this page: http://www.alterawiki.com/wiki/sgdma.
- Altera_Forum
Honored Contributor
Yep that's the page I was referring to back then. I heard that some are having difficulty getting that design working these days so if you get stuck I wouldn't spent too much time trying to debug it.
- Altera_Forum
Honored Contributor
Can you share the SGDMA example with me? I find it's hard to transfer several descriptors without software intervention. And can you help me ? Thank you very much.