7598b72f92abb6d1161041a295a49c31aa2fca0e
[ipc/ipcdev.git] / packages / ti / ipc / tests / package.bld
1 /*
2  * Copyright (c) 2012-2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*
33  *  ======== package.bld ========
34  *
35  */
37 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
38 var Pkg = xdc.useModule('xdc.bld.PackageContents');
40 Pkg.otherFiles = [ "mmrpc_test.c" ];
42 /* when constructing a release, release everything */
43 Pkg.attrs.exportAll = true;
45 /* Uncomment this to build the app with debug support */
46 Pkg.attrs.profile = "debug";
48 /* bin/ is a generated directory that 'xdc clean' should remove */
49 Pkg.generatedFiles.$add("bin/");
51 /* define the platform instances we support */
52 /* OMAPL138 */
53 var evmOMAPL138_ExtMemMap = {
54     DDR: {
55         name: "DDR",
56         base: 0xc3100000,
57         len:  0x00800000,
58         space: "code/data"
59     }
60 };
62 Build.platformTable["ti.platforms.evmOMAPL138:DSP"] = {
63     externalMemoryMap: [
64         [ "DDR", evmOMAPL138_ExtMemMap.DDR ]
65     ],
66     codeMemory: "DDR",
67     dataMemory: "DDR",
68     stackMemory: "DDR",
69     l2Mode: "32k"
70 };
72 /*  Memory Map for ti.platforms.sdp5430:IPU
73  *
74  *  --- External Memory ---
75  *  Virtual     Physical        Size            Comment
76  *  ------------------------------------------------------------------------
77  *  0000_4000   ????_????    5F_C000  (  ~6 MB) EXT_CODE
78  *  8000_0000   ????_????    60_0000  (   6 MB) EXT_DATA
79  *  8060_0000   ????_????   960_0000  (  86 MB) EXT_HEAP
80  *  9F00_0000   9F00_0000     6_0000  ( 384 kB) TRACE_BUF
81  *  9F06_0000   9F06_0000     1_0000  (  64 kB) EXC_DATA
82  *  9F07_0000   9F07_0000     2_0000  ( 128 kB) PM_DATA (Power mgmt)
83  */
84 var sdp5430_ExtMemMapIpu = {
85     EXT_CODE: {
86         name: "EXT_CODE",
87         base: 0x00004000,
88         len:  0x005FC000,
89         space: "code",
90         access: "RWX"
91     },
92     EXT_DATA: {
93         name: "EXT_DATA",
94         base: 0x80000000,
95         len:  0x00600000,
96         space: "data",
97         access: "RW"
98     },
99     EXT_HEAP: {
100         name: "EXT_HEAP",
101         base: 0x80600000,
102         len:  0x09600000,
103         space: "data",
104         access: "RW"
105     },
106     TRACE_BUF: {
107         name: "TRACE_BUF",
108         base: 0x9F000000,
109         len:  0x00060000,
110         space: "data",
111         access: "RW"
112     },
113     EXC_DATA: {
114         name: "EXC_DATA",
115         base: 0x9F060000,
116         len:  0x00010000,
117         space: "data",
118         access: "RW"
119     },
120     PM_DATA: {
121         name: "PM_DATA",
122         base: 0x9F070000,
123         len:  0x00020000,
124         space: "data",
125         access: "RWX"  /* should this have execute perm? */
126     }
127 };
129 Build.platformTable["ti.platforms.sdp5430:IPU"] = {
130     externalMemoryMap: [
131         [ "EXT_CODE", sdp5430_ExtMemMapIpu.EXT_CODE ],
132         [ "EXT_DATA", sdp5430_ExtMemMapIpu.EXT_DATA ],
133         [ "EXT_HEAP", sdp5430_ExtMemMapIpu.EXT_HEAP ],
134         [ "TRACE_BUF", sdp5430_ExtMemMapIpu.TRACE_BUF ],
135         [ "EXC_DATA", sdp5430_ExtMemMapIpu.EXC_DATA ],
136         [ "PM_DATA", sdp5430_ExtMemMapIpu.PM_DATA ]
137     ],
138     codeMemory: "EXT_CODE",
139     dataMemory: "EXT_DATA",
140     stackMemory: "EXT_DATA",
141 };
143 /*  Memory Map for ti.platforms.sdp5430:DSP
144  *
145  *  --- External Memory ---
146  *  Virtual     Physical        Size            Comment
147  *  ------------------------------------------------------------------------
148  *  2000_0000   ????_????    10_0000  (   1 MB) EXT_CODE
149  *  9000_0000   ????_????    10_0000  (   1 MB) EXT_DATA
150  *  9010_0000   ????_????    30_0000  (   3 MB) EXT_HEAP
151  *  9F00_0000   9F00_0000     6_0000  ( 384 kB) TRACE_BUF
152  *  9F06_0000   9F06_0000     1_0000  (  64 kB) EXC_DATA
153  *  9F07_0000   9F07_0000     2_0000  ( 128 kB) PM_DATA (Power mgmt)
154  */
155 var sdp5430_ExtMemMapDsp = {
156     EXT_CODE: {
157         name: "EXT_CODE",
158         base: 0x20000000,
159         len:  0x00100000,
160         space: "code",
161         access: "RWX"
162     },
163     EXT_DATA: {
164         name: "EXT_DATA",
165         base: 0x90000000,
166         len:  0x00100000,
167         space: "data",
168         access: "RW"
169     },
170     EXT_HEAP: {
171         name: "EXT_HEAP",
172         base: 0x90100000,
173         len:  0x00300000,
174         space: "data",
175         access: "RW"
176     },
177     TRACE_BUF: {
178         name: "TRACE_BUF",
179         base: 0x9F000000,
180         len:  0x00060000,
181         space: "data",
182         access: "RW"
183     },
184     EXC_DATA: {
185         name: "EXC_DATA",
186         base: 0x9F060000,
187         len:  0x00010000,
188         space: "data",
189         access: "RW"
190     },
191     PM_DATA: {
192         name: "PM_DATA",
193         base: 0x9F070000,
194         len:  0x00020000,
195         space: "data",
196         access: "RWX"  /* should this have execute perm? */
197     }
198 };
200 Build.platformTable["ti.platforms.sdp5430:DSP"] = {
201     externalMemoryMap: [
202         [ "EXT_CODE", sdp5430_ExtMemMapDsp.EXT_CODE ],
203         [ "EXT_DATA", sdp5430_ExtMemMapDsp.EXT_DATA ],
204         [ "EXT_HEAP", sdp5430_ExtMemMapDsp.EXT_HEAP ],
205         [ "TRACE_BUF", sdp5430_ExtMemMapDsp.TRACE_BUF ],
206         [ "EXC_DATA", sdp5430_ExtMemMapDsp.EXC_DATA ],
207         [ "PM_DATA", sdp5430_ExtMemMapDsp.PM_DATA ]
208     ],
209     codeMemory: "EXT_CODE",
210     dataMemory: "EXT_DATA",
211     stackMemory: "EXT_DATA",
212 };
214 for (var i = 0; i < Build.targets.length; i++) {
215     var targ = Build.targets[i];
217 //    print("building for target " + targ.name + " ...");
219     /* currently only build for OMAPL138, Keystone II, OMAP5, and Vayu*/
220     if (!((targ.isa == "674") || (targ.isa == "66") ||
221           (targ.isa.match(/v7M(|4)/)) || (targ.isa == "64T"))) {
222         continue;
223     }
225     /* Platforms were added to targ.platforms[] in config.bld */
226     for (var j = 0; j < targ.platforms.length; j++) {
227         var platform = targ.platforms[j];
229         /* currently only build for OMAPL138, Keystone II, OMAP5, and Vayu*/
230         if (!((platform.match(/^ti\.platforms\.evm6614\:DSP/)) ||
231               (platform.match(/^ti\.platforms\.simKepler/)) ||
232               (platform.match(/^ti.platforms.evmTCI6638K2K/)) ||
233               (platform.match(/^ti\.platform\.omap54xx/)) ||
234               (platform.match(/^ti\.platforms\.sdp5430/)) ||
235               (platform.match(/^ti\.platform\.vayu/)) ||
236               (platform.match(/\.platforms\.evmOMAPL138/)))) {
237              continue;
238         }
240         print("  platform:  " + platform);
241         // name = bin/platform/name.x+suffix
242         var name = "bin/" +
243                 // replace all ':' and '.' with '_' in platform name
244                 platform.replace(/\:/g, "_").replace(/\./g, "_");
246         var extraDefs = "";
248         /* Vayu and OMAP5 require MmRpc and therefore use RPMSG_NS_2_0 */
249         if (platform.match(/^ti\.platform\.vayu/) ||
250                 platform.match(/^ti\.platform\.sdp5430$/)) {
251             extraDefs = " -DRPMSG_NS_2_0";
252         }
254         /* ping_rpmsg */
255         Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
256             cfgScript: "ping_rpmsg",
257             defs: extraDefs
258         }).addObjects(["ping_rpmsg.c"]);
260         /* messageq_multicore - only for our homogeneous multicore platforms */
261         if (platform.match(/^ti\.platforms\.simKepler/) ||
262                 (platform.match(/^ti.platforms.evmTCI6638K2K/)) ||
263                 (platform.match(/^ti\.platforms\.evm6614\:DSP/))) {
264             Pkg.addExecutable(name + "/messageq_multicore", targ, platform, {
265                 cfgScript: "messageq_multicore",
266                 //defs: "-D TCI6614_v33"
267                 //defs: "-D TCI6614"
268                 defs: "-D TCI6638"
269             }).addObjects(["messageq_multicore.c"]);
271             Pkg.addExecutable(name + "/dual_transports", targ, platform, {
272                 cfgScript: "dual_transports",
273             }).addObjects(["dual_transports.c"]);
274         }
276         /* messageq_multi */
277         Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
278             cfgScript: "rpmsg_transport",
279             defs: "-D BENCHMARK" + extraDefs
280         }).addObjects(["messageq_multi.c"]);
282         /* messageq_single */
283         Pkg.addExecutable(name + "/messageq_single", targ, platform, {
284             cfgScript: "rpmsg_transport",
285             defs: "-D BENCHMARK " + extraDefs
286         }).addObjects(["messageq_single.c"]);
288         /* nano_test - demonstrates passing ptrs using CMEM */
289         if (platform.match(/^ti\.platforms\.evmOMAPL138\:DSP/)) {
290             Pkg.addExecutable(name + "/nano_test", targ, platform, {
291                 cfgScript: "rpmsg_transport"
292             }).addObjects(["nano_test.c"]);
293         }
295         var test_omx_SRCS = ["test_omx.c","ping_tasks.c","rpc_task.c",
296                 "MxServer.c"];
298         if (platform.match(/^ti\.platforms\.sdp5430/) &&
299                 (targ.isa == "v7M4")) {
300             Pkg.addExecutable(name + "/test_omx_ipu_omap5", targ, platform, {
301                 cfgScript: "test_omx_ipu_omap5",
302                 defs: "-D IPU -D OMAP5xxx -DRPMSG_NS_2_0"
303             }).addObjects(test_omx_SRCS);
304         }
306         if (platform.match(/^ti\.platforms\.sdp5430/) &&
307                 (targ.isa == "64T")) {
308             Pkg.addExecutable(name + "/test_omx_dsp_omap5", targ, platform, {
309                 cfgScript: "test_omx_dsp_omap5",
310                 defs: "-D DSP -D OMAP5xxx -DRPMSG_NS_2_0"
311             }).addObjects(test_omx_SRCS);
312         }
314         if (platform.match(/^ti\.platform\.vayu\.ipu2/)) {
315             Pkg.addExecutable(name + "/test_omx_ipu2_vayu", targ, platform, {
316                 cfgScript: "test_omx_ipu_vayu",
317                 defs: "-D IPU -D VAYU -DRPMSG_NS_2_0"
318             }).addObjects(test_omx_SRCS);
319         }
321         if (platform.match(/^ti\.platform\.vayu\.dsp1/)) {
322             Pkg.addExecutable(name + "/test_omx_dsp1_vayu", targ, platform, {
323                 cfgScript: "test_omx_dsp_vayu",
324                 defs: "-D DSP -D VAYU -DRPMSG_NS_2_0"
325             }).addObjects(test_omx_SRCS);
326         }
327     }