Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21591 Discussions

DMA controller in SOP buidler question

Altera_Forum
Honored Contributor II
1,403 Views

I'm using SOPC Builder to integrate into my system v8.0 sp1. 

 

* A new DSP builder component with 2 Avalon Slave (Read & write Fifo's) 

* 2 DMA controller (Avalon master) to load data to the dsp block and store data in memory from DSP block. 

 

I've conected in SOPC Builder following the image attached. 

 

The compilation in quartus ended with no errors, but I'm not sure about what exactly transfer data from memory to the dsp_block. because I have only seen the base adress of both DMA controllers but I cannot see the base address for this component in system.h.  

 

I'm thinking of using HAL instructions in order to manage flow of data, but I think I'll need source and destination for each transaction. I don't know how I can do it if the base address of DSP builder component doesn't appear in system.h 

 

any suggestion??
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
695 Views

You are correct in all of your assertions. You have not made any mistakes. The reason the base addresses of your read and write slave ports do not show up in your "system.h" file is because they are not connected to the NIOS processor's data bus. Therefore the NIOS has no knowledge of their existence. 

 

So how to get around this.  

1 - You can go ahead and connect the slaves to the NIOS' data master even though you have no reason to access them. This will force the base addresses to show up in system.h. 

 

2 - I seem to remember there being some way to force SOPC builder to include the component information in "system.h" without attaching it to the bus. Let me look into this and see if I can find it. I might be wrong on this. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
695 Views

Okay. New in 8.0 there is a script called sopc-create-header-files. If you run this script on your SOPC system (.sopcinfo), it will supposedly create header files for your components that you can include in your project. You would run this from the NIOS II Command Shell. 

 

Try it out. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
695 Views

Hi Jake,  

 

I've been surfing in the NIOS software development handbook to find the HAL API in order to launch transaction of data by using Avalon DMA Controller. 

 

Load data to DSP block by Master write DMA 

tx = alt_dma_txchan_open ("/dev/dma_0")) alt_dma_txchan_prepare (tx, buffer, 1024, dma_done, NULL) 

 

store data from DSP block by Master Read DMA 

rx = alt_dma_rxchan_open ("/dev/dma_0")) alt_dma_rxchan_prepare (rx, buffer, 1024, dma_done, NULL) 

 

By using these functions I don't need to know the base address of my DSP block if I have it well connected to the both DMA masters, in such case, Do I'll need always a pair of master DMA controller for each DSP block??
0 Kudos
Reply