Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

SGDMA data output issue

Hi,

I just started to learn using sgdma to transfer data from DDR2. I have the sopc attached and please give me some idea if that is correct.

Another issue is that I do not understand how dma communicate between Nios and hardware. I used to use PIO and IOWR and the data is shown on the pio pin. However, I am not able to find some pin related to this dma. Should I add some other component such as fifo? Please give me some hint on this.

Thanks

16 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    This is starting to sound like using a PIO would be a bad idea. If for example the memory holding the data becomes blocking you might have an idle cycle between accesses to the PIO. Sounds more like FIFOs would be your best best with the DMA operating faster than the FIFOs can be drained to protect against underflow.

    While you are looking at DMAs you might want to evaluate this one: http://www.alterawiki.com/wiki/modular_sgdma It's a SGDMA only with a much simplier programming model (to software it looks like the regular DMA with a FIFO buffering descriptors internally).

    --- Quote End ---

    Yeah it seems to me that pio is not a good idea. The project is about some data transferring to DDR2,stay for a while, and get it back with a speed of around 1Gbps. So you think I should use DMA along with the FIFO?

    Looking forward to your suggestion
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    sgdma is best then dma or FIFO. I also have program for dma too.

    Sean
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi sean,

    I agree with you. So now the problem leaves to how to get the data in and out of Nios...Do you have ay suggestions?

    Thanks!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't know what do you mean get data in and out?

    In Nios IDE, to use IOWR/IORD --- write/read.

    Sean
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi sean,

    Sorry I did not make it clear. Let;s refer to the sopc and main.c you show me. The data is already in Nios, right? (alt_u32 create_test_data). Now my case is I have the data outside Nios, which is the output of some verilog module. My question is how to import these data into Nios instead of generate inside Nios?

    Thanks!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Bingomickey,

    I'm having the same kind of trouble and I wanted to know if you managed to send your data from your hardware into your SOPC Nios component?

    In my case I want to send data from my Nios to my hardware component.

    I'm thinking about using multiple PIO with several FIFO but I dread that the latency may be too long.

    Thank you in advance!