f74a8d58c8c9f057db2950a33cf972ca0be5adb0
[processor-sdk/performance-audio-sr.git] / procsdk_audio_x_xx_xx_xx / test_arm / application / app.cfg
1 /*
2 * ======== app.cfg ========
3 * Platform: 66AK2G_bios_elf
4 * Target: gnu.targets.arm.A15F
5 */
7 /* root of the configuration object model */
8 var Program = xdc.useModule('xdc.cfg.Program');
9 var cfgArgs = Program.build.cfgArgs;
10 var RB = (cfgArgs.profile == "release" ? true : false);
12 /* application uses the following modules and packages */
13 var Defaults = xdc.useModule('xdc.runtime.Defaults');
14 var Diags = xdc.useModule('xdc.runtime.Diags');
15 var Error = xdc.useModule('xdc.runtime.Error');
16 var Log = xdc.useModule('xdc.runtime.Log');
17 var Main = xdc.useModule('xdc.runtime.Main');
18 var Memory = xdc.useModule('xdc.runtime.Memory')
19 var SysMin = xdc.useModule('xdc.runtime.SysMin');
20 var System = xdc.useModule('xdc.runtime.System');
21 var Text = xdc.useModule('xdc.runtime.Text');
23 var BIOS = xdc.useModule('ti.sysbios.BIOS');
24 var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
25 var Timer = xdc.useModule('ti.sysbios.hal.Timer');
26 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
27 var Task = xdc.useModule('ti.sysbios.knl.Task');
28 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
29 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
30 var Load = xdc.useModule('ti.sysbios.utils.Load');
32 var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
34 xdc.useModule('ti.sdo.utils.MultiProc');
37 /*
38 * ======== IPC Configuration ========
39 */
40 xdc.global.SR0_cacheEnable = true;
41 xdc.global.SrMsmcMem_cacheEnable = true;
42 xdc.global.SrDDr3Mem_cacheEnable = true;
43 xdc.global.procName = "HOST";
44 var ipc_cfg = xdc.loadCapsule("../../shared/ipc.cfg.xs");
46 /* select ipc libraries */
47 var Build = xdc.useModule('ti.sdo.ipc.Build');
48 Build.libType = (RB ? Build.LibType_NonInstrumented : Build.LibType_Debug);
49 Build.assertsEnabled = (RB ? false : true);
50 Build.logsEnabled = (RB ? false : true);
53 /*
54 * Uncomment this line to globally disable Asserts.
55 * All modules inherit the default from the 'Defaults' module. You
56 * can override these defaults on a per-module basis using Module.common$.
57 * Disabling Asserts will save code space and improve runtime performance.
58 Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
59 */
61 /*
62 * Uncomment this line to keep module names from being loaded on the target.
63 * The module name strings are placed in the .const section. Setting this
64 * parameter to false will save space in the .const section. Error and
65 * Assert messages will contain an "unknown module" prefix instead
66 * of the actual module name.
67 Defaults.common$.namedModule = false;
68 */
70 /*
71 * Minimize exit handler array in System. The System module includes
72 * an array of functions that are registered with System_atexit() to be
73 * called by System_exit().
74 */
75 System.maxAtexitHandlers = 4;
77 /*
78 * Uncomment this line to disable the Error print function.
79 * We lose error information when this is disabled since the errors are
80 * not printed. Disabling the raiseHook will save some code space if
81 * your app is not using System_printf() since the Error_print() function
82 * calls System_printf().
83 Error.raiseHook = null;
84 */
86 /*
87 * Uncomment this line to keep Error, Assert, and Log strings from being
88 * loaded on the target. These strings are placed in the .const section.
89 * Setting this parameter to false will save space in the .const section.
90 * Error, Assert and Log message will print raw ids and args instead of
91 * a formatted message.
92 Text.isLoaded = false;
93 */
95 /*
96 * Uncomment this line to disable the output of characters by SysMin
97 * when the program exits. SysMin writes characters to a circular buffer.
98 * This buffer can be viewed using the SysMin Output view in ROV.
99 SysMin.flushAtExit = false;
100 */
102 /*
103 * The BIOS module will create the default heap for the system.
104 * Specify the size of this default heap.
105 */
106 //BIOS.heapSize = 0x1000; // initial setting
107 BIOS.heapSize = 0x2000; // from pa.cfg
108 BIOS.heapSection = ".systemHeap";
109 Program.sectMap[".systemHeap"] = "HOST_DDR3";
111 /*
112 * Build a custom SYS/BIOS library from sources.
113 */
114 BIOS.libType = (RB ? BIOS.LibType_NonInstrumented : BIOS.LibType_Instrumented);
115 // BIOS.libType = BIOS.LibType_Custom;
116 // BIOS.libType = BIOS.LibType_Debug;
118 /* System stack size (used by ISRs and Swis) */
119 Program.stack = 0x2000;
120 Program.sectMap[".stack"] = "HOST_MSMC"
122 /* Circular buffer size for System_printf() */
123 SysMin.bufSize = 0x200;
125 System.SupportProxy = SysMin;
127 /* ------ */
128 /* Set CPU frequency to 600 MHz */
129 BIOS.cpuFreq.lo = 600000000;
130 BIOS.cpuFreq.hi = 0;
132 /* Set Sysclock period (usec.) */
133 Clock.tickPeriod = 1000; // FL: measured period ~852 usec.??
135 /* Configure Logging */
136 LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE;
137 LoggingSetup.sysbiosTaskLogging = false; //true;
138 LoggingSetup.sysbiosHwiLogging = false; //true;
139 //LoggingSetup.sysbiosLoggerSize = 16384;
140 LoggingSetup.loadLogging = false; //true;
141 LoggingSetup.mainLoggingRuntimeControl = false;
142 LoggingSetup.mainLoggerSize = 81960;
144 /* Configure Load Logging */ // FL: doesn't work
145 //Load.taskEnabled = true;
146 //Load.hwiEnabled = true;
147 //Load.common$.diags_USER4 = Diags.ALWAYS_ON;
149 //Task.common$.diags_USER1 = Diags.ALWAYS_ON;
150 Task.common$.diags_INFO = Diags.ALWAYS_ON;
152 /* Disallow nested hardware interrupts */
153 Hwi.dispatcherAutoNestingSupport = false;
155 var ProjName = environment["ProjName"];
156 var topo = ProjName.replace( /pa_([a-z])[0-9]+_.*/, "$1");
157 var AudioClockSim = environment["AudioClockSim"];
158 var acSimBuild = (AudioClockSim == "1" ? true : false);
160 if (acSimBuild == true)
161 {
162 //
163 // IPC simulation
164 //
166 /* Add timer to simulate Rx audio IPC message */
167 var timer0Params = new Timer.Params();
168 timer0Params.instance.name = "timerRxAudio";
169 timer0Params.period = 5330;
170 timer0Params.startMode = xdc.module("ti.sysbios.interfaces.ITimer").StartMode_USER;
171 Program.global.timerRxAudio = Timer.create(1, null, timer0Params);
173 /* Add timer to simulate Tx audio IPC message */
174 var timer1Params = new Timer.Params();
175 timer1Params.instance.name = "timerTxAudio";
176 timer1Params.startMode = xdc.module("ti.sysbios.interfaces.ITimer").StartMode_USER;
177 timer1Params.period = 5330;
178 Program.global.timerTxAudio = Timer.create(2, null, timer1Params);
180 /* Add semaphore for Rx audio DMA */
181 var semaphore0Params = new Semaphore.Params();
182 semaphore0Params.instance.name = "semaphoreRxAudio";
183 Program.global.semaphoreRxAudio = Semaphore.create(null, semaphore0Params);
185 /* Add semaphore for Tx audio DMA */
186 var semaphore1Params = new Semaphore.Params();
187 semaphore1Params.instance.name = "semaphoreTxAudio";
188 Program.global.semaphoreTxAudio = Semaphore.create(null, semaphore1Params);
189 }
191 /* Set default stack size for tasks */
192 Task.defaultStackSize = 2048;
194 /* Set size of idle task stack */
195 Task.idleTaskStackSize = 2048;
197 /* Add Audio Stream Decode Processing (ASDP) task */
198 var task0Params = new Task.Params();
199 task0Params.instance.name = "TaskAsdp";
200 task0Params.stackSize = 0x4000;
201 task0Params.stackSection = ".far:taskStackSectionAsdp";
202 //task0Params.arg0 = 0;
203 task0Params.arg0 = $externPtr("asdp_params_PA" + topo);
204 task0Params.arg1 = $externPtr("asdp_patchs_PA" + topo);
205 task0Params.priority = -1; //3;
206 Program.global.TaskAsdp = Task.create("&taskAsdpFxn", task0Params);
207 Program.sectMap[".far:taskStackSectionAsdp"] = "HOST_MSMC";
209 /* Add System Initialization task */
210 var task1Params = new Task.Params();
211 task1Params.instance.name = "TaskSysInit";
212 task1Params.stackSize = 0x1000;
213 task1Params.stackSection = ".far:taskStackSectionSysInit";
214 task1Params.priority = 4;
215 Program.global.TaskSysInit = Task.create("&taskSysInitFxn", task1Params);
216 Program.sectMap[".far:taskStackSectionSysInit"] = "HOST_DDR3";
218 Program.sectMap[".far:taskStackSection"] = "HOST_DDR3"; // SDRAM in pa.cfg
220 // Dec ip circular buffer will be in MSMC, size~=180 kB.
221 // Dec op circular buffer will be in MSMC, size~=192 kB.
222 // However, both buffers will be in Shared Region MSMC.
223 // So this is heap is for other use local to ARM (e.g. Dec chain). Set to 128 kB for now.
224 /* Add MSMC SRAM heap */ // formerly L3RAM
225 var heapMem1Params = new HeapMem.Params();
226 heapMem1Params.instance.name = "heapMemMsmcSram";
227 heapMem1Params.size = 224*1024; //128*1024
228 heapMem1Params.sectionName = ".msmcSramHeap";
229 Program.global.heapMemMsmcSram = HeapMem.create(heapMem1Params);
230 Program.sectMap[".msmcSramHeap"] = "HOST_MSMC";
232 /* Add DDR3 heap */ // formerly SDRAM
233 var heapMem2Params = new HeapMem.Params();
234 heapMem2Params.instance.name = "heapMemDdr3";
235 heapMem2Params.size = 3350528;
236 heapMem2Params.sectionName = ".ddr3Heap";
237 Program.global.heapMemDdr3 = HeapMem.create(heapMem2Params);
238 Program.sectMap[".ddr3Heap"] = "HOST_DDR3";
240 Program.global.heapMemL2Sram = Program.global.heapMemMsmcSram;
242 //Program.sectMap[".globalSectionPafAstConfig"] = "COMMON_DDR3";
243 //Program.sectMap[".globalSectionAcpStdBetaTable"] = "COMMON_DDR3";