DSPLink POOL Module Overview

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

DSPLink POOL Module Overview

Overview

The POOL component provides APIs for configuring shared memory regions across processors.
These buffers are used by other modules from DSP/BIOS Link for providing inter-processor communication functionality.

Availability

The POOL module as part of MSGQ is available in DSPLink releases from 1.20 onwards.
However, APIs for allocating and freeing buffers, and dynamic configuration are available from 1.40.03 onwards.

Features

The specific features provided by this module are:

This component is responsible for providing a uniform view of different memory pool implementations, which may be specific to the hardware architecture or OS on which DSPLink is ported. This component is based on the POOL interface in DSP/BIOS.
The DSPLink POOL is not a heap-based pool. It is a fixed-size buffer pool. It requires the specific configuration of number of buffers and sizes as will be used by the application. The exactMatchReq property only allows users the flexibility of configuring an approximate size for each buffer. However, the maximum number of buffers still must be configured.

Usage

Header files

The header file to be included for using POOL module on both GPP and DSP-side is pool.h

#include <pool.h>

On DSP-side, additional header file sma_pool.h is required to be included. This contains the definitions for DSPLink-specific multi-processor POOL implementation.

#include <sma_pool.h>

Dependencies

Configuration

Configuration parameters

The POOL_open () call is used to configure the shared memory requirement for the application. Since the pool is shared between DSP and GPP, the sizes of the buffers must be cache aligned. DSPLink provides an API DSPLINK_ALIGN which can be used to get the cache aligned size.
For SMA Pool, we need to configure a parameter of type SMAPOOL_Attrs in the POOL_open call. The POOL_open call takes a structure of type SMAPOOL_Attrs for the POOL_open call. The elements in the structure are:

Exact match required

Buffer configuration

To set the pool attributes, you need to know how many buffers that you need in the shared memory as well as their size. Depending on your application needs, you configure your pool according to the size and the number of the buffers required. You can also configure the pool to return the buffer only if an exact match size is configured or to return a buffer with a size which fits best to what has been asked.

Example

If you want to configure the pool (with exact match TRUE) to allocate 10 buffers of size 128, 10 buffers of size 512 and 10 buffers of size 2048 you may configure the pool as follows.

#define NUM_BUF_SIZES   3 /* 3 buffer sizes to be configured */
#define SAMPLE_POOL_NO  0 /* Pool no as in the config CFG_<PLATFORM>.c.
 
Uint32        numBufs [NUM_BUF_SIZES] ;
Uint32        size [NUM_BUF_SIZES] ;
SMAPOOL_Attrs poolAttrs ;
 
 . . .
 
if (DSP_SUCCEEDED (status)) {
    size    [0] = 128 ;
    numBufs [0] = 10 ;
 
    size    [1] = 512 ;
    numBufs [1] = 15 ;
 
    size    [2] = 2048 ;
    numBufs [2] = 5 ;
 
    poolAttrs.bufSizes      = (Uint32 *) &size ;
    poolAttrs.numBuffers    = (Uint32 *) &numBufs ;
    poolAttrs.numBufPools   = NUM_BUF_SIZES ;
    poolAttrs.exactMatchReq = TRUE ;
 
    /* Make the pool id  from pool no and dsp processor id . Applicable
     * GPP side only
     */
    poolId = POOL_makePoolId (ID_PROCESSOR ,SAMPLE_POOL_NO) ;
    status = POOL_open (poolId, &poolAttrs) ;
    if (DSP_FAILED (status)) {
        APP_Print ("POOL_open () failed. Status = [0x%x]\n", status) ;
    }
}

Note: The above is just a dummy representation of how to configure the POOL. In real world applications, this is more tuned to the application buffer size requirements.

In the above example:

Usage

API usage to be added ...

Other POOL topics

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox