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.

A problem about the using of ListMP module

Hi,

I am just begining to study the multicore dsp.And i got a problem when i run a program about the ListMP module in my 6472EVM .I attached the main code in the following:

 

Void tsk0_func(UArg arg0, UArg arg1)

{

   Rec rec1;

   gateHandle = GateMP_getDefaultRemote();

ListMP_Params_init(&listParams);

listParams.gate = gateHandle;

listParams.name = "myListMP";

listParams.regionId = 0;

listHandle = ListMP_create(&listParams);

System_printf("ListMP_create sucess\n");

rec1.data = MultiProc_self();

ListMP_putTail(listHandle,&rec1.elem);

System_exit(0);

}

Void tsk1_func(UArg arg0, UArg arg1)

{

int buf[5];

elem = NULL;

while(ListMP_open("myListMP",&listHandle)<0){

     System_printf("ListMP_open failed\n");

    }

    System_printf("ListMP_open sucess\n");

    if(MultiProc_self() != 5){

     buf[MultiProc_self()] = MultiProc_self();

     ListMP_putTail(listHandle,(ListMP_Elem *) &(buf[MultiProc_self()]));

    }else{

     while((elem = ListMP_next(listHandle,(ListMP_Elem *)elem))!= NULL){

     System_printf("ListMP_Elem:%d",elem->data);

     }

    }   

}

main()

{

 

 Ipc_start();

    /* Create a unique 'master' Task if on proc 0 */

    if (MultiProc_self() == 0) {

        Task_create(tsk0_func, NULL, NULL);

    }

    else {

        Task_create(tsk1_func, NULL, NULL);

    }

    BIOS_start();

    return (0);

 

}

the code about SharedRegion in the *.cfg file

var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');

SharedRegion.setEntryMeta(0,

    { base: SHAREDMEM, 

      len:  SHAREDMEMSIZE,

      ownerProcId: 0,

      isValid: true,

      name: "SL2_RAM",

      createHeap: true,

    });

 

when i download the program to the 6 cores and start running,I got the problem:

 

ti.sdo.ipc.SharedRegion: line 327: assertion failure: A_idTooLarge: id cannot be larger than numEntries

xdc.runtime.Error.raise: terminating execution

 

Could anyone give me some solutions? Thank you.

I use the CCS Version: 4.2.0.10012 and ipc_1_21_02_23. The program is running in the TMS320C6472EVM.

 

Regards

