1 2 3 4 5 6 7 8 9 10 11
12 13 14 15
16
17 /*!
18 * ======== C28 ========
19 * TI C28 target
20 */
21 metaonly module C28 inherits ti.targets.ITarget {
22 override readonly config string name = "C28";
23 override readonly config string suffix = "28";
24 override readonly config string isa = "28";
25 override readonly config xdc.bld.ITarget.Model model= {endian: "little"};
26 override readonly config string rts = "ti.targets.rts2800";
27 final override readonly config Bool alignDirectiveSupported = false;
28
29 /*!
30 * ======== ar ========
31 * Define archiver executable
32 *
33 * Options:
34 * @p(dlist)
35 * -`-r`
36 * replace file
37 * -`-q`
38 * quiet mode
39 */
40 override readonly config ITarget.Command ar = {
41 cmd: "ar2000",
42 opts: "rq"
43 };
44
45 /*!
46 * ======== cc ========
47 * Define compiler executable
48 *
49 * Options:
50 * @p(dlist)
51 * -`-c`
52 * no linking
53 * -`-v28`
54 * compile for c28x.
55 */
56 override readonly config ITarget.Command cc = {
57 cmd: "cl2000 -c",
58 opts: "-v28"
59 };
60
61 /*!
62 * ======== vers ========
63 * Define the vers command
64 */
65 override readonly config ITarget.Command vers = {
66 cmd: "cl2000",
67 opts: "-version"
68 };
69
70 /*!
71 * ======== asm ========
72 * Define assembler executable
73 *
74 * Options:
75 * @p(dlist)
76 * -`-c`
77 * no linking
78 * -`-v28`
79 * compile for c28x.
80 *
81 */
82 override readonly config ITarget.Command asm = {
83 cmd: "cl2000 -c",
84 opts: "-v28"
85 };
86
87 /*!
88 * Define linker executable
89 */
90 override readonly config ITarget.Command lnk = {
91 cmd: "lnk2000",
92 opts: ""
93 };
94
95 /*!
96 * ======== asmOpts ========
97 * User configurable assembler options.
98 *
99 * Defaults:
100 * @p(dlist)
101 * -`-qq`
102 * super quiet mode
103 */
104 override config ITarget.Options asmOpts = {
105 prefix: "-qq",
106 suffix: ""
107 };
108
109 /*!
110 * ======== ccOpts ========
111 * Compiler options
112 * @p(dlist)
113 * -`-qq`
114 * super quiet mode
115 * -`-pdsw225`
116 * generate a warning for implicitly declared functions; i.e.,
117 * functions without prototypes
118 */
119 override config ITarget.Options ccOpts = {
120 prefix: "-qq -pdsw225",
121 suffix: ""
122 };
123
124 /*!
125 * ======== lnkOpts ========
126 * Linker options
127 *
128 * Options:
129 * @p(dlist)
130 * -`-q`
131 * Quite run
132 * -`-u`
133 * Place unresolved external symbol into symbol table
134 * -`-c`
135 * ROM autoinitialization model
136 * -`-m`
137 * create a map file
138 * -`-l`
139 * archive library file as linker input
140 */
141 override config ITarget.Options lnkOpts = {
142 prefix: "-w -q -u _c_int00",
143 suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800.lib"
144 };
145
146
147 override config string includeOpts = "-I$(rootDir)/include";
148
149 final override readonly config string sectMap[string] = [
150 [".text", "code"],
151 [".switch", "data"],
152 [".data", "data"],
153 [".cinit", "code"],
154 [".bss", "data"],
155 [".ebss", "data"],
156 [".econst", "data"],
157 [".const", "data"],
158 [".stack", "stack"],
159 [".sysmem", "data"],
160 [".esysmem", "data"],
161 [".pinit", "code"],
162 [".args", "data"],
163 [".cio", "data"],
164 [".reset", "code"],
165 ];
166
167 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
168 t_IArg : { size: 2, align: 2 },
169 t_Char : { size: 1, align: 1 },
170 t_Double : { size: 2, align: 2 },
171 t_Float : { size: 2, align: 2 },
172 t_Fxn : { size: 2, align: 1 },
173 t_Int : { size: 1, align: 1 },
174 t_Int8 : { size: 1, align: 1 },
175 t_Int16 : { size: 1, align: 1 },
176 t_Int32 : { size: 2, align: 2 },
177 t_Int64 : { size: 4, align: 2 },
178 t_Long : { size: 2, align: 2 },
179 t_LDouble : { size: 2, align: 2 },
180 t_LLong : { size: 4, align: 2 },
181 t_Ptr : { size: 1, align: 1 },
182 t_Short : { size: 1, align: 1 },
183 t_Size : { size: 2, align: 2 },
184 };
185
186 override readonly config Int bitsPerChar = 16;
187 }
188 189 190
191