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.

xdc error: L1DSRAM not defined

Other Parts Discussed in Thread: SYSBIOS

I'm attempting to build some DMAN3/ACPY3 code and I nned to define a heap in L1 memory.  xdc is giving me the following error:

Error: memory name 'L1DSRAM' is not defined by the platform

How do I get xdc ro recognize the C674 internal memores?

My .cfg files:

DSPtasks_common.cfg.xs:

var Ipc                     = xdc.useModule('ti.sdo.ipc.Ipc');
var BIOS                    = xdc.useModule('ti.sysbios.BIOS');
var MultiProc               = xdc.useModule('ti.sdo.utils.MultiProc');
var SharedRegion            = xdc.useModule('ti.sdo.ipc.SharedRegion');
var Syslink                 = xdc.useModule ('ti.syslink.ipc.rtos.Syslink');

xdc.loadPackage ('ti.syslink.ipc.rtos');

if ( (Program.platform.$name != undefined) && (Program.platform.$name.match(/evmDA830/)) ) {
    /* Ipc */
    Ipc.sr0MemorySetup = true;
}

/* Ipc configuration */
if ( (Program.platform.$name != undefined) && (Program.platform.$name.match(/evm6472/)) ) {
    /* Set host id */
    Ipc.hostProcId = MultiProc.getIdMeta("CORE5");
    Ipc.generateSlaveDataForHost = true;
}
else if ( (Program.platform.$name != undefined) && (Program.platform.$name.match(/evm6474/)) ) {
    /* Set host id */
    Ipc.hostProcId = MultiProc.getIdMeta("CORE2");
    Ipc.generateSlaveDataForHost = true;
}
else {
    /* Set host id */
    Ipc.hostProcId = MultiProc.getIdMeta("HOST");
}

Ipc.procSync = Ipc.ProcSync_PAIR;

/* Set Shared Region variables by picking up the information from Platform
 * memory map
 */
var sr0MemSection = Program.cpu.memoryMap['SR0'];
var SHAREDREG_0_MEM     = sr0MemSection.base;
var SHAREDREG_0_MEMSIZE = sr0MemSection.len;
var SHAREDREG_0_ENTRYID = 0;
var SHAREDREG_0_OWNERPROCID = Ipc.hostProcId;

var sr1MemSection = Program.cpu.memoryMap['SR1'];
var SHAREDREG_1_MEM     = sr1MemSection.base;
var SHAREDREG_1_MEMSIZE = sr1MemSection.len;
var SHAREDREG_1_ENTRYID = 1;
var SHAREDREG_1_OWNERPROCID = Ipc.hostProcId;

/*
 *  Need to define the shared region. The IPC modules use this
 *  to make portable pointers. All processors need to add this
 *  call with their base address of the shared memory region.
 *  If the processor cannot access the memory, do not add it.
 */
SharedRegion.setEntryMeta(SHAREDREG_0_ENTRYID,
    {
      base:        SHAREDREG_0_MEM,
      len:         SHAREDREG_0_MEMSIZE,
      ownerProcId: SHAREDREG_0_OWNERPROCID,
      isValid:     true,
      name:        "shared_region_0",
    });

SharedRegion.setEntryMeta(SHAREDREG_1_ENTRYID,
    {
      base:        SHAREDREG_1_MEM,
      len:         SHAREDREG_1_MEMSIZE,
      ownerProcId: SHAREDREG_1_OWNERPROCID,
      isValid:     true,
      name:        "shared_region_1",
      createHeap:  true
    });

/*
*  Application constants that all three programs use.
*/
Program.global.MSGQ_NAME            = "MSGQ_";
Program.global.HEAP_NAME            = "HeapMemMP";
Program.global.HEAP_ALIGN           =   128;
Program.global.HEAP_MSGSIZE         =   128;
Program.global.HEAP_NUMMSGS         =    10;
Program.global.HEAPID               =     0;

DSPtasks_ti816x_dsp.cfg:

/* Set the BIOS timer frequency  to 32KHz so as to match with the default timer
 * frequency on Linux
 */
var Timer        = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
Timer.intFreq.hi = 0;
Timer.intFreq.lo = 32768;

var System   = xdc.useModule('xdc.runtime.System');
var SysStd   = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;