Jianlei

 

 

 

  • I think your buf[] is not coming from a shared region.

    I recommend you take a look at the Notify/MessageQ example as a starting place too.

    Judah

  • Thank you fot your reply!

    I reference the Page 3-45 of  SYS/BIOS Inter-Processor Communication (IPC) and I/O User’s Guide.pdf, and put the code 

    buf = Memory_alloc(SharedRegion_getHeap(0),(seizof(Rec)),128,NULL) my program.

     

    typedef struct Rec {

        ListMP_Elem elem;

        Int data;

    } Rec;

    int buf[6];

    Rec* elem;

    Void tsk0_func(UArg arg0, UArg arg1)

    {

       Rec rec1;

       gateHandle = GateMP_getDefaultRemote();

    ListMP_Params_init(&listParams);

    listParams.gate = gateHandle;

    listParams.name = "myListMP";

    listParams.regionId = 0;

    listHandle = ListMP_create(&listParams);

    System_printf("ListMP_create sucess\n");

    rec1.data = MultiProc_self();

    ListMP_putTail(listHandle,&rec1.elem);

     

    buf = Memory_alloc(SharedRegion_getHeap(0),(seizof(Rec)),128,NULL);

        System_exit(0);

    }

    Void tsk1_func(UArg arg0, UArg arg1)

    {

    elem = NULL;

    while(ListMP_open("myListMP",&listHandle)<0){

         System_printf("ListMP_open failed\n");

        }

        System_printf("ListMP_open sucess\n");

        if(MultiProc_self() != 5){

         buf[MultiProc_self()] = MultiProc_self();

         ListMP_putTail(listHandle,(ListMP_Elem *) &(buf[MultiProc_self()]));

        }else{

         while((elem = ListMP_next(listHandle,(ListMP_Elem *)elem))!= NULL){

         System_printf("ListMP_Elem:%d",elem->data);

         }

        }

    }

    /*

     *  ======== main ========

     */

    Int main(Int argc, Char* argv[])

    {

        Ipc_start();

         /* Create a unique 'master' Task if on proc 0 */

        if (MultiProc_self() == 0) {

            Task_create(tsk0_func, NULL, NULL);

        }

        else {

            Task_create(tsk1_func, NULL, NULL);

        }

        BIOS_start();

        return (0);

        }

    When i build it ,I got problem as follow:

    "../listMP.c", line 107: warning: function declared implicitly

    "../listMP.c", line 107: error: type name is not allowed

    "../listMP.c", line 107: error: expression must be a modifiable lvalue

    2 errors detected in the compilation of "../listMP.c".

    i have add the "#include<xdc/runtime/memory.h>" and "#include <ti/ipc/SharedRegion.h>"at the begining of program.

    and i just want to realize the second case of the using of IPC introduced in the SYS/BIOS Inter-Processor Communication (IPC) and I/O User’s Guide.pdf(Page 1-6).

     

    Best regards,

    Jianlei

     


  • Sorry, but its not very helpful when I don't know what line is 107 referencing.

    I've attached a simple ListMP example that might help you out.

    8372.testsListMP.zip

    Judah

  • judah,

    In your sample code in your Tester struct (that's being passed back and forth), you added a 30 word dummy buffer "to make flag on 2nd cache line."  Could you explain why that was necessary and what changes in the code would be required if that weren't there?

     

  • Alex,

    Its not necessary.  This is a test program.  I was making sure that things still worked if my message is larger than a single cache line.

    Judah

  • Ah, okay.

  • judah,

    I am sorry i forgot ro mark the error line. And thank you for your example,By your code,i found the error of my code because i didn't define the type of the buf correctly.

    But now i got problem of id cannot be larger than numEntries ,too. I didn't set the value of the id and the numEntries in my code.

    By Single-step debugging, i found when the code run to the ListMP_putTail(listHandle,&rec1.elem); the error occured.

    In order to debug easily,i changed the Void tsk1_func(UArg arg0, UArg arg1) as followes

    Void tsk1_func(UArg arg0, UArg arg1)

    {

    //Not code  in tsk1_func and tsk1_func runs in the core1 to core5.

    }

     

    the error info:

     

    ti.sdo.ipc.SharedRegion: line 327: assertion failure: A_idTooLarge: id cannot be larger than numEntries

    xdc.runtime.Error.raise: terminating execution

     

     

    BTW,could i use 2 or more *.cfg files in one project?in your  

    8372.testsListMP.zip there is one source file and 2 CFG files. And if i want to use the ListMP functions like 

    ListMP_getTail(),ListMP_insert(),ListMP_next()....,should i call the ListMP_open() firstly?


     

    Best regards,

    Jianlei

     

  • Hi Juda,

     

    I found the listMP very code very usefull but could not run it  on the C6678.  Can you please help with this. I have the followimg errors:

    <Linking>

    "./configPkg/linker.cmd", line 122: warning #10096-D: specified address lies outside memory map

    error #10264: DEFAULT memory range overlaps existing memory range L2SRAM

    error #10264: DEFAULT memory range overlaps existing memory range MSMCSRAM

    error #10264: DEFAULT memory range overlaps existing memory range DDR2

    error #10010: errors encountered during linking; "listMP.out" not built

     

    Regards

     

    Naim

  • Naim,

    The issue you list above have nothing to do with the actual code.  Its your platform or linker command file that is problematic.

    I'm not sure what you are trying to do but the best thing would be to clean your project, choose the evm6678 platform from the RTSC tab and rebuid the project.

    Judah