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 /*!
49 * ======== cc ========
50 * Define compiler executable
51 *
52 * Options:
53 * @p(dlist)
54 * -`-c`
55 * no linking
56 * -`-v28`
57 * compile for c28x.
58 * -`-ml`
59 * use large memory model
60 * -`-DLARGE_MODEL=1`
61 * required to use va_arg in large model
62 */
63 override readonly config xdc.bld.ITarget2.Command cc = {
64 cmd: "cl2000 -c",
65 opts: "-v28 -DLARGE_MODEL=1 -ml"
66 };
67
68 /*!
69 * ======== vers ========
70 * Define the vers command
71 */
72 override readonly config xdc.bld.ITarget2.Command vers = {
73 cmd: "cl2000",
74 opts: "--compiler_revision"
75 };
76
77
78 /*!
79 * ======== asm ========
80 * Define assembler executable
81 *
82 * Options:
83 * @p(dlist)
84 * -`-c`
85 * no linking
86 * -`-v28`
87 * compile for c28x.
88 * -`-ml`
89 * use large memory model
90 * -`-DLARGE_MODEL=1`
91 * because compiler and BIOS are broken; asembler
92 * defines __LARGE_MODEL but BIOS uses LARGE_MODEL
93 *
94 */
95 override readonly config xdc.bld.ITarget2.Command asm = {
96 cmd: "cl2000 -c",
97 opts: "-v28 -ml -DLARGE_MODEL=1"
98 };
99
100
101 /*!
102 * ======== lnk ========
103 * Define linker executable
104 */
105 override readonly config xdc.bld.ITarget2.Command lnk = {
106 cmd: "lnk2000",
107 opts: ""
108 };
109
110
111 /*!
112 * ======== asmOpts ========
113 * User configurable assembler options.
114 *
115 * Defaults:
116 * @p(dlist)
117 * -`-qq`
118 * super quiet mode
119 */
120 override config xdc.bld.ITarget2.Options asmOpts = {
121 prefix: "-qq",
122 suffix: ""
123 };
124
125 /*!
126 * ======== ccOpts ========
127 * Compiler options
128 * @p(dlist)
129 * -`-qq`
130 * super quiet mode
131 * -`-pdsw225`
132 * generate a warning for implicitly declared functions; i.e.,
133 * functions without prototypes
134 * -`-Dfar= `
135 * ignore keyword far; this allows one to write code that can
136 * be compiled in large model and small model without #ifdef's
137 */
138 override config xdc.bld.ITarget2.Options ccOpts = {
139 prefix: "-qq -pdsw225 -Dfar= ",
140 suffix: ""
141 };
142
143
144 /*!
145 * ======== lnkOpts ========
146 * Linker options
147 *
148 * Options:
149 * @p(dlist)
150 * -`-q`
151 * Quite run
152 * -`-u`
153 * Place unresolved external symbol into symbol table
154 * -`-c`
155 * ROM autoinitialization model
156 * -`-m`
157 * create a map file
158 * -`-l`
159 * archive library file as linker input
160 */
161 override config xdc.bld.ITarget2.Options lnkOpts = {
162 prefix: "-w -q -u _c_int00",
163 suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800_ml.lib"
164 };
165
166 /*!
167 * ======== includeOpts ========
168 * Default include search path
169 */
170 override config string includeOpts = "-I$(rootDir)/include";
171
172 final override readonly config string sectMap[string] =
173 ti.targets.C28.sectMap;
174
175 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
176 t_IArg : { size: 2, align: 2 },
177 t_Char : { size: 1, align: 1 },
178 t_Double : { size: 2, align: 2 },
179 t_Float : { size: 2, align: 2 },
180 t_Fxn : { size: 2, align: 2 },
181 t_Int : { size: 1, align: 1 },
182 t_Int8 : { size: 1, align: 1 },
183 t_Int16 : { size: 1, align: 1 },
184 t_Int32 : { size: 2, align: 2 },
185 t_Int64 : { size: 4, align: 2 },
186 t_Long : { size: 2, align: 2 },
187 t_LDouble : { size: 2, align: 2 },
188 t_LLong : { size: 4, align: 2 },
189 t_Ptr : { size: 2, align: 2 },
190 t_Short : { size: 1, align: 1 },
191 t_Size : { size: 2, align: 2 },
192 };
193
194 override readonly config Int bitsPerChar = 16;
195 }
196 197 198 199
200