1 2 3 4
5
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
37
38 /*!
39 * ======== C28 ========
40 * TI C28 default runtime model (little endian)
41 */
42 metaonly module C28 inherits ti.targets.ITarget {
43 override readonly config string name = "C28";
44 override readonly config string suffix = "28";
45 override readonly config string isa = "28";
46 override readonly config xdc.bld.ITarget.Model model= {endian: "little"};
47 override readonly config string rts = "ti.targets.rts2800";
48 final override readonly config Bool alignDirectiveSupported = false;
49
50 /*!
51 * ======== ar ========
52 * Define archiver executable
53 *
54 * Options:
55 * @p(dlist)
56 * -`-r`
57 * replace file
58 * -`-q`
59 * quiet mode
60 */
61 override readonly config xdc.bld.ITarget2.Command ar = {
62 cmd: "ar2000",
63 opts: "rq"
64 };
65
66 /*!
67 * ======== cc ========
68 * Define compiler executable
69 *
70 * Options:
71 * @p(dlist)
72 * -`-c`
73 * no linking
74 * -`-v28`
75 * compile for c28x.
76 */
77 override readonly config xdc.bld.ITarget2.Command cc = {
78 cmd: "cl2000 -c",
79 opts: "-v28"
80 };
81
82 /*!
83 * ======== vers ========
84 * Define the vers command
85 */
86 override readonly config xdc.bld.ITarget2.Command vers = {
87 cmd: "cl2000",
88 opts: "--compiler_revision"
89 };
90
91 /*!
92 * ======== asm ========
93 * Define assembler executable
94 *
95 * Options:
96 * @p(dlist)
97 * -`-c`
98 * no linking
99 * -`-v28`
100 * compile for c28x.
101 *
102 */
103 override readonly config xdc.bld.ITarget2.Command asm = {
104 cmd: "cl2000 -c",
105 opts: "-v28"
106 };
107
108 /*!
109 * Define linker executable
110 */
111 override readonly config xdc.bld.ITarget2.Command lnk = {
112 cmd: "cl2000",
113 opts: "-z"
114 };
115
116 /*!
117 * ======== asmOpts ========
118 * User configurable assembler options.
119 *
120 * Defaults:
121 * @p(dlist)
122 * -`-qq`
123 * super quiet mode
124 */
125 override config xdc.bld.ITarget2.Options asmOpts = {
126 prefix: "-qq",
127 suffix: ""
128 };
129
130 /*!
131 * ======== ccOpts ========
132 * Compiler options
133 * @p(dlist)
134 * -`-qq`
135 * super quiet mode
136 * -`-pdsw225`
137 * generate a warning for implicitly declared functions; i.e.,
138 * functions without prototypes
139 */
140 override config xdc.bld.ITarget2.Options ccOpts = {
141 prefix: "-qq -pdsw225",
142 suffix: ""
143 };
144
145 /*!
146 * ======== profiles ========
147 * Standard options profiles for the TI tool-chain.
148 */
149 override config xdc.bld.ITarget.OptionSet profiles[string] = [
150 ["debug", {
151 compileOpts: {
152 copts: "-g",
153 defs: "-D_DEBUG_=1",
154 }
155 }],
156 ["release", {
157 compileOpts: {
158 copts: "-O2",
159 },
160 }],
161 ["profile", {
162 compileOpts: {
163 copts: "-g --gen_profile_info",
164 },
165 }],
166 ["coverage", {
167 compileOpts: {
168 copts: "-g --gen_profile_info",
169 },
170 }],
171 ];
172
173
174 override config string includeOpts = "-I$(rootDir)/include";
175
176 final override readonly config string sectMap[string] = [
177 [".text", "code"],
178 [".switch", "code"],
179 [".data", "data"],
180 [".cinit", "code"],
181 [".bss", "data"],
182 [".ebss", "data"],
183 [".econst", "code"],
184 [".const", "code"],
185 [".stack", "stack"],
186 [".sysmem", "data"],
187 [".esysmem", "data"],
188 [".pinit", "code"],
189 [".args", "data"],
190 [".cio", "data"],
191 ];
192
193 final override readonly config Bool splitMap[string] = [
194 [".text", true],
195 [".const", true],
196 [".econst", true],
197 [".ebss", true],
198 [".data", true],
199 [".switch", true],
200 [".far", true],
201 [".args", true],
202 [".cio", true]
203 ];
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: 1 },
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: 1, align: 1 },
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