Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

The problem of SGDMA descriptor

Altera_Forum
Honored Contributor II
2,213 Views

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.
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
530 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
530 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
530 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
530 Views

thank you for your suggestion!

0 Kudos
Altera_Forum
Honored Contributor II
530 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
530 Views

It's probably this page: http://www.alterawiki.com/wiki/sgdma.

0 Kudos
Altera_Forum
Honored Contributor II
530 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
530 Views

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.

0 Kudos
Reply