This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Doubt regarding Algalloc

Hi all,

I m working on DM6437.I have a doubt regarding IALG_Fxn Algalloc function which returnsa table of
memory records that describe the size, alignment, type and memory space of all the buffers required
by the algorithm.

My algorithm requires 2 buffers :

1)external static buffer
2)internal scratch buffer

The algalloc function looks like the following:

/* Request memory for my object */
    memTab[0].size         =     sizeof(VObj);
    memTab[0].alignment =     0;
    memTab[0].space     =     IALG_EXTERNAL;
    memTab[0].attrs     =     IALG_PERSIST;
 

/* Request memory for working buffer 1*/

   memTab[1].size         =     STATE_MEM_SIZE ;
   memTab[1].alignment     =     ALIGN_FOR_CACHE ;
   memTab[1].space         =     IALG_EXTERNAL ;
   memTab[1].attrs         =     IALG_PERSIST ;
 
/* Request memory for working buffer 2 */
  
   memTab[2].size          =     SCRATCH_MEM_SIZE ;
   memTab[2].alignment     =     ALIGN_FOR_CACHE ;
   memTab[2].space          =     IALG_DARAM0 ;
   memTab[2].attrs         =     IALG_SCRATCH ;

I have created external heap(EXTMEMHEAP) and interal heap(L1DHEAP) using the dsp/bios config file.
My L1D(80k) is configured to be -
    64k L1DSRAM (full 64k is used for internal heap)
    16k L1DCACHE
I am not using DSKT2 module as of now.   

ALG_allocMemory function calculates memTab.base for each buffers. While doing so, both the buffers are
allocated in the external memory. memTab.base has the address which is in the external memory.
 
 1)The scratch buffer which was suppose to be allocated in internal memory is being allocated
 in external memory.why is this so??
 
 2)I dont find the usuage of memTab.space in ALG_allocMemory which inturn calls memalign function.
 so who takes care of this parameter.
 
 Waiting for your replies,
 
 Regards,
 Sandeep

  • Hello,

    I working with omap L138. I try to run codec mpeg4enc lib. When I go to the line:

    n = fxns->algAlloc(params, &fxnsPtr, memTab);

    in alg_create.c file I get InterruptDefaultHandler.  I don't define this function myself. Should I do that? In ialg.h I have only:

    Int     (*algAlloc)(const IALG_Params *params,struct IALG_Fxns **parentFxns, IALG_MemRec *memTab);

    Maybe somebody has project with this lib in ccs 5 ? It can be for another board or processor.

    Regards,