1 2 3 4 5 6 7 8 9 10 11
12 13 14 15
16
17
18 /*!
19 * ======== C28_large ========
20 * TI C28 large model target
21 */
22 metaonly module C28_large inherits ti.targets.ITarget {
23 override readonly config string name = "C28_large";
24 override readonly config string suffix = "28L";
25 override readonly config string isa = "28";
26 override readonly config xdc.bld.ITarget.Model model = {dataModel: "large", endian: "little"};
27 override readonly config string rts = "ti.targets.rts2800";
28 final override readonly config Bool alignDirectiveSupported = false;
29
30 /*!
31 * ======== ar ========
32 * Define archiver executable
33 *
34 * Options:
35 * @p(dlist)
36 * -`-r`
37 * replace file
38 * -`-q`
39 * quiet mode
40 */
41 override readonly config ITarget.Command ar = {
42 cmd: "ar2000",
43 opts: "rq"
44 };
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 ITarget.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 ITarget.Command vers = {
72 cmd: "cl2000",
73 opts: "-version"
74 };
75
76
77 /*!
78 * ======== asm ========
79 * Define assembler executable
80 *
81 * Options:
82 * @p(dlist)
83 * -`-c`
84 * no linking
85 * -`-v28`
86 * compile for c28x.
87 * -`-ml`
88 * use large memory model
89 * -`-DLARGE_MODEL=1`
90 * because compiler and BIOS are broken; asembler
91 * defines __LARGE_MODEL but BIOS uses LARGE_MODEL
92 *
93 */
94 override readonly config ITarget.Command asm = {
95 cmd: "cl2000 -c",
96 opts: "-v28 -ml -DLARGE_MODEL=1"
97 };
98
99
100 /*!
101 * ======== lnk ========
102 * Define linker executable
103 */
104 override readonly config ITarget.Command lnk = {
105 cmd: "lnk2000",
106 opts: ""
107 };
108
109
110 /*!
111 * ======== asmOpts ========
112 * User configurable assembler options.
113 *
114 * Defaults:
115 * @p(dlist)
116 * -`-qq`
117 * super quiet mode
118 */
119 override config ITarget.Options asmOpts = {
120 prefix: "-qq",
121 suffix: ""
122 };
123
124 /*!
125 * ======== ccOpts ========
126 * Compiler options
127 * @p(dlist)
128 * -`-qq`
129 * super quiet mode
130 * -`-pdsw225`
131 * generate a warning for implicitly declared functions; i.e.,
132 * functions without prototypes
133 * -`-Dfar= `
134 * ignore keyword far; this allows one to write code that can
135 * be compiled in large model and small model without #ifdef's
136 */
137 override config ITarget.Options ccOpts = {
138 prefix: "-qq -pdsw225 -Dfar= ",
139 suffix: ""
140 };
141
142
143 /*!
144 * ======== lnkOpts ========
145 * Linker options
146 *
147 * Options:
148 * @p(dlist)
149 * -`-q`
150 * Quite run
151 * -`-u`
152 * Place unresolved external symbol into symbol table
153 * -`-c`
154 * ROM autoinitialization model
155 * -`-m`
156 * create a map file
157 * -`-l`
158 * archive library file as linker input
159 */
160 override config ITarget.Options lnkOpts = {
161 prefix: "-w -q -u _c_int00",
162 suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800_ml.lib"
163 };
164
165 /*!
166 * ======== includeOpts ========
167 * Default include search path
168 */
169 override config string includeOpts = "-I$(rootDir)/include";
170
171 final override readonly config string sectMap[string] =
172 ti.targets.C28.sectMap;
173
174 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
175 t_IArg : { size: 2, align: 2 },
176 t_Char : { size: 1, align: 1 },
177 t_Double : { size: 2, align: 2 },
178 t_Float : { size: 2, align: 2 },
179 t_Fxn : { size: 2, align: 2 },
180 t_Int : { size: 1, align: 1 },
181 t_Int8 : { size: 1, align: 1 },
182 t_Int16 : { size: 1, align: 1 },
183 t_Int32 : { size: 2, align: 2 },
184 t_Int64 : { size: 4, align: 2 },
185 t_Long : { size: 2, align: 2 },
186 t_LDouble : { size: 2, align: 2 },
187 t_LLong : { size: 4, align: 2 },
188 t_Ptr : { size: 2, align: 2 },
189 t_Short : { size: 1, align: 1 },
190 t_Size : { size: 2, align: 2 },
191 };
192
193 override readonly config Int bitsPerChar = 16;
194 }
195 196 197
198