Altera_Forum
Honored Contributor
13 years agoALT_AVALON_DMA_NSLOTS - how to increase FIFO size for DMA scheduler
Looking into HAL driver code for DMA I've found, that scheduler array is limited by ALT_AVALON_DMA_NSLOTS macro, which is
defined in altera_avalon_dma.h as (4). This apparently means, that no more than 4 records for rx and tx DMA can be scheduled by consecutive calls to tx send and rx prepare. What is even worse is, that one cannot schedule ALT_AVALON_DMA_NSLOTS, but only ALT_AVALON_DMA_NSLOTS-1 transactions. Calling functions alt_dma_rxchan_depth and alt_avalon_dma_space it returns correctly '3' in both cases. Now, my big trouble is, that I want to schedule 8 of those transactions in one go. So I just though to increase ALT_AVALON_DMA_NSLOTS in one of my files, and that it would do the job. Well, it does not. printing ALT_AVALON_DMA_NSLOTS and ALT_AVALON_DMA_NSLOTS_MSK gives correct values, but depth and space functions return only '3' as the define was not taken into account. Looking more I'v found, that alt_sys_init.c includes already altera_avalon_dma.h, so probably this is the place, where I should put my '#define ALT_AVALON_DMA_NSLOTS (8)' macro before the inclusion of the altera_avalon_gma.h. Well, this function only partially: whereas alt_dma_rxchan_depth returns now correctly '7', the alt_avalon_dma_space returns again '3'. No idea what's going on here. Did someone already try to setup different FIFO depth? How that should be done correctly? The issue with alt_sys_init.c is, that it gets overwritten every time new BSP is generated. Hence I presume this should be somehow setup by TCL command when using create-this-bsp..... any help kindly appreciated.