]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pasdk/test_dsp/application/app.cfg
PASDK-376:Update build configurations
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / application / app.cfg
2 /*
3 Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without 
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 /*
37  *  ======== app.cfg ========
38  *  Platform: 66AK2G_bios_elf
39  *  Target: ti.targets.elf.C66
40  */
42 /* root of the configuration object model */
43 var Program = xdc.useModule('xdc.cfg.Program');
44 var cfgArgs = Program.build.cfgArgs;
45 var RB = (cfgArgs.profile == "release" ? true : false);
47 /* application uses the following modules and packages */
48 var Defaults        = xdc.useModule('xdc.runtime.Defaults');
49 var Diags           = xdc.useModule('xdc.runtime.Diags');
50 var Error           = xdc.useModule('xdc.runtime.Error');
51 var Log             = xdc.useModule('xdc.runtime.Log');
52 var Main            = xdc.useModule('xdc.runtime.Main');
53 var Memory          = xdc.useModule('xdc.runtime.Memory')
54 var SysMin          = xdc.useModule('xdc.runtime.SysMin');
55 var System          = xdc.useModule('xdc.runtime.System');
56 var Text            = xdc.useModule('xdc.runtime.Text');
59 var BIOS            = xdc.useModule('ti.sysbios.BIOS');
60 var GateAll         = xdc.useModule('ti.sysbios.gates.GateAll');    // Added for PFP
61 var Hwi             = xdc.useModule('ti.sysbios.hal.Hwi');
62 var Cache           = xdc.useModule('ti.sysbios.hal.Cache');
63 var Cachec66        = xdc.useModule('ti.sysbios.family.c66.Cache');
64 var Timer           = xdc.useModule('ti.sysbios.hal.Timer');
65 var HeapBuf         = xdc.useModule('ti.sysbios.heaps.HeapBuf');
66 var HeapMem         = xdc.useModule('ti.sysbios.heaps.HeapMem');
67 var Clock           = xdc.useModule('ti.sysbios.knl.Clock');
68 var Idle            = xdc.useModule('ti.sysbios.knl.Idle');
69 var Queue           = xdc.useModule('ti.sysbios.knl.Queue');
70 var Semaphore       = xdc.useModule('ti.sysbios.knl.Semaphore');
71 var Swi             = xdc.useModule('ti.sysbios.knl.Swi');          // Added for PFP
72 var Task            = xdc.useModule('ti.sysbios.knl.Task');
73 var Load            = xdc.useModule('ti.sysbios.utils.Load');
75 var LoggingSetup    = xdc.useModule('ti.uia.sysbios.LoggingSetup');
76 var UIAEvt          = xdc.useModule('ti.uia.events.UIAEvt');
78 var ECM             = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
80 xdc.useModule('ti.sdo.utils.MultiProc');
82 /*
83  *  ======== IPC Configuration ========
84  */
85 xdc.global.SR0_cacheEnable = true;
86 xdc.global.SrMsmcMem_cacheEnable = true;
87 xdc.global.SrDDr3Mem_cacheEnable = true;
88 xdc.global.SrDDr3_2Mem_cacheEnable = false;
89 xdc.global.procName = "CORE0";
90 var ipc_cfg = xdc.loadCapsule("C:/ti/processor_audio_sdk_1_00_00_05/pasdk/shared/ipc.cfg.xs");
92 /* select ipc libraries */
93 var Build = xdc.useModule('ti.sdo.ipc.Build');
94 Build.libType = (RB ? Build.LibType_NonInstrumented : Build.LibType_Debug);
95 Build.assertsEnabled = (RB ? false : true);
96 Build.logsEnabled = (RB ? false : true);
99 /*
100  * Uncomment this line to globally disable Asserts.
101  * All modules inherit the default from the 'Defaults' module.  You
102  * can override these defaults on a per-module basis using Module.common$. 
103  * Disabling Asserts will save code space and improve runtime performance.
104 Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
105  */
107 /*
108  * Uncomment this line to keep module names from being loaded on the target.
109  * The module name strings are placed in the .const section. Setting this
110  * parameter to false will save space in the .const section.  Error and
111  * Assert messages will contain an "unknown module" prefix instead
112  * of the actual module name.
113 Defaults.common$.namedModule = false;
114  */
116 /*
117  * Minimize exit handler array in System.  The System module includes
118  * an array of functions that are registered with System_atexit() to be
119  * called by System_exit().
120  */
121 System.maxAtexitHandlers = 4;       
123 /* 
124  * Uncomment this line to disable the Error print function.  
125  * We lose error information when this is disabled since the errors are
126  * not printed.  Disabling the raiseHook will save some code space if
127  * your app is not using System_printf() since the Error_print() function
128  * calls System_printf().
129 Error.raiseHook = null;
130  */
132 /* 
133  * Uncomment this line to keep Error, Assert, and Log strings from being
134  * loaded on the target.  These strings are placed in the .const section.
135  * Setting this parameter to false will save space in the .const section.
136  * Error, Assert and Log message will print raw ids and args instead of
137  * a formatted message.
138 Text.isLoaded = false;
139  */
141 /*
142  * Uncomment this line to disable the output of characters by SysMin
143  * when the program exits.  SysMin writes characters to a circular buffer.
144  * This buffer can be viewed using the SysMin Output view in ROV.
145 SysMin.flushAtExit = false;
146  */
148 /*
149  * The BIOS module will create the default heap for the system.
150  * Specify the size of this default heap.
151  */
152 //BIOS.heapSize = 0x1000; // initial setting
153 BIOS.heapSize = 0x2000; // from pa.cfg
154 BIOS.heapSection = ".systemHeap";
155 Program.sectMap[".systemHeap"] = "CORE0_DDR3";
157 /*
158  * Build a custom SYS/BIOS library from sources.
159  */
160 BIOS.libType = (RB ? BIOS.LibType_NonInstrumented : BIOS.LibType_Instrumented);
161 // BIOS.libType = BIOS.LibType_Custom;
162 // BIOS.libType = BIOS.LibType_Debug;
164 /* System stack size (used by ISRs and Swis) */
165 Program.stack = 0x2000;
166 Program.sectMap[".stack"] = "L2SRAM"
168 /* Circular buffer size for System_printf() */
169 SysMin.bufSize = 0x200;
171 System.SupportProxy = SysMin;
173 /* ------ */
174 /* Set CPU frequency to 600 MHz */
175 BIOS.cpuFreq.lo = 600000000;
176 BIOS.cpuFreq.hi = 0;
178 /* Set Sysclock period (usec.) */
179 Clock.tickPeriod = 1000;
181 /* Configure Logging */
182 LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE; // LoggerType_JTAGRUNMODE
183 LoggingSetup.sysbiosTaskLogging = false; // true;
184 LoggingSetup.sysbiosSwiLogging = false;
185 LoggingSetup.sysbiosHwiLogging = false; // true
186 //LoggingSetup.sysbiosLoggerSize = 16384;
187 LoggingSetup.loadLogging = false; //true;
188 LoggingSetup.mainLogging = true;
189 LoggingSetup.mainLoggingRuntimeControl = false;
190 LoggingSetup.mainLoggerSize = 327680; //81960;
191 //LoggingSetup.memorySectionName = "CORE0_DDR3"; //"CORE0_MSMC";
193 // FL: CPU load logging via UIA doesn't work.
194 //     Below settings work for target-side load computation (no UIA) when LoggingSetup.loadLogging set to false, but not true.
195 //     Load.common$.diags_USER4 set to default or Diags.ALWAYS_ON makes no difference.
196 /* Configure Load Logging */
197 Load.updateInIdle = true;   // default=true
198 Load.windowInMs = 5.33;    // 48KHz 256 @ 5.33ms  // in msec., default=500
199 Load.taskEnabled = true;    // default=true
200 Load.swiEnabled = false;    // default=true
201 Load.hwiEnabled = false;    // default=true
202 //Load.common$.diags_USER4 = Diags.ALWAYS_ON; // default=Diags.RUNTIME_ON
204 //Task.common$.diags_USER1 = Diags.ALWAYS_ON;
205 Task.common$.diags_INFO = Diags.ALWAYS_ON;
207 /* Disallow nested hardware interrupts */
208 Hwi.dispatcherAutoNestingSupport = false;
210 var ProjName = environment["ProjName"];
211 var topo = ProjName.replace( /pa_([a-z])[0-9]+_.*/, "$1");
213 var drv             = xdc.loadPackage('ti.sdo.edma3.drv');
214 var rm              = xdc.loadPackage ("ti.sdo.edma3.rm");
215 var Edma            = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
216 var Hwi             = xdc.useModule('ti.sysbios.family.c64p.Hwi');
218 var devType = "k2g"
220 var CpIntc =   xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
222 /* Load the OSAL package */ 
223 var osType = "tirtos";
224 var Osal = xdc.useModule('ti.osal.Settings');
225 Osal.osType = osType;
226 Osal.socType = devType;
228 /* Load the uart package */
229 var Uart = xdc.loadPackage('ti.drv.uart');
230 Uart.Settings.enableProfiling = false;
231 Uart.Settings.socType = devType; 
232 Uart.Settings.useDma = "true";    
234 /* Load the spi package */
235 var Spi = xdc.loadPackage('ti.drv.spi');
236 Spi.Settings.enableProfiling = false;     
237 Spi.Settings.socType = devType;
239 /* Load the i2c package */
240 var I2c = xdc.loadPackage('ti.drv.i2c');
241 I2c.Settings.enableProfiling = false;
242 I2c.Settings.socType = devType;
244 /* Load and use the CSL packages */
245 var Csl = xdc.useModule('ti.csl.Settings');
246 Csl.deviceType = devType;
248 /* Set default stack size for tasks */
249 Task.defaultStackSize = 2048;
251 /* Set size of idle task stack */
252 Task.idleTaskStackSize = 2048;
254 /* Add Audio Function Processing (AFP) task */
255 var task0Params = new Task.Params();
256 task0Params.instance.name = "TaskAfp";
257 task0Params.stackSize   = 0x1000; // initial value from pa.cfg
258 task0Params.stackSection = ".far:taskStackSectionAfp";
259 task0Params.arg0 = 0;
260 task0Params.priority = -1; //1;
261 Program.global.TaskAfp = Task.create("&taskAfpFxn", task0Params);
262 Program.sectMap[".far:taskStackSectionAfp"] = "CORE0_DDR3"; // SDRAM in pa.cfg
264 /* Add Alpha Interval Processing (AIP) task */
265 var task1Params = new Task.Params();
266 task1Params.instance.name = "TaskAip";
267 task1Params.stackSize = 0x1000;
268 task1Params.stackSection = ".far:taskStackSectionAip";
269 task1Params.arg0 = 0;
270 task1Params.priority = -1; //2;
271 Program.global.TaskAip = Task.create("&taskAipFxn", task1Params);
272 Program.sectMap[".far:taskStackSectionAip"] = "CORE0_MSMC"; // L3RAM in pa.cfg
274 /* Add Audio Stream Input Processing (ASIP) task  */
275 var task2Params = new Task.Params();
276 task2Params.instance.name = "TaskAsip";
277 task2Params.stackSize = 0x4000;
278 task2Params.stackSection = ".far:taskStackSectionAsip";
279 //task2Params.arg0 = 0;
280 task2Params.arg0 = $externPtr("asip_params_PA" + topo);
281 task2Params.arg1 = $externPtr("asip_patchs_PA" + topo);
282 task2Params.priority = -1; //3;
283 Program.global.TaskAsip = Task.create("&taskAsipFxn", task2Params);
284 Program.sectMap[".far:taskStackSectionAsip"] = "CORE0_MSMC";
286 /* Add Audio Stream Output Processing (ASOP) task  */
287 var task3Params = new Task.Params();
288 task3Params.instance.name = "TaskAsop";
289 task3Params.stackSize = 0x4000;
290 task3Params.stackSection = ".far:taskStackSectionAsop";
291 //task3Params.arg0 = 0;
292 task3Params.arg0 = $externPtr("asop_params_PA" + topo);
293 task3Params.arg1 = $externPtr("asop_patchs_PA" + topo);
294 task3Params.priority = -1; //3;
295 Program.global.TaskAsop = Task.create("&taskAsopFxn", task3Params);
296 Program.sectMap[".far:taskStackSectionAsop"] = "CORE0_MSMC";
298 /* Add System Initialization task */
299 var task4Params = new Task.Params();
300 task4Params.instance.name = "TaskSysInit";
301 task4Params.stackSize   = 0x1000;
302 task4Params.stackSection = ".far:taskStackSectionSysInit";
303 task4Params.priority = 6; //5;
304 Program.global.TaskSysInit = Task.create("&taskSysInitFxn", task4Params);
305 Program.sectMap[".far:taskStackSectionSysInit"] = "CORE0_DDR3";
307 Program.sectMap[".far:taskStackSection"] = "CORE0_DDR3"; // SDRAM in pa.cfg
309 /* Add task for audio System stream processing; formerly audioStream1Idle() */
310 var task5Params = new Task.Params();
311 task5Params.instance.name = "TaskSystemStream";
312 task5Params.stackSize   = 0x1000;
313 task5Params.stackSection = ".far:taskStackSectionAudioStream";
314 task5Params.priority = -1;
315 Program.global.TaskSystemStream = Task.create("&taskSystemStreamFxn", task5Params);
316 Program.sectMap[".far:taskStackSectionAudioStream"] = "CORE0_DDR3";
318 /* Add idle functions */
319 Idle.idleFxns[0] = "&SAP_watchDog";         // Idle function for DSP watchdog; formerly DAP_watchDog()
320 // Remark: Moved idleAudioStream (idle function) to taskSystemStreamFxn (task)
321 //Idle.idleFxns[1] = "&idleAudioStream";      // Idle function for audio stream; formerly audioStream1Idle()
322 //Idle.idleFxns[2] = "&idleNotifyInfoChange"; // Idle function for Notify Information Change (NIC); formerly customSystemStreamIdleNIC()
323 Idle.idleFxns[1] = "&idleNotifyInfoChange"; // Idle function for Notify Information Change (NIC); formerly customSystemStreamIdleNIC()
324 Idle.idleFxns[2] = "&idleDebug"             // Idle function for debug code
326 /* Add L2 SRAM heap */ // formerly IRAM
327 var heapMem0Params = new HeapMem.Params();
328 heapMem0Params.instance.name = "heapMemL2Sram";
329 heapMem0Params.size = 550*1024; // 550 kB temporary setting for OB in L2
330 heapMem0Params.sectionName = ".l2SramHeap";
331 Program.global.heapMemL2Sram = HeapMem.create(heapMem0Params);
332 Program.sectMap[".l2SramHeap"] = "L2SRAM";
334 // Dec ip circular buffer will be in MSMC, size~=180 kB.
335 // Dec op circular buffer will be in MSMC, size~=192 kB.
336 // Both buffers will be in Shared Region MSMC.
337 /* Add MSMC SRAM heap */ // formerly L3RAM
338 var heapMem1Params = new HeapMem.Params();
339 heapMem1Params.instance.name = "heapMemMsmcSram";
340 // 43008=42 kB from pa.cfg
341 // 184320=180 kB, size of input circ buf, //185344=181 kB;
342 // 384*1024 for combined size of Dec ip/op buffers
343 heapMem1Params.size = 128*1024;
344 heapMem1Params.sectionName = ".msmcSramHeap";
345 Program.global.heapMemMsmcSram = HeapMem.create(heapMem1Params);
346 Program.sectMap[".msmcSramHeap"] = "CORE0_MSMC";
348 /* Add DDR3 heap */ // formerly SDRAM
349 var heapMem2Params = new HeapMem.Params();
350 heapMem2Params.instance.name = "heapMemDdr3";
351 heapMem2Params.size = 4350528;
352 heapMem2Params.sectionName = ".ddr3Heap";
353 Program.global.heapMemDdr3 = HeapMem.create(heapMem2Params);
354 Program.sectMap[".ddr3Heap"] = "CORE0_DDR3";
356 /* For DCS7, dcs7_cfg.c */
357 Program.global.Heap = Program.global.heapMemDdr3;
359 Program.sectMap["platform_lib"] = "L2SRAM";
360 //Program.sectMap[".stack"]    = "L2SRAM";
362 ECM.eventGroupHwiNum[0] = 7;
363 ECM.eventGroupHwiNum[1] = 8;  // FL: conflict w/ UART LLD (intr-callback)
364 ECM.eventGroupHwiNum[2] = 9;
365 ECM.eventGroupHwiNum[3] = 10;
366 //Clock.tickPeriod = 100;   // FL: UART LLD (intr-callback) unresponsive
368 /* Define HWI Hook Set for PFP */
369 Hwi.addHookSet({
370     registerFxn:    '&pfpHwiRegister',
371     createFxn:      '&pfpHwiCreate',
372     beginFxn:       '&pfpHwiBegin',
373     endFxn:         '&pfpHwiEnd',
374     deleteFxn:      null,
375 });
377 /* Define SWI Hook Set for PFP */
378 Swi.addHookSet({
379     registerFxn:    '&pfpSwiRegister', // need this for Id for Hook context
380     createFxn:      '&pfpSwiCreate',   // malloc context storage space
381     readyFxn:       '&pfpSwiReady',
382     beginFxn:       '&pfpSwiBegin',
383     endFxn:         '&pfpSwiEnd',
384     deleteFxn:      null,
385 });
387 /* Define Task Hook Set for PFP */
388 Task.addHookSet({
389     registerFxn:    '&pfpTaskRegister',
390     createFxn:      '&pfpTaskCreate',
391     readyFxn:       '&pfpTaskReady',
392     switchFxn:      '&pfpTaskSwitch',
393     exitFxn:        null,
394     deleteFxn:      null,
395 });
397 /* Added for PFP, not necessary */
398 Hwi.common$.namedInstance=true;
399 Swi.common$.namedInstance=true;
400 Task.common$.namedInstance=true;