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 * ======== asm ========
90 * Define assembler executable
91 *
92 * Options:
93 * @p(dlist)
94 * -`-c`
95 * no linking
96 * -`-v28`
97 * compile for c28x.
98 * -`-ml`
99 * use large memory model
100 * -`-DLARGE_MODEL=1`
101 * because compiler and BIOS are broken; asembler
102 * defines __LARGE_MODEL but BIOS uses LARGE_MODEL
103 * -`--float_support=fpu32`
104 * Enable FPU
105 */
106 override readonly config xdc.bld.ITarget2.Command asm = {
107 cmd: "cl2000 -c",
108 opts: "-v28 -ml -DLARGE_MODEL=1 --float_support=fpu32"
109 };
110
111
112 /*!
113 * ======== lnk ========
114 * Define linker executable
115 */
116 override readonly config xdc.bld.ITarget2.Command lnk = {
117 cmd: "cl2000",
118 opts: "-z"
119 };
120
121 /*!
122 * ======== asmOpts ========
123 * User configurable assembler options.
124 *
125 * Defaults:
126 * @p(dlist)
127 * -`-qq`
128 * super quiet mode
129 */
130 override config xdc.bld.ITarget2.Options asmOpts = {
131 prefix: "-qq",
132 suffix: ""
133 };
134
135 /*!
136 * ======== ccOpts ========
137 * Compiler options
138 * @p(dlist)
139 * -`-qq`
140 * super quiet mode
141 * -`-pdsw225`
142 * generate a warning for implicitly declared functions; i.e.,
143 * functions without prototypes
144 * -`-Dfar= `
145 * ignore keyword far; this allows one to write code that can
146 * be compiled in large model and small model without #ifdef's
147 */
148 override config xdc.bld.ITarget2.Options ccOpts = {
149 prefix: "-qq -pdsw225 -Dfar= ",
150 suffix: ""
151 };
152
153 /*!
154 * ======== profiles ========
155 * Standard options profiles for the TI tool-chain.
156 */
157 override config xdc.bld.ITarget.OptionSet profiles[string] = [
158 ["debug", {
159 compileOpts: {
160 copts: "-g",
161 defs: "-D_DEBUG_=1",
162 }
163 }],
164 ["release", {
165 compileOpts: {
166 copts: "-O2",
167 },
168 }],
169 ["profile", {
170 compileOpts: {
171 copts: "-gp",
172 },
173 }],
174 ["coverage", {
175 compileOpts: {
176 copts: "-gp",
177 },
178 }],
179 ];
180
181 /*!
182 * ======== includeOpts ========
183 * Default include search path
184 */
185 override config string includeOpts = "-I$(rootDir)/include";
186
187 final override readonly config string sectMap[string] =
188 ti.targets.C28.sectMap;
189
190 final override readonly config Bool splitMap[string] =
191 ti.targets.C28.splitMap;
192
193 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
194 t_IArg : { size: 2, align: 2 },
195 t_Char : { size: 1, align: 1 },
196 t_Double : { size: 2, align: 2 },
197 t_Float : { size: 2, align: 2 },
198 t_Fxn : { size: 2, align: 2 },
199 t_Int : { size: 1, align: 1 },
200 t_Int8 : { size: 1, align: 1 },
201 t_Int16 : { size: 1, align: 1 },
202 t_Int32 : { size: 2, align: 2 },
203 t_Int64 : { size: 4, align: 2 },
204 t_Long : { size: 2, align: 2 },
205 t_LDouble : { size: 2, align: 2 },
206 t_LLong : { size: 4, align: 2 },
207 t_Ptr : { size: 2, align: 2 },
208 t_Short : { size: 1, align: 1 },
209 t_Size : { size: 2, align: 2 },
210 };
211
212 override readonly config Int bitsPerChar = 16;
213 }
214 215 216 217
218