Fixed following bugs:
[ep-processor-libraries/dsplib.git] / ti / dsplib / examples / example.xs
1 /* MAIN ROUTINE FROM HERE */
2 if(arguments.length < 1)
3 {
4   print("USAGE:");
5   print("xs -f example.js platform dst\n");
6   java.lang.System.exit(1);
7 }
8 var target=arguments[0];
9 var dst=arguments[1];
10 var repositDir = new java.io.File(dst+"/examples");
11   if (!(repositDir.exists() && repositDir.isDirectory())) {
12     repositDir.mkdirs();
13   }
14  
15 /* Copy Common Files */
16 /* Copy Module */
17 var copy = xdc.loadCapsule('ti/mas/swtools/Copy.xs');
19 copy.File("./examples/package.xdc", dst+"/examples");
21 if(target.toString().match("64"))
22 {
23   /* FFT Example for C64x+ & C66x targets */
24   copy.File("./examples/fft_ex/fft_example.c", dst+"/examples/fft_ex");
25   copy.File("./examples/fft_ex/gen_twiddle_fft16x16.h", dst+"/examples/fft_ex");
26   copy.File("./examples/fft_ex/gen_twiddle_fft16x16.c", dst+"/examples/fft_ex");
27   copy.File("./examples/fft_ex/gen_twiddle_fft16x32.h", dst+"/examples/fft_ex");
28   copy.File("./examples/fft_ex/gen_twiddle_fft16x32.c", dst+"/examples/fft_ex");
29   copy.File("./examples/fft_ex/gen_twiddle_fft32x32.h", dst+"/examples/fft_ex");
30   copy.File("./examples/fft_ex/gen_twiddle_fft32x32.c", dst+"/examples/fft_ex");
31   copy.File("./examples/fft_ex/refOutput.jpg", dst+"/examples/fft_ex");
32   copy.File("./examples/fft_ex/Readme.txt", dst+"/examples/fft_ex");
33   copy.File("./examples/fft_ex/c64P/lnk.cmd", dst+"/examples/fft_ex");
34   var prjtarget= "64P";
35 }
36 else if (target.toString().match("66"))
37 {
38   /* FFT Example for C64x+ & C66x targets */
39   copy.File("./examples/fft_ex/fft_example.c", dst+"/examples/fft_ex");
40   copy.File("./examples/fft_ex/gen_twiddle_fft16x16.h", dst+"/examples/fft_ex");
41   copy.File("./examples/fft_ex/gen_twiddle_fft16x16.c", dst+"/examples/fft_ex");
42   copy.File("./examples/fft_ex/gen_twiddle_fft16x32.h", dst+"/examples/fft_ex");
43   copy.File("./examples/fft_ex/gen_twiddle_fft16x32.c", dst+"/examples/fft_ex");
44   copy.File("./examples/fft_ex/gen_twiddle_fft32x32.h", dst+"/examples/fft_ex");
45   copy.File("./examples/fft_ex/gen_twiddle_fft32x32.c", dst+"/examples/fft_ex");
46   copy.File("./examples/fft_ex/refOutput.jpg", dst+"/examples/fft_ex");
47   copy.File("./examples/fft_ex/Readme.txt", dst+"/examples/fft_ex");
48   copy.File("./examples/fft_ex/c66/lnk.cmd", dst+"/examples/fft_ex");
50   /* FFT SP Example for C66x targets */
51   copy.File("./examples/fft_sp_ex/c66/lnk.cmd", dst+"/examples/fft_sp_ex");
52   copy.File("./examples/fft_sp_ex/fft_example_sp.c", dst+"/examples/fft_sp_ex");
53   copy.File("./examples/fft_sp_ex/refOutput.jpg", dst+"/examples/fft_sp_ex");
54   copy.File("./examples/fft_sp_ex/Readme.txt", dst+"/examples/fft_sp_ex");
56   /* Matrix Examples for C66x targets */
57   copy.Directory("./examples/EVD_dp_matrix_ex",dst+"/examples/EVD_dp_matrix_ex");
58   copy.Directory("./examples/QRD_dp_least_squares_ex",dst+"/examples/QRD_dp_least_squares_ex");
59   copy.Directory("./examples/SVD_dp_compress_ex",dst+"/examples/SVD_dp_compress_ex");
60   copy.Directory("./examples/SVD_dp_rank_ex",dst+"/examples/SVD_dp_rank_ex");
61   var prjtarget= "66";  
62 }
63 else if(target.toString().match("674"))
64 {
65   /* FFT SP Example for C674x targets */
66   copy.File("./examples/fft_sp_ex/c674/lnk.cmd", dst+"/examples/fft_sp_ex");
67   copy.File("./examples/fft_sp_ex/fft_example_sp.c", dst+"/examples/fft_sp_ex");
68   copy.File("./examples/fft_sp_ex/refOutput.jpg", dst+"/examples/fft_sp_ex");
69   copy.File("./examples/fft_sp_ex/Readme.txt", dst+"/examples/fft_sp_ex");
70   var prjtarget= "674";
71 }
73 var tplt = xdc.loadTemplate('ti/dsplib/examples/package.bld.xdt');
74 tplt.genFile (dst+'/examples/package.bld', null, [target,prjtarget]);