1 2 3 4 5 6 7 8 9 10 11
12 13 14 15
16
17 /*!
18 * ======== ITarget ========
19 * A TI specific extension to the base `xdc.bld.ITarget3` interface.
20 */
21 @TargetHeader("xdc/bld/stddefs.xdt")
22 metaonly interface ITarget inherits xdc.bld.ITarget3 {
23
24 override readonly config string stdInclude = "ti/targets/std.h";
25
26 /*!
27 * ======== binDir ========
28 * This parameter controls the location of the target's commands.
29 *
30 * All build commands returned within a command set
31 * (`xdc.bld.ITarget.CommandSet.cmds`) are formed by prefixing `binDir`
32 * to this target's Command.cmd specification. For example, the
33 * compile command returned is formed as follows:
34 * @p(code)
35 * $(binDir)$(cc.cmd)
36 * @p
37 * where, `$(binDir)` is this target's `binDir` value and `$(cc.cmd)` is
38 * the value of this target's `cc.cmd` string.
39 *
40 * If `binDir` is non-empty then it must end with '/'. If it is empty,
41 * the target's commands (compiler, linker, archiver, etc.) will be
42 * located along a path constructed from this target's `pathPrefix`.
43 */
44 config string binDir = "$(rootDir)/bin/";
45
46 /*!
47 * ======== pathPrefix ========
48 * A prefix to the PATH environment variable
49 *
50 * Each target command is executed with C_DIR set to "" and PATH
51 * set as follows:
52 * @p(code)
53 * $(pathPrefix);$(binDir);$(PATH)
54 * @p
55 * where, `$(pathPrefix)` and `$(binDir)` are the values of the
56 * configuration parameters and `$(PATH)` is the value of the `PATH`
57 * environment variable set by the `xdc` command (type 'xdc -n' to
58 * see this).
59 *
60 * Embedded ';' characters within `pathPrefix` separate directory
61 * names. On UNIX hosts these ';' characters are convered to an
62 * appropriate separator; i.e., ':'.
63 */
64 config string pathPrefix = "";
65
66 override config String binaryParser = "ti.targets.omf.cof.Coff";
67
68 /*!
69 * ======== debugGen ========
70 * TI Debugger/IDE file generation support.
71 *
72 * @_nodoc
73 * These templates below are long outdated and are no longer used.
74 * They remain as an example in the event that we want to generate
75 * project suport in the future.
76 *
77 * To avoid unnecessary build time overhead, these files are not always
78 * generated; by default, they are only generated for "debug" profiles.
79 * The generation of these files is controlled by the
80 * `{@link xdc.cfg.Program#gen}` configuration parameter. To force these
81 * files to be generated for a particular executable, add the following
82 * line to the executable's program configuration script:
83 * @p(code)
84 * Program.gen.debuggerFiles = true;
85 * @p
86 * It is also possible to control the generation via build options; see
87 * `{@link xdc.bld.ITarget#DebugGen}`.
88 *
89 * @a(See Also) `xdc.bld.ITarget` contains addition information about
90 * how to create and use these templates.
91 */
92
93
94
95
96
97
98 override config xdc.bld.ITarget.DebugGen debugGen = {
99 execTemplate : null,
100 execPattern : null,
101 packageTemplate: null,
102 packagePattern : null
103 };
104
105 /*!
106 * ======== extensions ========
107 * File extensions recognized by TI targets
108 *
109 * @a(TI Specifics)
110 * For TI targets, the `typ` string field of an
111 * `xdc.bld.ITarget.Extension` structure may be of the form
112 * `"<cmd>:<langOpt>"` where `<cmd>` is one of `"asm"`, `"c"`, `"cpp"`,
113 * and `<langOpt>` is the language option used to identify the source
114 * language of a source file. This allows one to explicitly control the
115 * language flag passed to the compiler based on a source file's
116 * extension; in particular, one can define separate source extensions
117 * for "linear" and "scheduled" assembly files, or simply cause `".s62"`
118 * files to be treated as "linear" assembly rather than "scheduled"
119 * assembly.
120 *
121 * For example,
122 * @p(code)
123 * tiTargets.C62.extensions[".s62"] = {suf: ".s62", typ: "asm:-fl"};
124 * @p
125 * causes all `".s62"` files to be treated as linear assembly.
126 *
127 * If no ':' appears in the `typ` string, a default will be used:
128 * `"-fa"` for `"asm"` files `"-fc"` for `"c"` files, and `"-fp"` for
129 * `"cpp"` files.
130 */
131 override config xdc.bld.ITarget.Extension extensions[string] =
132 xdc.bld.ITarget.extensions;
133
134 readonly config Bool splitMap[string];
135
136 /*!
137 * ======== profiles ========
138 * Standard options profiles for the TI tool-chain.
139 */
140 override config xdc.bld.ITarget.OptionSet profiles[string] = [
141 ["debug", {
142 compileOpts: {
143 copts: "-g",
144 defs: "-D_DEBUG_=1",
145 }
146 }],
147 ["release", {
148 compileOpts: {
149 copts: "-O2",
150 },
151 }],
152 ];
153
154 /*!
155 * ======== versionMap ========
156 * Map of TI compiler version numbers to compatibility keys.
157 *
158 * This map translates version string information from the compiler
159 * into a compatibility key. The compatibility key is used to validate
160 * consistency among a collection of packages used in a configuration.
161 *
162 * TI compiler strings are formed by parsing the output of the
163 * compiler's --compiler_revision option and creating a string of the
164 * form:
165 * @p(code)
166 * <comp>_<ver>
167 * @p
168 * where `<comp>` is the first word of the output and `<ver>` is the
169 * version number that appears on this same line.
170 *
171 * There are two forms of version numbers output by the TI code gen
172 * tools; an "old" style that is of the form "<major>.<minor>" and a
173 * new style of the form "<major>.<minor>.<update>[.<branch>][<qual>],
174 * where <major>, <minor>, <update>, and <branch> are non-negative
175 * integers and <qual> is of the form "[IBAP]<yyddd>", and <yyddd>
176 * is the last two digits of the year concatenated with the number of
177 * the day.
178 *
179 * If a compiler version is not found in this map the default is
180 * "1,0,<major>.<minor>" for old style version numbers, and
181 * "1,0,<major>.<minor>,<update>[.<branch>][,<yyddd>]" for new style
182 * version numbers.
183 *
184 * The user only needs to extend this table when a significant
185 * incompatibility occurs (and this package doesn't know about it) or
186 * when two versions of the compiler should be treated as 100%
187 * compatible.
188 *
189 * @a(Examples)
190 * @p(code)
191 * var C62 = xdc.useModule('ti.targets.C62');
192 *
193 * // assert that 4.0 is forward compatible with 4.32
194 * C62.versionMap["TMS320C6x_4.32"] = "1,0,4.0,0";
195 *
196 * // assert that 4.28 is incompatible with all other compilers
197 * C62.versionMap["TMS320C6x_4.28"] = "1,1,4.28,0";
198 */
199 override config string versionMap[string] = [
200 ["TMS320C6x_4.32", "1,0,4.32,0"],
201 ["TMS320C2000_3.07", "1,0,3.07,0"],
202 ];
203
204 /*!
205 * ======== alignDirectiveSupported ========
206 * The compiler supports an align directive.
207 */
208 override readonly config Bool alignDirectiveSupported = true;
209
210 /*!
211 * ======== ccConfigOpts ========
212 * User configurable compiler options for the generated config C file.
213 */
214 override config xdc.bld.ITarget2.Options ccConfigOpts = {
215 prefix: "$(ccOpts.prefix) -mo",
216 suffix: "$(ccOpts.suffix)"
217 };
218
219 /*!
220 * ======== lnkOpts ========
221 * Linker options
222 *
223 * Options:
224 * @p(dlist)
225 * -`-q`
226 * Quite run
227 * -`-u`
228 * Place unresolved external symbol into symbol table
229 * -`-c`
230 * ROM autoinitialization model
231 * -`-m`
232 * create a map file
233 * -`-l`
234 * archive library file as linker input
235 */
236 override config xdc.bld.ITarget2.Options lnkOpts = {
237 prefix: "-q -u _c_int00",
238 suffix: "-w -c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/libc.a"
239 };
240
241 /*!
242 * ======== asmName ========
243 * The function that converts a C name into an assembly name
244 */
245 String asmName(String CName);
246
247 /*!
248 * ======== vers ========
249 * The command used to get the tool-chain to return a version number.
250 */
251 readonly config xdc.bld.ITarget2.Command vers;
252
253 /*!
254 * ======== version ========
255 * The Compatibility Key associated with this target.
256 *
257 * The first two components of this target Compatibility Key are '1,0'.
258 * The rest of the Key represents the compiler version. The third
259 * component combines the major and the minor version number in the format
260 * Major.Minor. The fourth component is the patch number, and the optional
261 * fifth component is the version of an Alpha or Beta release.
262 *
263 * @a(Example)
264 * If this target's `rootDir` points to the compiler version 6.0.11, the
265 * Compatibility Key is [1,0,6.0,11]. If this target's `rootDir` points to
266 * the compiler version 7.0.0B1, the Compatibility Key is [1,0,7.0,0,1].
267 *
268 */
269 override metaonly config String version;
270
271 272 273 274 275
276 override metaonly config String rawVersion;
277
278 }
279 280 281 282
283