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.

C6678 DSP SYS/BIOS Maximum Heap Size

Other Parts Discussed in Thread: SYSBIOS

Hi Team,

Is there a maximum heap size that can be assigned to a core when running SYS/BIOS on a C6678DSP?  Currently, when setting the heap size for core zero to 0x5FFFFF00 it will only appear in the map file as being 0x1FFFFF00.

The system is C6678 based, using version 1.0.0.17 of the MCSDK and version 6.32.5.54 of SYS/BIOS.  The debugging platform is CCSv5.2.

Thanks for your help,
Walter

  • Walter,

    Where are you placing the heap? Can you attach your .cfg file? What does your linker file look like?

    I was able to reproduce with the standard platform file for 6678 (ti.platform.evm6678), but the DDR3 is only 0x20000000 in length, so 0x5FFFFF00 does not fit. I'm surprised there was no error or warning.

    Todd

    Thanks,
    Todd

  • Todd,
    I am the one who asked Walter the question here. I have created a new platform as was discussed in a previous thread which has 0x80000000 bytes of DDR starting at 0x80000000. When I create a heap larger than 0x1FFFFFFF it appears that the upper bits are masked. Here is my current cfg and the related sections of the map file:

    CFG:

    environment['xdc.cfg.check.fatal'] = 'false';

    /* Load and use the various BIOS modules. */

    var Memory = xdc.useModule('xdc.runtime.Memory');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');

    var HWI = xdc.useModule('ti.sysbios.family.c64p.Hwi');

    var ECM = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');

    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

    var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');

    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var Idle = xdc.useModule('ti.sysbios.knl.Idle');

    var SEM = xdc.useModule('ti.sysbios.knl.Semaphore');

    var Log = xdc.useModule('xdc.runtime.Log');

    var Diags = xdc.useModule('xdc.runtime.Diags');

    var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');

    /* Load and use the CPPI, QMSS & CSL packages */

    var cslSettings = xdc.useModule ('ti.csl.Settings');

    cslSettings.useCSLIntcLib = true;

    var Cppi = xdc.loadPackage('ti.drv.cppi');

    var Qmss = xdc.loadPackage('ti.drv.qmss');

    /* Load and use the System Package */

    /* Default is SysMin recommended for the target version, uncomment below for debug */

    /*var System = xdc.useModule('xdc.runtime.System');

    SysStd = xdc.useModule('xdc.runtime.SysStd');

    System.SupportProxy = SysStd; */

    /*

    * Enable Event Groups here and registering of ISR for specific GEM INTC is done

    * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs

    */

    ECM.eventGroupHwiNum[0] = 7;

    ECM.eventGroupHwiNum[1] = 8;

    ECM.eventGroupHwiNum[2] = 9;

    ECM.eventGroupHwiNum[3] = 10;

     

     

    /* Load and use the IPC packages */

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

    var Settings = xdc.module('ti.sdo.ipc.family.Settings');

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

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

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

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

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');

    /* Create a default system heap using ti.bios.HeapMem. */

    var heapMemParams0 = new HeapMem.Params;

    heapMemParams0.size = 0x3FFFFF00;

    heapMemParams0.sectionName = "systemHeap";

    Program.global.heap0 = HeapMem.create(heapMemParams0);

    var heapMemParams1 = new HeapMem.Params;

    heapMemParams1.size = 0x02000000;

    heapMemParams1.sectionName = "systemHeap";

    Program.global.heap1 = HeapMem.create(heapMemParams1);

    var heapMemParams2 = new HeapMem.Params;

    heapMemParams2.size = 0x02000000;

    heapMemParams2.sectionName = "systemHeap";

    Program.global.heap2 = HeapMem.create(heapMemParams2);

    var heapMemParams3 = new HeapMem.Params;

    heapMemParams3.size = 0x02000000;

    heapMemParams3.sectionName = "systemHeap";

    Program.global.heap3 = HeapMem.create(heapMemParams3);

    var heapMemParams4 = new HeapMem.Params;

    heapMemParams4.size = 0x02000000;

    heapMemParams4.sectionName = "systemHeap";

    Program.global.heap4 = HeapMem.create(heapMemParams4);

    var heapMemParams5 = new HeapMem.Params;

    heapMemParams5.size = 0x02000000;

    heapMemParams5.sectionName = "systemHeap";

    Program.global.heap5 = HeapMem.create(heapMemParams5);

    var heapMemParams6 = new HeapMem.Params;

    heapMemParams6.size = 0x02000000;

    heapMemParams6.sectionName = "systemHeap";

    Program.global.heap6 = HeapMem.create(heapMemParams6);

    var heapMemParams7 = new HeapMem.Params;

    heapMemParams7.size = 0x02000000;

    heapMemParams7.sectionName = "systemHeap";

    Program.global.heap7 = HeapMem.create(heapMemParams7);

    var heapMemParamsCM = new HeapMem.Params;

    heapMemParamsCM.size = 0x05000000;

    heapMemParamsCM.sectionName = "systemHeap";

    Program.global.cmHeap = HeapMem.create(heapMemParamsCM);

    var heapMemParamsRM = new HeapMem.Params;

    heapMemParamsRM.size = 0x1FFFFF00;

    heapMemParamsRM.sectionName = "systemHeap";

    Program.global.rmHeap = HeapMem.create(heapMemParamsRM);

    /*

    var heapBufParams = new HeapBuf.Params;

    heapBufParams.blockSize = 4096;

    heapBufParams.numBlocks = 8192;

    heapBufParams.align = 128;

    heapBufParams.sectionName = "cmHeap";

    Program.global.cmHeap = HeapBuf.create(heapBufParams);

    */

    /* This is the default memory heap. */

    Memory.defaultHeapInstance = Program.global.heap0;

    /*Program.sectMap["systemHeap"] = Program.platform.stackMemory; */

    /*Program.sectMap["systemHeap"] = "MSMCSRAM";*/

    Program.sectMap["systemHeap"] = "DDR3";

    /*Program.sectMap["cmHeap"] = "DDR3";*/

    /* Configure the shared memory heap for shared memory allocations required by the

    * CPPI and QMSS Libraries */

    SharedRegion.translate = false;

    var memmap = Program.cpu.memoryMap;

    Startup = xdc.useModule('xdc.runtime.Startup');

    Startup.firstFxns.$add('&myStartupFxn');

    MultiProc.setConfig(null, ["CORE0","CORE1","CORE2","CORE3","CORE4","CORE5","CORE6","CORE7"]);

    /* Synchronize all processors (this will be done in Ipc_start) */

    Ipc.procSync = Ipc.ProcSync_ALL;

    /* To avoid wasting shared memory for Notify and MessageQ transports */

    for (var i = 0; i < MultiProc.numProcessors; i++) {

    Ipc.setEntryMeta({

    remoteProcId: i,

    setupNotify: false,

    setupMessageQ: false,

    });

    }

    /* Create a shared memory */

    SharedRegion.setEntryMeta(0,

    { base: 0x0C010000,

    len: 0x00100000,

    ownerProcId: 0,

    isValid: true,

    name: "sharemem",

    });

     

    Program.sectMap[".const"] = "MSMCSRAM";

    Program.sectMap[".cinit"] = "MSMCSRAM";

    Program.sectMap[".switch"] = "MSMCSRAM";

    Program.sectMap[".text"] = "MSMCSRAM";

    var execontextInstance0 = xdc.lookup('xdc.platform.ExeContext.Instance#0');

    execontextInstance0.memoryMap["MSMCSRAM"].base = 0xC000040;

    execontextInstance0.memoryMap["MSMCSRAM"].len = 0x3FFFC0;

    execontextInstance0.memoryMap["L2SRAM"].base = 0x800000;

    execontextInstance0.memoryMap["L2SRAM"].len = 0x40000;

    var extstackParams = new HeapMem.Params();

    extstackParams.size = 0x20000;

    extstackParams.sectionName = ".stack";

    Program.global.sdramstack = HeapMem.create(extstackParams);

    /*Program.sectMap[".stack"] = "DDR3";*/

    Program.sectMap[".stack"] = "L2SRAM";

    MAP:

    ******************************************************************************

    TMS320C6x Linker PC v7.3.11

    ******************************************************************************

    >> Linked Wed Mar 27 11:30:36 2013

    OUTPUT FILE NAME: <vceTI6678.out>

    ENTRY POINT SYMBOL: "_c_int00" address: 00800000

     

    MEMORY CONFIGURATION

    name origin length used unused attr fill

    ---------------------- -------- --------- -------- -------- ---- --------

    L2SRAM 00800000 00040000 000291ca 00016e36 RW X

    MSMCSRAM 0c000040 003fffc0 002405a9 001bfa17 RW X

    DDR3 80000000 80000000 53000900 2cfff700 RW X

    ...

    80000000 ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A

    9fffff00 ti_sysbios_heaps_HeapMem_Instance_State_1_buf__A

    a1ffff00 ti_sysbios_heaps_HeapMem_Instance_State_2_buf__A

    a3ffff00 ti_sysbios_heaps_HeapMem_Instance_State_3_buf__A

    a5ffff00 ti_sysbios_heaps_HeapMem_Instance_State_4_buf__A

    a7ffff00 ti_sysbios_heaps_HeapMem_Instance_State_5_buf__A

    a9ffff00 ti_sysbios_heaps_HeapMem_Instance_State_6_buf__A

    abffff00 ti_sysbios_heaps_HeapMem_Instance_State_7_buf__A

    adffff00 ti_sysbios_heaps_HeapMem_Instance_State_8_buf__A

    b2ffff00 ti_sysbios_heaps_HeapMem_Instance_State_9_buf__A

    d2fffe00 _ZN19H264LookupTables_Cl10m_sCBP_MAPE

    d2fffe60 _ZN19H264LookupTables_Cl16m_sCOEFF_TOKEN_1E

    d2ffff70 _ZN19H264LookupTables_Cl16m_sCOEFF_TOKEN_2E

    d3000080 _ZN19H264LookupTables_Cl16m_sCOEFF_TOKEN_3E

    d3000190 _ZN19H264LookupTables_Cl21m_sCOEFF_TOKEN_CHR_DCE

    d30001e0 _ZN19H264LookupTables_Cl14m_sTOTAL_ZEROSE

    d30005a0 _ZN19H264LookupTables_Cl21m_sTOTAL_ZEROS_CHR_DCE

    d30005d0 _ZN19H264LookupTables_Cl13m_sRUN_BEFOREE

    d3000774 _ZN10Clock8K_Cl11m_counter8kE

    d3000778 _ZN19H264LookupTables_Cl29m_H264_TOTAL_ZEROS_NOT4_TABLEE

    d30007e8 _ZN19H264LookupTables_Cl26m_H264_TOTAL_ZEROS_4_TABLEE

    d30007f8 _ZN19H264LookupTables_Cl24m_H264_COEFF_TOKEN_TABLEE

    d3000840 _ZN19H264LookupTables_Cl23m_H264_RUN_BEFORE_TABLEE

    d3000870 _ZN19H264LookupTables_Cl16block_offset_8x8E

    d3000878 _ZN19H264LookupTables_Cl14chroma_q_tableE

    d30008ac _ZN19H264LookupTables_Cl16m_H264_clip_lutsE

    d30008b0 _ZN19H264LookupTables_Cl25m_H264_clip_luts_completeE

    d30008b4 _ZN23H261H263LookUpTables_Cl13m_sH261HtdDvmE

    d30008b8 _ZN23H261H263LookUpTables_Cl13m_sH261HtdCbpE

    d30008bc _ZN23H261H263LookUpTables_Cl13m_sH261HtdMbaE

    d30008c0 _ZN23H261H263LookUpTables_Cl15m_sH261HtdMtypeE

    d30008c4 _ZN23H261H263LookUpTables_Cl16m_sH261HtdTCoeffE

    d30008c8 _ZN23H261H263LookUpTables_Cl16m_sH263HtdMcbpcIE

    d30008cc _ZN23H261H263LookUpTables_Cl16m_sH263HtdMcbpcPE

    d30008d0 _ZN23H261H263LookUpTables_Cl15m_sH263HtdCbpyIE

    d30008d4 _ZN23H261H263LookUpTables_Cl15m_sH263HtdCbpyPE

    d30008d8 _ZN23H261H263LookUpTables_Cl13m_sH263HtdMvdE

    d30008dc _ZN23H261H263LookUpTables_Cl16m_sH263HtdTCoeffE

    d30008e0 _ZN23H261H263LookUpTables_Cl12m_sQuantizerE

    d30008e4 _ZN23H261H263LookUpTables_Cl16m_sH263HteTCoeffE

    d30008e8 _ZN23H261H263LookUpTables_Cl19m_sTableInitializedE

    d30008ec _ZN18ResourceManager_Cl10m_timeDateE

    d30008f4 _ZN23CommunicationManager_Cl15m_cmdQueueIndexE

    d30008f8 _ZN23CommunicationManager_Cl12m_srioDriverE

    d30008fc _ZN23CommunicationManager_Cl23m_sCommunicationManagerE

    ffffffff __TI_pprof_out_hndl

    ffffffff __TI_prof_data_size

    ffffffff __TI_prof_data_start

    ffffffff __binit__

    ffffffff __c_args__

    ffffffff binit

     

    As you can see, the heap0, which was set to 0x3FFFFF00 is only allocated 0x1FFFFF00.

    I have experimented some and if I set the size to 0x33FFFF00 then the allocation is 0x13FFFF00.

    John

  • Hi John,

    When I have the following (and .heapSection is assigned to DDR which is 0x80000000 in length)

    #pragma DATA_SECTION(myArray, ".heapSection");
    char myArray[0x1FFFFFFF];

    Everything is placed as expected. When I change to a large size, only the bottom 29 bits are recognized. I'm asking the codegen team to see why this is being done (e.g. work-around for some errata).

    Todd

  • Hi John,

    I got a reply back from the codegen team. It is a linker bug. Here are more details and a bug number: http://e2e.ti.com/support/development_tools/compiler/f/343/p/253348/886334.aspx#886334

    Note: part of the generated code for the heap is a standard old char array. So it is having the same problem as described.

    Todd