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.

AM5728: Adding OpenMP to an IPC project

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS


AM5728: Adding OpenMP to an IPC project

Hello,

I'm trying to add OpenMP to a CCS6 project running on AM5728 EVM. This project uses IPC and is loaded by CortexA15/Linux

Using documentation from downloads.ti.com/mctools/esd/docs/openmp-dsp/configuring_runtime.html and merging the project cfg with omp_config.cfg from the example in

openmp_dsp_am57xx_2_05_00_00/packages/examples/hello_with_make I get and error while linking



warning #10247-D: creating output section ".tdata" without a SECTIONS specification
warning #10247-D: creating output section ".tbss" without a SECTIONS specification
"configPkg/linker.cmd", line 158: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".localfar" size 0x84203 .  Available memory ranges:
   L2SRAM       size: 0x20000      unused: 0x12a57      max hole: 0x12a57   

but maximum device available L2SRAM is 288 kbyte (0x48000) while requested is 0x84203.

Do you have some suggestion to fix this problem?


This is my cfg:


/*
 *  ======== Dsp1.cfg ========
 *  Platform: DRA7XX_linux_elf
 *  Target: ti.targets.elf.C66
 */

/* root of the configuration object model */
var Program = xdc.useModule('xdc.cfg.Program');

/* application uses the following modules and packages */
xdc.useModule('xdc.runtime.Assert');
xdc.useModule('xdc.runtime.Diags');
xdc.useModule('xdc.runtime.Error');
xdc.useModule('xdc.runtime.Log');
xdc.useModule('xdc.runtime.Registry');

xdc.useModule('ti.sysbios.knl.Semaphore');
xdc.useModule('ti.sysbios.knl.Task');

/*
 *  ======== IPC Configuration ========
 */
xdc.useModule('ti.ipc.ipcmgr.IpcMgr');

/* load the configuration shared across cores  */
Program.global.procName = "DSP1";
var ipc_cfg = xdc.loadCapsule("../shared/ipc.cfg.xs");

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

/* Override the default resource table to add SR0 */
var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
Resource.customTable = true;

/*
 *  ======== SYS/BIOS Configuration ========
 */
if (Program.build.profile == "debug") {
    BIOS.libType = BIOS.LibType_Debug;
} else {
    BIOS.libType = BIOS.LibType_Custom;
}

/* no rts heap */
Program.argSize = 100;  /* minimum size */
Program.stack = 0x1000;

var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.common$.namedInstance = true;

/* default memory heap */
var Memory = xdc.useModule('xdc.runtime.Memory');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x8000;
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);

/* create a heap for MessageQ messages */
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var params = new HeapBuf.Params;
params.align = 8;
params.blockSize = 512;
params.numBlocks = 256;
var msgHeap = HeapBuf.create(params);

var MessageQ  = xdc.useModule('ti.sdo.ipc.MessageQ');
MessageQ.registerHeapMeta(msgHeap, 0);

/* Setup MessageQ transport */
var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
MessageQ.SetupTransportProxy = VirtioSetup;

/* Setup NameServer remote proxy */
var NameServer = xdc.useModule("ti.sdo.utils.NameServer");
var NsRemote = xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
NameServer.SetupProxy = NsRemote;

/* Enable Memory Translation module that operates on the BIOS Resource Table */
var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
Resource.loadSegment = "EXT_CODE";

/*  Use SysMin because trace buffer address is required for Linux/QNX
 *  trace debug driver, plus provides better performance.
 */
var System = xdc.useModule('xdc.runtime.System');
var SysMin = xdc.useModule('ti.trace.SysMin');
System.SupportProxy = SysMin;
SysMin.bufSize  = 0x8000;

Program.sectMap[".tracebuf"] = "TRACE_BUF";
Program.sectMap[".errorbuf"] = "EXC_DATA";
Program.sectMap[".fxDelayMem"] = "DDR3";
Program.sectMap[".busses"] = "DDR3";
Program.sectMap[".sharedMem"] = "OCMC_RAM2";
Program.sectMap[".audioIoMem"] = "OCMC_RAM2";
Program.sectMap["intRegs"] = "L2SRAM";
Program.sectMap[".perfMem"] = "OCMC_RAM2";
Program.sectMap[".fxCoefIntMem"] = "OCMC_RAM2";
Program.sectMap[".fxFastMem"] = "OCMC_RAM2";
Program.sectMap["l2sram"] = "OCMC_RAM2";
Program.sectMap["scratchMem"] = "L2SRAM";


