1 2 3 4 5 6 7 8 9 10 11
12 13 14 15
16
17 /*!
18 * ======== C28_float ========
19 * TI C28 with float point support (fpu32) target
20 */
21 metaonly module C28_float inherits ti.targets.ITarget {
22 override readonly config string name = "C28_float";
23 override readonly config string suffix = "28FP";
24 override readonly config string isa = "28FP";
25 override readonly config xdc.bld.ITarget.Model model = {
26 dataModel: "large",
27 endian: "little"
28 };
29
30 override readonly config string rts = "ti.targets.rts2800";
31
32 33 34
35 override config String compatibleSuffixes[] = ["28L"];
36
37 final override readonly config Bool alignDirectiveSupported = false;
38
39 /*!
40 * ======== ar ========
41 * Define archiver executable
42 *
43 * Options:
44 * @p(dlist)
45 * -`-r`
46 * replace file
47 * -`-q`
48 * quiet mode
49 */
50 override readonly config ITarget.Command ar = {
51 cmd: "ar2000",
52 opts: "rq"
53 };
54
55
56 /*!
57 * ======== cc ========
58 * Define compiler executable
59 *
60 * Options:
61 * @p(dlist)
62 * -`-c`
63 * no linking
64 * -`-v28`
65 * compile for c28x.
66 * -`-ml`
67 * use large memory model
68 * -`-DLARGE_MODEL=1`
69 * required to use va_arg in large model
70 * -`--float_support=fpu32`
71 * Enable FPU
72 */
73 override readonly config ITarget.Command cc = {
74 cmd: "cl2000 -c",
75 opts: "-v28 -DLARGE_MODEL=1 -ml --float_support=fpu32"
76 };
77
78 /*!
79 * ======== vers ========
80 * Define the vers command
81 */
82 override readonly config ITarget.Command vers = {
83 cmd: "cl2000",
84 opts: "-version"
85 };
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 ITarget.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 ITarget.Command lnk = {
117 cmd: "lnk2000",
118 opts: ""
119 };
120
121
122 /*!
123 * ======== asmOpts ========
124 * User configurable assembler options.
125 *
126 * Defaults:
127 * @p(dlist)
128 * -`-qq`
129 * super quiet mode
130 */
131 override config ITarget.Options asmOpts = {
132 prefix: "-qq",
133 suffix: ""
134 };
135
136 /*!
137 * ======== ccOpts ========
138 * Compiler options
139 * @p(dlist)
140 * -`-qq`
141 * super quiet mode
142 * -`-pdsw225`
143 * generate a warning for implicitly declared functions; i.e.,
144 * functions without prototypes
145 * -`-Dfar= `
146 * ignore keyword far; this allows one to write code that can
147 * be compiled in large model and small model without #ifdef's
148 */
149 override config ITarget.Options ccOpts = {
150 prefix: "-qq -pdsw225 -Dfar= ",
151 suffix: ""
152 };
153
154
155 /*!
156 * ======== lnkOpts ========
157 * Linker options
158 *
159 * Options:
160 * @p(dlist)
161 * -`-q`
162 * Quite run
163 * -`-u`
164 * Place unresolved external symbol into symbol table
165 * -`-c`
166 * ROM autoinitialization model
167 * -`-m`
168 * create a map file
169 * -`-l`
170 * archive library file as linker input
171 */
172 override config ITarget.Options lnkOpts = {
173 prefix: "-w -q -u _c_int00",
174 suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800_fpu32.lib"
175 };
176
177 /*!
178 * ======== includeOpts ========
179 * Default include search path
180 */
181 override config string includeOpts = "-I$(rootDir)/include";
182
183 final override readonly config string sectMap[string] =
184 ti.targets.C28.sectMap;
185
186 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
187 t_IArg : { size: 2, align: 2 },
188 t_Char : { size: 1, align: 1 },
189 t_Double : { size: 2, align: 2 },
190 t_Float : { size: 2, align: 2 },
191 t_Fxn : { size: 2, align: 2 },
192 t_Int : { size: 1, align: 1 },
193 t_Int8 : { size: 1, align: 1 },
194 t_Int16 : { size: 1, align: 1 },
195 t_Int32 : { size: 2, align: 2 },
196 t_Int64 : { size: 4, align: 2 },
197 t_Long : { size: 2, align: 2 },
198 t_LDouble : { size: 2, align: 2 },
199 t_LLong : { size: 4, align: 2 },
200 t_Ptr : { size: 2, align: 2 },
201 t_Short : { size: 1, align: 1 },
202 t_Size : { size: 2, align: 2 },
203 };
204
205 override readonly config Int bitsPerChar = 16;
206 }
207 208 209
210