Forum Discussion

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

exporting DMA done signal to "outer world"

Hi

I have an SOPC builder system containing (among other modules) NIOS, DMA and a bus to costume HW outside the SOPC builder.

when the DMA is done, it gives an interrupt to the NIOS. I would like to use this signal in the costume HW as well. how can I do that in the SOPC builder?

I'm using QII 8.1 if that's relevant

thanks in advance.

4 Replies

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

    I never tried this, but I think that in your sopc system, irq signals are wired through a 32 bit std_logic_vector named cpu_data_master_irq.

    So you can do one of these:

    - after every time you rebuild with sopc builder, you manually modify the generated .vhd file and create an output port connected to this signals. Take a look at this thread: http://www.alteraforum.com/forum/showthread.php?t=18464

    - create a custom sopc builder component that automatically makes the above connection
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    A component that contains a interrupt sender/receiver (and maybe a dummy master/slave might be necessary in SOPC Builder) should do the trick. Then you would wire the IRQ you want to export to a conduit.

    Note: that this method will break the DMA driver since it won't know the interrupt is coming from the DMA anymore.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thank you both

    regarding the modifications of the generated files, I think I can generate once a IRQ receiver, edit the generated file to export the signal, and then create a new module in the SOPC builder and use the include HDL files option. this way I don't have to redo this work every time I generate the SOPC system.

    any thoughts on that?

    BadOmen, I didn't understand the note you added. the DMA should behave the same, only the IRQ have to drive 2 destination the NIOS and the outer world (through some work around)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What I meant is if you put an intermediate component between the CPU and DMA that acts as an interrupt splitter then the DMA driver will no longer be associated to the interrupt. This is because the CPU will see the interrupt coming from the splitter and not the DMA. This intermediate component would act as a "hack-less" workaround to the problem. Also Qsys will make this much easier to do as there are various IRQ components at your disposal.

    Your method to generate the DMA, re-import it into to make a static component, then hacking the HDL to export the IRQ signal will work as well. Then you would just have to associate the driver to the "new" component if you use the HAL driver. You might find it easier to just use the DMA driver macros since those just require you to pass in the DMA slave port address.