/* --------------------------- TICK --------------------------------------*/
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
Clock.tickSource = Clock.TickSource_NULL;
//Clock.tickSource = Clock.TickSource_USER;
/* Configure BIOS clock source as GPTimer5 */
//Clock.timerId = 0;

var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

/* Skip the Timer frequency verification check. Need to remove this later */
Timer.checkFrequency = false;

/* Match this to the SYS_CLK frequency sourcing the dmTimers.
 * Not needed once the SYS/BIOS family settings is updated. */
Timer.intFreq.hi = 0;
Timer.intFreq.lo = 19200000;

//var timerParams = new Timer.Params();
//timerParams.period = Clock.tickPeriod;
//timerParams.periodType = Timer.PeriodType_MICROSECS;
/* Switch off Software Reset to make the below settings effective */
//timerParams.tiocpCfg.softreset = 0x0;
/* Smart-idle wake-up-capable mode */
//timerParams.tiocpCfg.idlemode = 0x3;
/* Wake-up generation for Overflow */
//timerParams.twer.ovf_wup_ena = 0x1;
//Timer.create(Clock.timerId, Clock.doTick, timerParams);

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

/* Must be placed before pwr mgmt */
Idle.addFunc('&ti_deh_Deh_idleBegin');
/*
 *  ======== Instrumentation Configuration ========
 */

/* system logger */
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var LoggerSysParams = new LoggerSys.Params();
var Defaults = xdc.useModule('xdc.runtime.Defaults');
Defaults.common$.logger = LoggerSys.create(LoggerSysParams);

/* enable runtime Diags_setMask() for non-XDC spec'd modules */
var Diags = xdc.useModule('xdc.runtime.Diags');
Diags.setMaskEnabled = true;

/* override diags mask for selected modules */
xdc.useModule('xdc.runtime.Main');
Diags.setMaskMeta("xdc.runtime.Main",
    Diags.ENTRY | Diags.EXIT | Diags.INFO, Diags.RUNTIME_ON);

var Registry = xdc.useModule('xdc.runtime.Registry');
Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
Registry.common$.diags_EXIT  = Diags.RUNTIME_OFF;
Registry.common$.diags_INFO  = Diags.RUNTIME_OFF;
Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
Registry.common$.diags_LIFECYCLE = Diags.RUNTIME_OFF;
Registry.common$.diags_STATUS = Diags.RUNTIME_OFF;

var Main = xdc.useModule('xdc.runtime.Main');
Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;

/********************************/
/* OPENMP RUNTIME CONFIGURATION */
/********************************/

// Include OMP runtime in the build
var ompSettings = xdc.useModule("ti.runtime.openmp.Settings");

// Set to true if the application uses or has dependencies on BIOS components
ompSettings.usingRtsc = true;

if (ompSettings.usingRtsc)
{
    /* Configure OpenMP for BIOS
     * - OpenMP.configureCores(masterCoreId, numberofCoresInRuntime)
     *       Configures the id of the master core and the number of cores
     *       available to the runtime.
     */

    var OpenMP = xdc.useModule('ti.runtime.ompbios.OpenMP');

    // Configure the index of the master core and the number of cores available
    // to the runtime. The cores are contiguous.
    OpenMP.masterCoreIdx = 0;
    OpenMP.numCores = 2;

    // Pull in memory ranges described in Platform.xdc to configure the runtime
    var ddr3       = Program.cpu.memoryMap["DDR3"];
    var ddr3_nc    = Program.cpu.memoryMap["DDR3_NC"];


    // Initialize the runtime with memory range information
    OpenMP.allocateStackFromHeap = true;
    OpenMP.allocateStackFromHeapSize = 0x010000;

    OpenMP.hasMsmc = false;
    OpenMP.ddrNoCacheBase = ddr3_nc.base;
    OpenMP.ddrNoCacheSize = ddr3_nc.len;

    OpenMP.ddrBase          = ddr3.base;
    OpenMP.ddrSize          = ddr3.len;

    // Configure memory allocation using HeapOMP
    // HeapOMP handles
    // - Memory allocation requests from BIOS components (core local memory)
    // - Shared memory allocation by utilizing the IPC module to enable
    //   multiple cores to allocate memory out of the same heap - used by malloc
    OpenMP.useIpcSharedHeap = false;
    OpenMP.allocateLocalHeapSize = 0x8000
    OpenMP.allocateSharedHeapSize = 0x00800000
    
    var Startup = xdc.useModule('xdc.runtime.Startup');
    Startup.lastFxns.$add('&__TI_omp_initialize_rtsc_mode');
}
else
{
    /* Size the heap. It must be placed in shared memory */
    program.heap = sharedHeapSize;
}