var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
MultiProc.setConfig("DSP", ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"]);

/* Load common configuration needed for running all SysLink samples */
xdc.loadCapsule("DSPtasks_common.cfg.xs");

var Notify        = xdc.useModule('ti.sdo.ipc.Notify');
var MessageQ      = xdc.useModule('ti.sdo.ipc.MessageQ');
var BIOS          = xdc.useModule('ti.sysbios.BIOS');
var Task          = xdc.useModule('ti.sysbios.knl.Task');
var Sem           = xdc.useModule('ti.sysbios.knl.Semaphore');

var Memory   = xdc.useModule('xdc.runtime.Memory');
Memory.defaultHeapSize = 0x8000;
Program.heap = 0x8000;

/* Configure some BIOS heaps */
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x4000;
heapMemParams.sectionName = ".L1D_HEAP";

/* Create L1DHEAP as global variables so it can be used in C code. */
Program.global.L1DHEAP = HeapMem.create(heapMemParams);

// Place heaps. L1DSRAM is defined in platform file
Program.sectMap[".L1D_HEAP"] = "L1DSRAM";  // L1DHEAP
//Program.sectMap[".EXTERNAL_HEAP"] = "DDR2"; // EXTERNALHEAP
Program.sectMap[".text"] = "DDR2";

/* Task that does the message passing */
var tsk1 = Task.create('&Preprocessing_taskFxn');
tsk1.instance.name = "Preprocessing_taskFxn";
tsk1.arg0 = MultiProc.getIdMeta ("HOST");
tsk1.stackSize = 0x1000;

/* DMAN3 stuff */
var DMAN3  = xdc.useModule('ti.sdo.fc.dman3.DMAN3');
DMAN3.heapInternal  = "L1DHEAP";
DMAN3.heapExternal = "DDR2";
DMAN3.numQdmaChannels = 8;
DMAN3.paRamBaseIndex = 78;
DMAN3.numPaRamEntries = 48;
DMAN3.nullPaRamIndex = 127;
DMAN3.tccAllocationMaskH = 0xffffffff;
DMAN3.tccAllocationMaskL = 0x0;
DMAN3.numTccGroup   = [4, 3, 2, 0, 0, 5];
DMAN3.numPaRamGroup = [4, 4, 2, 0, 0, 5];
DMAN3.qdmaChannels = [0, 1, 2, 3, 4, 5, 6, 7];
DMAN3.maxQdmaChannels = 8;
DMAN3.maxTCs          = 2;

/* ACPY3 stuff */
//var ACPY3  = xdc.useModule('ti.sdo.fc.acpy3.ACPY3');

Lee Holeva

 

  •  

    /* Create L1DHEAP as global variables so it can be used in C code. */
    Program.global.L1DHEAP = HeapMem.create(heapMemParams);

    // Place heaps. L1DSRAM is defined in platform file
    Program.sectMap[".L1D_HEAP"] = "L1DSRAM";  // L1DHEAP
    //Program.sectMap[".EXTERNAL_HEAP"] = "DDR2"; // EXTERNALHEAP
    Program.sectMap[".text"] = "DDR2";

     

     

    Looks to me names don't match. Should be Program.sectMap[".L1DHEAP"]

     

    RV

  • RV said:

    Looks to me names don't match. Should be Program.sectMap[".L1DHEAP"]

    Nope, that's not it.  I tried making the names match and I get the same error from xdc.

    Update:

    I figured this out.  I changed the Platform.xdc file to free-up L1 memory, but I forgot to rebuild the platform package.

    Lee Holeva

     

  • Hi Lee,

    What is the name of the RTSC platform that you are using? The RTSC platform defines the memory map, and the error indicates that the target memory region labeled  L1DSRAM  is not defined by the RTSC platform. You can  view the memory map defined by your platform using the RTSC platform wizard in CCS4/5.

    Regards

    Amit

  • I'm defining my own platform derived from that used by the Syslink TI816x samples.  Hee is the Platform.xdc file:


    metaonly module Platform inherits xdc.platform.IPlatform {

        config ti.platforms.generic.Platform.Instance plat =
            ti.platforms.generic.Platform.create("plat", {
                clockRate:      800.0,
                catalogName:    "ti.catalog.c6000",
                deviceName:     "TMS320TI816X",
                externalMemoryMap: [
                    ["EXT_RAM",
                        {name: "EXT_RAM",     base: 0x80000000, len: 0x10000000, space: "code/data",access: "RWX"}],
                    ["DDR2",
                        {name: "DDR2",        base: 0x94A00000, len: 0x02000000, space: "code/data",access: "RWX"}],
                    ["SR0",
                        {name: "SR0",         base: 0x97600000, len: 0x10000000, space: "code/data",access: "RWX"}],
                    ["SR1",
                        {name: "SR1",         base: 0x96A00000, len: 0x00C00000, space: "code/data",access: "RWX"}],
                ],
                l1DMode:"16k",
                l1PMode:"32k",
                l2Mode:"256k",
        });

    instance :

        override config string codeMemory  = "DDR2";
        override config string dataMemory  = "DDR2";
        override config string stackMemory = "DDR2";

    }

    Now with l1DMode reduced to 16K, I now have L1DSRAM defined, but I seem to be having a problem related to DDR2, as I am getting this error from xdc:

    cle674 package/cfg/platforms...xe674.c...

    "package/cfg/platforms...xe674.c", line 5327 Error: expected an expression

    I've change the .cfg file to:

    /* Set the BIOS timer frequency  to 32KHz so as to match with the default timer
     * frequency on Linux
     */
    var Timer        = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    Timer.intFreq.hi = 0;
    Timer.intFreq.lo = 32768;

    var System   = xdc.useModule('xdc.runtime.System');
    var SysStd   = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    MultiProc.setConfig("DSP", ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"]);

    /* Load common configuration needed for running all SysLink samples */
    xdc.loadCapsule("DSPtasks_common.cfg.xs");

    var Notify        = xdc.useModule('ti.sdo.ipc.Notify');
    var MessageQ      = xdc.useModule('ti.sdo.ipc.MessageQ');
    var BIOS          = xdc.useModule('ti.sysbios.BIOS');
    var Task          = xdc.useModule('ti.sysbios.knl.Task');
    var Sem           = xdc.useModule('ti.sysbios.knl.Semaphore');

    var Memory   = xdc.useModule('xdc.runtime.Memory');
    Memory.defaultHeapSize = 0x8000;
    Program.heap = 0x8000;

    /* Configure some BIOS heaps */
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = 0x4000;
    heapMemParams.sectionName = ".L1D_HEAP";
    /* Create L1DHEAP as global variables so it can be used in C code. */
    Program.global.L1DHEAP = HeapMem.create(heapMemParams);

    heapMemParams.size = 0xC0000;
    heapMemParams.sectionName = ".EXTERNAL_HEAP";
    Program.global.EXTERNALHEAP = HeapMem.create(heapMemParams);

    // Place heaps. L1DSRAM is defined in platform file
    Program.sectMap[".L1D_HEAP"] = "L1DSRAM";  // L1DHEAP
    Program.sectMap[".EXTERNAL_HEAP"] = "DDR2"; // EXTERNALHEAP
    Program.sectMap[".text"] = "DDR2";

    /* Task that does the message passing */
    var tsk1 = Task.create('&Preprocessing_taskFxn');
    tsk1.instance.name = "Preprocessing_taskFxn";
    tsk1.arg0 = MultiProc.getIdMeta ("HOST");
    tsk1.stackSize = 0x1000;

    /* DMAN3 stuff */
    var DMAN3  = xdc.useModule('ti.sdo.fc.dman3.DMAN3');
    DMAN3.heapInternal  = "L1DHEAP";
    DMAN3.heapExternal = ".EXTERNAL_HEAP";
    DMAN3.numQdmaChannels = 8;
    DMAN3.paRamBaseIndex = 78;
    DMAN3.numPaRamEntries = 48;
    DMAN3.nullPaRamIndex = 127;
    DMAN3.tccAllocationMaskH = 0xffffffff;
    DMAN3.tccAllocationMaskL = 0x0;
    DMAN3.numTccGroup   = [4, 3, 2, 0, 0, 5];
    DMAN3.numPaRamGroup = [4, 4, 2, 0, 0, 5];
    DMAN3.qdmaChannels = [0, 1, 2, 3, 4, 5, 6, 7];
    DMAN3.maxQdmaChannels = 8;
    DMAN3.maxTCs          = 2;

    /* ACPY3 stuff */
    //var ACPY3  = xdc.useModule('ti.sdo.fc.acpy3.ACPY3');

    Update:

    I found the problem:

    DMAN3.heapExternal = ".EXTERNAL_HEAP"; --> DMAN3.heapExternal = "EXTERNAL_HEAP";

    Lee Holeva