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.

RTSC/BIOS6 and conditional statements

We have a common code set that works on the multiple cores of a TCI6486/C6472. The *ONLY* difference is the section of external DDR2 they can use. DSP BIOS 5.4 supports both access to system envronment variables and conditional processing (if, else). Thus my *.TCF contains the segment:

if (environment["CORE"] == 1) {
bios.MEM.instance("DDR2").base = 0xe6000000; // Core 1
print("Core 1 selected");
}
else if (environment["CORE"] == 2) {
bios.MEM.instance("DDR2").base = 0xe8000000; // Core 2
print("Core 2 selected");
}
else if (environment["CORE"] == 3) {
bios.MEM.instance("DDR2").base = 0xea000000; // Core 3
print("Core 3 selected");
}

...

What is the best method for duplicating this functionality in DSP BIOS 6 / RTSC / XDC?  Does DSP BIOS 6 /RTSC/XDC support conditional processing (I see that I can access system environment variables)?

 

  • Hi Calvin,

    If you use RTSC content like BIOS6 the memory map maybe specified by defining a RTSC Platform. Refer to http://rtsc.eclipse.org/docs-tip/Using_Targets_and_Platforms#Platforms for more details on the RTSC platform model. In CCS4 there is a tool known as the Platform Wizard that can be used to create RTSC platforms. A flash demo of the tool is available at http://rtsc.eclipse.org/docs-tip/Demo_of_the_RTSC_Platform_Wizard_in_CCSv4. In your system you can use the platform wizard to create a platform package per core. If you are using CCS4 as your development environment you can then refer to the RTSC platform in your project (refer to the platform wizard flash demo for details). If you are using the command line XDCtools you can use specify your platform as an argument to the configuro tool. Depending on your development environment we can provide more guidance on how to proceed.

     

     

    Regards

    Amit Mookerjee

     

    If my reply answers your question please mark the thread as answered.

     

  • Amit,

    I have already suffered through that document and it does not even mention what I need to do.  The wizard only helps if you are doing something very trivial.

     

    What I need to know is: Within the platform file, how do I specify a different  "base" value keyed to a system environment variable? Currently (non RTSC) I have a batch file that calls CCS4.1 (in batch mode) 6 times setting an environment variable before each call. What I end up with is 6 *.out files each compiled with the same source but with a modified *.TCF version specific to each C6486 core. I need the same or "equivalent" functionality when using BIOS 6 / RTSC.

    Please do not suggest multiple projects or configurations. Both are totally un-managable for a professional development team. From the inflexible project handling of Eclips/RTSC, having multiple platform files also seems to be untenable.

    -Calvin

  • Calvin,

    You can use the 'config.bld' file to define your platform as well. So here are the steps:'

    Create a 'config.bld' - an XS script file where you can define your platform- file in your project. . Your file will look something like this:

     

    /* Set DDRBASE based on some environment variables */

    var DDRBASE;

    if  (environment['CORE'] ==0)  {

    DDRBASE = 0xC3000000;

     } else if  (environment['CORE'] ==1) {

    ...................

    }

     

    /* Platform definition : ti.platforms.generic:myPlat */

    Build.platformTable["ti.platforms.generic:myPlat"] = {

        deviceName: "TMS320DA830",

        catalogName: "ti.catalog.c6000",

        clockRate: 600,

        externalMemoryMap: [

            ["EXTMEM", {

                name: "EXTMEM",

                base: DDRBASE,

                len:  0x01000000,

                space: "code/data"}

            ],

        ]

    };

     

    Now refer to the config.bld file in the RTSC configuration project by editing the RTSC project properties : Right click on the project and select "Build Properties->C/C++ Build->Tool Settings->Advanced Options". Edit the "Build configuration file" text box to point to your "config.bld" script. Now change the RTSC platform for your project : Right click on the project and select "Build Properties->CCS Build->RTSC". Add the name of the platform that you created in your config.bld script (eg. ti.platforms.generic:myPlat) in the RTSC Platform textbox. Now you should be all set to build your program using one project.

     

    Let me know if this helps.

     

    Thanks

    Amit

     

  • Perfect! That's exactly what I was looking for.

     

    Many thanks!!

    Calvin