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.

DNUM is not available at compile time

Hi,

I want to build a core dependent code using target compilation.

Tried to use DNUM bu no success (see example code below). It seems that DNUM can only be used during run time! As such, what can I use to replace DNUM?

thanks.

#if (DNUM == 0)

//core 0 code

#endif

#if(DNUM == 1)

//core 1 code

#endif

khaled.

  • Khaled,

    Any .out file can be loaded through any core. The loader or bootloader will place the program and data at the addresses as indicated in the .out file. One method of multicore processing is to use a single .out file that is loaded to local L2 memory on each core in the device and let each core run from its own local copy.

    This is the first scenario in the article In the TI Wiki Pages named Using DSP/BIOS on Multi-Core DSP Devices. It has not been updated for CCSv5 and SYS/BIOS and C66x, but the relevant parts for you should be just fine. There are three example scenarios for implementing a multi-core project, with the first being a single image loaded onto all the cores.

    The second scenario is similar to what you want to do, having a separate project for each of the cores. You could improve it some by having a single copy of the main source file and using a link to it in the projects for the other cores. Then you could have a header file in each project that defines the core number that you would like to use.

    There is no way that the compiler can know which core you are building the project for. That is different than CCS knowing which core to load a .out file to, but the compiler only knows what you tell it in your own #defines for something like this.

    Regards,
    RandyP