1 @REM ******************************************************************************
2 @REM * FILE PURPOSE: SA Unit Test and Example Project Creator
3 @REM ******************************************************************************
4 @REM * FILE NAME: uartProjectCreate.bat
5 @REM *
6 @REM * DESCRIPTION:
7 @REM * The script file is used to create the test and example projects of all
8 @REM * components under SA. These projects are available in the specified
9 @REM * workspace.
10 @REM *
11 @REM * Syntax:
12 @REM * uartProjectCreate.bat [deviceName] [endian] [module] [pdkDir]
13 @REM *
14 @REM * Description: (first option is default)
15 @REM * deviceName - /k2l /k2e /k2k /k2h/am57x
16 @REM * endian - little / big
17 @REM * module - uart
18 @REM * pdkDir - THIS FILE LOCATION / "C:\ti\pdk_keystone2_3_01_00_00\packages"
19 @REM *
20 @REM * Example:
21 @REM * a) uartProjectCreate.bat
22 @REM * - Creates uart module projects for k2k device for little endian
23 @REM * b) uartProjectCreate.bat k2l
24 @REM * - Creates uart module projects for k2l device for little endian
25 @REM * c) uartProjectCreate.bat k2k big
26 @REM * - Creates uart module projects for k2k device for big endian
27 @REM *
28 @REM * Copyright (C) 2012-2013, Texas Instruments, Inc.
29 @REM *****************************************************************************
30 rem @echo OFF
32 REM Parameter Validation: Check if the argument was passed to the batch file.
33 REM *****************************************************************************
34 REM Argument [deviceName] is used to set DEVICE_NAME variable.
35 REM Valid values are 'k2k', 'k2h' or 'k2l'. Defaults to 'am57x'.
36 set tempVar1=%1
37 if not defined tempVar1 goto nodevice
38 set DEVICE_NAME=%tempVar1%
39 goto devicedone
40 :nodevice
41 set DEVICE_NAME=am57x
42 :devicedone
44 set EDMA3LLD_BIOS6_INSTALLDIR="C:/ti/edma3_lld_02_12_00_20"
45 set PDK_INSTALL_PATH=C:/ti/pdk_keystone2_3_01_00_03/packages
46 set BIOS_INSTALL_PATH=C:/ti/bios_6_37_03_30
47 REM Argument [endian] is used to set ENDIAN variable.
48 REM This is Endianess of the Projects being created.
49 REM Valid Values are 'little' and 'big'. Defaults to 'little'.
50 set tempVar2=%2
51 if not defined tempVar2 goto littleendian
52 if %tempVar2% == big (
53 set ENDIAN=big
54 goto endiandone
55 )
56 :littleendian
57 set ENDIAN=little
58 :endiandone
60 REM Argument [module] is used to set MODULE variable.
61 REM This is specific module for which Projects are created.
62 REM Valid Values are LLD name. Defaults to all LLD's.
63 set tempVar3=%3
64 if not defined tempVar3 goto nomodule
65 set MODULE=%tempVar3%
66 goto moduledone
67 :nomodule
68 set MODULE=uart
69 :moduledone
71 REM Argument [pdkDir] is used to set PDK_SHORT_NAME. This is PDK directory
72 REM where project description files are located. If there is no value passed,
73 REM it defaults to the file location directory. Then convert the variable to
74 REM short name to avoid issues using batch file commands.
75 set tempVar4=%4
76 if not defined tempVar4 goto noparameter
77 set PDK_SHORT_NAME=%tempVar4%
78 goto done
79 :noparameter
80 set PDK_SHORT_NAME=%~sdp0
81 :done
83 REM *****************************************************************************
85 echo =========================================================================
86 echo. DEVICE_NAME : %DEVICE_NAME%
87 echo. ENDIAN : %ENDIAN%
88 echo. MODULE : %MODULE%
89 echo. PDK_SHORT_NAME : %PDK_SHORT_NAME%
90 echo =========================================================================
93 REM *****************************************************************************
94 REM *****************************************************************************
95 REM Customer Modifiable Section
96 REM *****************************************************************************
97 REM *****************************************************************************
99 REM macros.ini location
100 set MACROS_FILE=%PDK_SHORT_NAME%\macros.ini
102 REM This is to control the CCS version specific project create command
103 REM Set to 'no' when using CCSv5 or set to 'yes' when using CCSv4
104 set IS_CCS_VERSION_4=no
106 REM Set to 'no' when using QT, EVM, VDB, or other hardware. Set to 'yes' only when using the simulator.
107 set IS_SIMULATOR_SUPPORT_NEEDED=no
109 REM Install Location for CCSv5.4. Ensure the PATH here is in compliance with the 'IS_CCS_VERSION_4' variable
110 REM defined above.
111 set CCS_INSTALL_PATH="C:\ti_6_0\ccsv6"
113 REM Workspace where the PDK projects will be created.
114 set MY_WORKSPACE="workspace_pcie"
116 REM macros.ini location
117 set MACROS_FILE=%PDK_SHORT_NAME%\macros.ini
119 REM This is the format of the executable being created
120 REM Valid Values are 'ELF' and 'COFF'
121 set OUTPUT_FORMAT=ELF
123 REM Version of CG-Tools
124 set CGT_VERSION=7.4.7
126 REM Version of XDC
127 set XDC_VERSION=3.25.06.96
129 REM Version of BIOS
130 set BIOS_VERSION=6.37.03.30
133 REM Version of the PDK
134 set PDK_VERSION=3.01.00.01
136 REM PDK Part Number
137 set PDK_PARTNO=TCI6634
139 REM Version of the SALLD
140 set UART_VERSION=3.0.0.4
142 REM RTSC Platform Name
143 if %DEVICE_NAME% == k2k (
144 set PDK_PARTNO=TCI6638
145 set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6638K2K
146 ) else if %DEVICE_NAME% == k2h (
147 set PDK_PARTNO=TCI6636
148 set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6636K2H
149 ) else if %DEVICE_NAME% == k2l (
150 set PDK_PARTNO=TCI6630
151 set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6630K2L
152 REM Temporarily using simKepler
153 REM set RTSC_PLATFORM_NAME=ti.platforms.simKepler
154 ) else if %DEVICE_NAME% == k2e (
155 set PDK_PARTNO=66AK2E05
156 set RTSC_PLATFORM_NAME=ti.platforms.evmC66AK2E
157 REM Temporarily using simKepler
158 REM set RTSC_PLATFORM_NAME=ti.platforms.simKepler
159 )else if %DEVICE_NAME% == am57x (
160 set PDK_PARTNO=AM57X
161 set RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX
162 )else (
163 set PDK_PARTNO=TCI6634
164 set RTSC_PLATFORM_NAME=ti.platforms.simKepler
165 )
167 REM RTSC Target
168 REM - Please ensure that you select this taking into account the
169 REM OUTPUT_FORMAT and the RTSC_PLATFORM_NAME
170 if %ENDIAN% == big (
171 set RTSC_TARGET=gnu.targets.arm.A15F
172 ) else (
173 set RTSC_TARGET=gnu.targets.arm.A15F
174 )
176 REM *****************************************************************************
177 REM *****************************************************************************
178 REM Please do NOT change anything below this
179 REM *****************************************************************************
180 REM *****************************************************************************
182 REM Set auto create command by default for use with CCSv5
183 set AUTO_CREATE_COMMAND=eclipse\eclipsec -noSplash
185 REM If is CCS version 4 then set auto create command for use with CCSv4
186 If .%IS_CCS_VERSION_4% == .yes set AUTO_CREATE_COMMAND=eclipse\jre\bin\java -jar %CCS_INSTALL_PATH%\eclipse\startup.jar
188 REM Set project for Silicon or QT by default
189 set SIMULATOR_SUPPORT_DEFINE=yes
191 REM If simulator support is needed then set the define
192 If .%IS_SIMULATOR_SUPPORT_NEEDED% == .yes set SIMULATOR_SUPPORT_DEFINE=-ccs.setCompilerOptions "--define SIMULATOR_SUPPORT"
194 REM Goto the PDK Installation Path.
195 pushd %PDK_SHORT_NAME%
197 echo *****************************************************************************
198 echo Detecting UnitTest Projects in UART LLD package and importing them in the workspace %MY_WORKSPACE%
200 REM Search for all the test Project Files in UART.
201 for /F %%I IN ('dir /b /s *%DEVICE_NAME%*armtestproject.txt') do (
202 echo Detected Test Project: %%~nI
204 REM Goto each directory where the test project file is located and create the projects.
205 pushd %%~dI%%~pI
207 REM Execute the command to create the project using the parameters specified above.
209 %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.device "Cortex A.DRA75x_DRA74x" -ccs.endianness %ENDIAN% -ccs.kind executable -ccs.cgtVersion "GNU_4.7.4:Linaro" -rtsc.xdcVersion %XDC_VERSION% -rtsc.enableDspBios -rtsc.biosVersion %BIOS_VERSION% -rtsc.buildProfile "debug" -rtsc.products "com.ti.rtsc.SYSBIOS:%BIOS_VERSION%" -rtsc.platform "%RTSC_PLATFORM_NAME%" -rtsc.target %RTSC_TARGET% -ccs.rts libc.a libgcc.a libm.a libnosys.a -ccs.args %%~nI%%~xI %SIMULATOR_SUPPORT_DEFINE% -ccs.setCompilerOptions
210 echo Copying macro.ini
211 copy %MACROS_FILE% %MY_WORKSPACE%\%%~nI\macros.ini
213 popd
214 )
216 echo *****************************************************************************
217 echo Detecting Example Projects in UART LLD package and importing them in the workspace %MY_WORKSPACE%
219 REM Search for all the Example Project Files in the PDK.
220 for /F %%I IN ('dir /b /s *%DEVICE_NAME%*armexampleproject.txt') do (
221 echo Detected Example Project: %%~nI
223 REM Goto each directory where the example project file is located and create the projects.
224 pushd %%~dI%%~pI
226 REM Execute the command to create the project using the parameters specified above.
227 echo on
228 echo
229 echo foo
230 %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.device "Cortex A.DRA75x_DRA74x" -ccs.endianness %ENDIAN% -ccs.kind executable -ccs.cgtVersion "GNU_4.7.4:Linaro" -rtsc.xdcVersion %XDC_VERSION% -rtsc.enableDspBios -rtsc.biosVersion %BIOS_VERSION% -rtsc.buildProfile "debug" -rtsc.products "com.ti.rtsc.SYSBIOS:%BIOS_VERSION%" -rtsc.platform "%RTSC_PLATFORM_NAME%" -rtsc.target %RTSC_TARGET% -ccs.rts libc.a libgcc.a libm.a libnosys.a -ccs.args %%~nI%%~xI %SIMULATOR_SUPPORT_DEFINE% -ccs.setCompilerOptions
232 echo Copying macro.ini
233 copy %MACROS_FILE% %MY_WORKSPACE%\%%~nI\macros.ini
235 popd
236 )
238 popd