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.

POOL Buffer Sizes

How do I calculate the size of a POOL buffer if I'm going to set exactMatchReq=TRUE?  Obviously I can figure out the size of the data that I am sending, but I recall reading somewhere that each communication method required different header sizes that need to be included in the buffer size.  I will be using the MSGQ for data transfer.

Thanks.

  • Naturally, I found my answer in the DSPLINK samples.   mapregion.c has a structure set up that includes the payload and the MSGQ_MsgHeader, the size of which is defined in inc/usr/msgqdefs.h. Then you just use DSPLINK_ALIGN to make sure you are cache aligned.  I believe in most cases DSPLINK_BUF_ALIGN should be 128.

    --------inc/usr/msgqdefs.h----------------------

    #define MSG_HEADER_RESERVED_SIZE    2u

    typedef struct MSGQ_MsgHeader_tag {

        Uint32    reserved [MSG_HEADER_RESERVED_SIZE] ;

        Uint16    srcProcId    ;

        Uint16    poolId       ;

        Uint16    size         ;

        Uint16    dstId        ;

        Uint16    srcId        ;

        Uint16    msgId        ;

    } MSGQ_MsgHeader ;

    -----------inc/usr/archdefs.h-----------------

    #define DSPLINK_BUF_ALIGN     128

    ---------src/samples/mapregion/mapregion.c----------------------

    typedef struct SampleMessage_tag {

        MSGQ_MsgHeader msgHeader     ;

        Uint32         gppWriteAddr  ;

        Uint32         dspWriteAddr  ;

        Uint32         size          ;

        Uint32         scalingFactor ;

    } SampleMessage ;

    #define APP_MSG_SIZE  DSPLINK_ALIGN (sizeof (SampleMessage), DSPLINK_BUF_ALIGN)

     

     

  • Glad to see this was resolved