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