1 2 3 4 5 6 7 8 9 10 11
12
13 14 15 16
17
18 /*!
19 * ======== C28_float ========
20 * TI C28 large model little endian with floating point support (fpu32)
21 */
22 metaonly module C28_float inherits ti.targets.ITarget {
23 override readonly config string name = "C28_float";
24 override readonly config string suffix = "28FP";
25 override readonly config string isa = "28FP";
26 override readonly config xdc.bld.ITarget.Model model = {
27 dataModel: "large",
28 endian: "little"
29 };
30
31 override readonly config string rts = "ti.targets.rts2800";
32
33 34 35
36 override config String compatibleSuffixes[] = ["28L"];
37
38 final override readonly config Bool alignDirectiveSupported = false;
39
40 /*!
41 * ======== ar ========
42 * Define archiver executable
43 *
44 * Options:
45 * @p(dlist)
46 * -`-r`
47 * replace file
48 * -`-q`
49 * quiet mode
50 */
51 override readonly config xdc.bld.ITarget2.Command ar = {
52 cmd: "ar2000",
53 opts: "rq"
54 };
55
56
57 /*!
58 * ======== cc ========
59 * Define compiler executable
60 *
61 * Options:
62 * @p(dlist)
63 * -`-c`
64 * no linking
65 * -`-v28`
66 * compile for c28x.
67 * -`-ml`
68 * use large memory model
69 * -`-DLARGE_MODEL=1`
70 * required to use va_arg in large model
71 * -`--float_support=fpu32`
72 * Enable FPU
73 */
74 override readonly config xdc.bld.ITarget2.Command cc = {
75 cmd: "cl2000 -c",
76 opts: "-v28 -DLARGE_MODEL=1 -ml --float_support=fpu32"
77 };
78
79 /*!
80 * ======== vers ========
81 * Define the vers command
82 */
83 override readonly config xdc.bld.ITarget2.Command vers = {
84 cmd: "cl2000",
85 opts: "--compiler_revision"
86 };
87
88
89 /*!
90 * ======== asm ========
91 * Define assembler executable
92 *
93 * Options:
94 * @p(dlist)
95 * -`-c`
96 * no linking
97 * -`-v28`
98 * compile for c28x.
99 * -`-ml`
100 * use large memory model
101 * -`-DLARGE_MODEL=1`
102 * because compiler and BIOS are broken; asembler
103 * defines __LARGE_MODEL but BIOS uses LARGE_MODEL
104 * -`--float_support=fpu32`
105 * Enable FPU
106 */
107 override readonly config xdc.bld.ITarget2.Command asm = {
108 cmd: "cl2000 -c",
109 opts: "-v28 -ml -DLARGE_MODEL=1 --float_support=fpu32"
110 };
111
112
113 /*!
114 * ======== lnk ========
115 * Define linker executable
116 */
117 override readonly config xdc.bld.ITarget2.Command lnk = {
118 cmd: "lnk2000",
119 opts: ""
120 };
121
122
123 /*!
124 * ======== asmOpts ========
125 * User configurable assembler options.
126 *
127 * Defaults:
128 * @p(dlist)
129 * -`-qq`
130 * super quiet mode
131 */
132 override config xdc.bld.ITarget2.Options asmOpts = {
133 prefix: "-qq",
134 suffix: ""
135 };
136
137 /*!
138 * ======== ccOpts ========
139 * Compiler options
140 * @p(dlist)
141 * -`-qq`
142 * super quiet mode
143 * -`-pdsw225`
144 * generate a warning for implicitly declared functions; i.e.,
145 * functions without prototypes
146 * -`-Dfar= `
147 * ignore keyword far; this allows one to write code that can
148 * be compiled in large model and small model without #ifdef's
149 */
150 override config xdc.bld.ITarget2.Options ccOpts = {
151 prefix: "-qq -pdsw225 -Dfar= ",
152 suffix: ""
153 };
154
155 /*!
156 * ======== profiles ========
157 * Standard options profiles for the TI tool-chain.
158 */
159 override config xdc.bld.ITarget.OptionSet profiles[string] = [
160 ["debug", {
161 compileOpts: {
162 copts: "-g",
163 defs: "-D_DEBUG_=1",
164 }
165 }],
166 ["release", {
167 compileOpts: {
168 copts: "-O2",
169 },
170 }],
171 ["profile", {
172 compileOpts: {
173 copts: "-gp",
174 },
175 }],
176 ["coverage", {
177 compileOpts: {
178 copts: "-gp",
179 },
180 }],
181 ["whole_program", {
182 compileOpts: {
183 copts: "-oe -O2 -mo",
184 },
185 }],
186 ["whole_program_debug", {
187 compileOpts: {
188 copts: "-oe --symdebug:dwarf -mo",
189 },
190 }],
191 ];
192
193 /*!
194 * ======== includeOpts ========
195 * Default include search path
196 */
197 override config string includeOpts = "-I$(rootDir)/include";
198
199 final override readonly config string sectMap[string] =
200 ti.targets.C28.sectMap;
201
202 final override readonly config Bool splitMap[string] =
203 ti.targets.C28.splitMap;
204
205 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
206 t_IArg : { size: 2, align: 2 },
207 t_Char : { size: 1, align: 1 },
208 t_Double : { size: 2, align: 2 },
209 t_Float : { size: 2, align: 2 },
210 t_Fxn : { size: 2, align: 2 },
211 t_Int : { size: 1, align: 1 },
212 t_Int8 : { size: 1, align: 1 },
213 t_Int16 : { size: 1, align: 1 },
214 t_Int32 : { size: 2, align: 2 },
215 t_Int64 : { size: 4, align: 2 },
216 t_Long : { size: 2, align: 2 },
217 t_LDouble : { size: 2, align: 2 },
218 t_LLong : { size: 4, align: 2 },
219 t_Ptr : { size: 2, align: 2 },
220 t_Short : { size: 1, align: 1 },
221 t_Size : { size: 2, align: 2 },
222 };
223
224 override readonly config Int bitsPerChar = 16;
225 }
226 227 228 229
230