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.

C6608 Multicore Memory Linking

Hi, 

I am using CCSv5 to compile multicore code for C6608 processor. I am facing the following issue:

In core 1, I have some variables declared in a particular memory section in M3, say .TempShare section.

In core 2, I want to use only some of the variables that are present in the .TempShare section.  The unused variables are not even declared in the core 2. 

I have a linkercommand file where I have declared the origin and the length of the .Tempshare section. The linker command is same in both the cores.

Now in order to make sure that the common variables that are used in both the cores, have the same addresses, I need to link all the source files of the unused variables in the core 2 as well. Only then the memory locations are same. 

Is there a work around to force the compiler/linker to check the memory sections across cores and then allocate address ? 

Also, one more issue is, even if the declarations of unused variables are present in core 2, unless they are accessed, there is no memory allocation done for those variables.  How can we force the compiler to assign the memory irrespective of the variable being used in the code or not ?

Thanks,

Vaishnavi

  • Vaishnavi JS said:
    s there a work around to force the compiler/linker to check the memory sections across cores and then allocate address ? 

    The linker command file supports the preprocessor directives #include and #define very much like C does.  So, you could create several #define names in one place, and #include it in multiple linker command files.  Thus the things which must be shared are defined in one spot and automatically propagate out as needed.

    Vaishnavi JS said:
    if the declarations of unused variables are present in core 2, unless they are accessed, there is no memory allocation done for those variables.  How can we force the compiler to assign the memory irrespective of the variable being used in the code or not ?

    I presume these variables are not removed by some optimization by the compiler.  Instead, they are removed during the link.  I further presume these variables are presented in a normal object file, and not a library.  Please see the section of the C6000 assembly tools manual titled Retain Discarded Sections (--retain Option) .

    Thanks and regards,

    -George