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.

How to partition DSPLINK

Other Parts Discussed in Thread: OMAPL138

Hi all,

     Suppose if in previous architecture if we have made use of DPRAM to communicate between the MCF(freescale) and DSP. separate core.

How to do that with DSPlink. I wanted to create three message tags and separate memory space for them.

How to partition the memory suppose if  I have alloted 2MB for DSPLINK.

 

Your help would be much appreciated.

 

 

ZAheer.

  • FYI

     

    Sorry, we are using OMAPl138.

     

     

    Zaheer

  • With DSPLink, you can create message queues and allocate messages to be sent back and forth.  Those messages will be allocated from the region you've assigned for DSPLink.  As an alternative, you can use CMEM on the ARM side (assuming you are running Linux) to allocate contiguous memory blocks that can be shared.

    Regards, Daniel

  • Daniel,

          thanks for guiding the thread, Here QNX we are using on GPPOS side.

    >With DSPLink, you can create message queues and allocate messages to be sent back and forth.

    I have wrote sample application for this and tried, it is working.

    >Those messages will be allocated from the region you've assigned for DSPLink.

    OKay, I am clear about this.

    >As an alternative, you can use CMEM on the ARM side (assuming you are running Linux) to allocate contiguous memory blocks that can be shared.

     

    Here I think I do not need CMEM for this.. space allocated for DSPlink will work fine.

    Suppose , take for example, if I wanted to create 3 message tags of varying space in DSPLink. Is it as simple as creating message structure as we do in sample message example that came with dsplink. The difference would be we will be requiring 3 separate structures for 3 messages? Aligned to the DSPlink space in the same way as we do in that sample application.

     

    --

    Zaheer

  • zaheer sheriff said:
    Suppose , take for example, if I wanted to create 3 message tags of varying space in DSPLink. Is it as simple as creating message structure as we do in sample message example that came with dsplink. The difference would be we will be requiring 3 separate structures for 3 messages? Aligned to the DSPlink space in the same way as we do in that sample application.

    So I think I have done what you are asking, and really it only came down to the Pool configuration for DSPLink.

     

    /* Number of pools configured in the system.                                  */
    #define NUM_POOLS          1

    /* Number of local message queues                                             */
    #define NUM_MSG_QUEUES     3

    /* Number of BUF pools in the entire memory pool                              */
    #define NUM_MSG_POOLS      6

    /* Number of messages in each BUF pool.                                       */
    #define ZCPYMQT_MSG_CNT       (2)
    #define ASYNCLOCATE_MSG_CNT   (2)
    #define ASYNCERROR_MSG_CNT    (4)

    /* ID of the POOL used by C6Run.                                              */
    #define COMMON_POOL_ID        (0)

    /* Message sizes managed by the pool */
    static Uint32 PoolBufSizes[NUM_MSG_POOLS] =
    {
      DSPLINK_ALIGN (CIO_MSG_TOTALSIZE, DSPLINK_BUF_ALIGN),
      DSPLINK_ALIGN (CONTROL_MSG_TOTALSIZE, DSPLINK_BUF_ALIGN),
      DSPLINK_ALIGN (RPC_MSG_TOTALSIZE, DSPLINK_BUF_ALIGN),
      ZCPYMQT_CTRLMSG_SIZE,
      DSPLINK_ALIGN (sizeof(MSGQ_AsyncLocateMsg), DSPLINK_BUF_ALIGN),
      DSPLINK_ALIGN (sizeof(MSGQ_AsyncErrorMsg), DSPLINK_BUF_ALIGN)
    };

    /* Number of messages in each pool */
    static Uint32 PoolNumBuffers[NUM_MSG_POOLS] =
    {
      CIO_MSG_CNT,
      CONTROL_MSG_CNT,
      RPC_MSG_CNT,
      ZCPYMQT_MSG_CNT,
      ASYNCLOCATE_MSG_CNT,
      ASYNCERROR_MSG_CNT
    };

    /* Definition of attributes for the pool based on physical link used by the transport */
    static SMAPOOL_Attrs PoolAttrs =
    {
      NUM_MSG_POOLS,
      PoolBufSizes,
      PoolNumBuffers,
      FALSE  /* exact match required on size; was TRUE */
    };

     

    Then in my code I use

    status = POOL_open(POOL_makePoolId(processorId, COMMON_POOL_ID), &PoolAttrs);

     

    Then when I want to allocate a message, I use the following:

     

    status = MSGQ_alloc(COMMON_POOL_ID, sizeof(CIO_Msg), (MSGQ_Msg *) msg );

     

    In my case I have three queues (CIO, RPC, and CONTROL) and the number of message (the CIO_MSG_CNT, RPC_MSG_CNT, and CONTROL_MSG_CNT) are part of the PoolAttrs structure, so that the Pool allocation can be large enough to support simultaneously allocating all the messages of the sizes I specified (the CIO_MSG_TOTALSIZE, RPC_MSG_TOTALSIZE, and CONTROL_MSG_TOTALSIZE). If you only have one message queue, you should be just fine passing these variously sized messages over that one queue, but I think the allocation has to be done like this.

    All I can say for sure is that the above works for me under Linux (never used QNX, so I'm not sure what might change, if anything).

    Regards, Daniel