Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Controlling Burst Mode in software

Altera_Forum
Honored Contributor II
1,903 Views

Hi. I have a verilog module that buffers a considerable amount of samples and when the buffer gets full id like to empty the buffer using a Nios processor for some computations. Using single IOR istructions I guess consumes a lot of time. I have noticed that Avalon MM supports burst cycles. I have read avalon specifications and I know how to write my verilog module in order to be compatible with burst mode but i don't know how to use it in Nios software. I mean is there any instruction like IOR for doing such thing? 

Thnx in advance
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
1,040 Views

The only bursting that Nios can directly perform is when using a code or data memory cache. To move data between two slave components using bursting you can use a DMA controller. When writing your own custom components you could also consider including a bursting Avalon master in your component.

0 Kudos
Altera_Forum
Honored Contributor II
1,040 Views

I want the Nios processor to read my buffer in burst mode. In this case Nios processor is master and my buffer(custom component) is slave, right?

0 Kudos
Altera_Forum
Honored Contributor II
1,040 Views

 

--- Quote Start ---  

I want the Nios processor to read my buffer in burst mode. 

--- Quote End ---  

As I mentioned in my previous response, the only way Nios can perform a burst transfer is through the data or code cache. If you enable the data cache in Nios and enable bursting for the cache and then if you access your component via a memory pointer, then Nios will read from your component using bursts. You need to specifically access the buffer through a memory pointer instead of using IORD or IOWR operations as IO operations will bypass the cache.
0 Kudos
Altera_Forum
Honored Contributor II
1,040 Views

Tnx for ur help!!. So do I have to instantiate a DMA controller core in SOPC builder? another question : so u mean i instantiate a pointer like :"" int *p"" and assign the address of my component to the pointer ? and use something like "memcpy" to transfer the data?  

Thank u very very much!
0 Kudos
Altera_Forum
Honored Contributor II
1,040 Views

 

--- Quote Start ---  

So do I have to instantiate a DMA controller core in SOPC builder? 

--- Quote End ---  

To move data directly between two slaves you can use a DMA controller. Technically, in this case it is the DMA controller doing the burst transfers, not the Nios processor. The Nios processor is only indirectly performing a burst by controlling the DMA controller. 

--- Quote Start ---  

so u mean i instantiate a pointer like :"" int *p"" and assign the address of my component to the pointer 

--- Quote End ---  

Yes, that is basically what I mean. Although, you don't actually have to use a pointer variable. Instead you can cast the base address to a pointer type which will generate more efficient code in some cases. As you suggested, you can then use things like memcpy or you can dereference the pointer directly. 

 

If you are simply moving data around and the Nios processor does not actually need to manipulate the data at all, then using DMA will probably be the faster approach. When using DMA, the Nios processor can also continue to do other things in parallel while the DMA is working. 

 

If you need to manipulate the data within Nios itself, relying only on the bursting of the data cache instead of DMA could be faster. Also, if performance isn't critical this is probably the easier method to implement.
0 Kudos
Altera_Forum
Honored Contributor II
1,040 Views

Thanks so much!!! U helped me a lot!!!!! Thanks again!!!!!!!!!!!!!!!!!!!!!!!:)

0 Kudos
Reply