1 2 3 4 5 6 7 8 9 10 11
12
13 14 15 16
17
18 /*!
19 * ======== C54 ========
20 * TI C54 default runtime model
21 */
22 metaonly module C54 inherits ti.targets.ITarget {
23 override readonly config string name = "C54";
24 override readonly config string suffix = "54";
25 override readonly config string isa = "54";
26 override readonly config xdc.bld.ITarget.Model model = {};
27 override readonly config string rts = "ti.targets.rts5400";
28
29 override readonly config xdc.bld.ITarget2.Command ar = {
30 cmd: "ar500",
31 opts: "rq"
32 };
33
34 override readonly config xdc.bld.ITarget2.Command cc = {
35 cmd: "cl500 -c",
36 opts: ""
37 };
38
39 override readonly config xdc.bld.ITarget2.Command vers = {
40 cmd: "cl500",
41 opts: "--compiler_revision"
42 };
43
44 override readonly config xdc.bld.ITarget2.Command asm = {
45 cmd: "cl500 -c",
46 opts: ""
47 };
48
49 override readonly config xdc.bld.ITarget2.Command lnk = {
50 cmd: "lnk500",
51 opts: ""
52 };
53
54 /*!
55 * ======== asmOpts ========
56 * User configurable assembler options.
57 *
58 * Defaults:
59 * @p(dlist)
60 * -`-qq`
61 * super quiet mode
62 */
63 override config xdc.bld.ITarget2.Options asmOpts = {
64 prefix: "-qq",
65 suffix: ""
66 };
67
68 /*!
69 * ======== ccOpts ========
70 * User configurable compiler options.
71 *
72 * Defaults:
73 * @p(dlist)
74 * -`-qq`
75 * super quiet mode
76 * -`-pdsw225`
77 * generate a warning for implicitly declared functions; i.e.,
78 * functions without prototypes
79 */
80 override config xdc.bld.ITarget2.Options ccOpts = {
81 prefix: "-qq -pdsw225",
82 suffix: ""
83 };
84
85 /*!
86 * ======== ccConfigOpts ========
87 * User configurable compiler options for the generated config C file.
88 */
89 override config xdc.bld.ITarget2.Options ccConfigOpts = {
90 prefix: "$(ccOpts.prefix)",
91 suffix: "$(ccOpts.suffix)"
92 };
93
94 /*!
95 * ======== lnkOpts ========
96 * User configurable linker options.
97 *
98 * Defaults:
99 * @p(dlist)
100 * -`-w`
101 * Display linker warnings
102 * -`-q`
103 * Quite run
104 * -`-u`
105 * Place unresolved external symbol into symbol table
106 * -`-c`
107 * ROM autoinitialization model
108 * -`-m`
109 * create a map file
110 * -`-l`
111 * archive library file as linker input
112 */
113 override config xdc.bld.ITarget2.Options lnkOpts = {
114 prefix: "-w -q -u _c_int00",
115 suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts500.lib"
116 };
117
118 /*!
119 * ======== profiles ========
120 * Standard options profiles for the TI tool-chain.
121 */
122 override config xdc.bld.ITarget.OptionSet profiles[string] = [
123 ["debug", {
124 compileOpts: {
125 copts: "-g",
126 defs: "-D_DEBUG_=1",
127 }
128 }],
129 ["release", {
130 compileOpts: {
131 copts: "-O2",
132 },
133 }],
134 ["profile", {
135 compileOpts: {
136 copts: "-gp",
137 },
138 }],
139 ["coverage", {
140 compileOpts: {
141 copts: "-gp",
142 },
143 }],
144 ["whole_program", {
145 compileOpts: {
146 copts: "-oe -O2",
147 },
148 }],
149 ["whole_program_debug", {
150 compileOpts: {
151 copts: "-oe --symdebug:dwarf",
152 },
153 }],
154 ];
155
156 override config string includeOpts = "-I$(rootDir)/include";
157
158 final override readonly config string sectMap[string] = [
159 [".text", "code"],
160 [".switch", "code"],
161 [".cinit", "code"],
162 [".pinit", "code"],
163
164 [".stack", "stack"],
165 [".bss", "data"],
166 [".const", "data"],
167 [".sysmem", "data"],
168 [".data", "data"],
169 [".far", "data"],
170 [".args", "data"],
171 [".cio", "data"],
172 ];
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: 1, align: 1 },
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_Long : { size: 2, align: 2 },
185 t_LDouble : { size: 2, align: 2 },
186 t_Ptr : { size: 1, align: 1 },
187 t_Short : { size: 1, align: 1 },
188 t_Size : { size: 1, align: 1 },
189 };
190
191 override readonly config Int bitsPerChar = 16;
192 };
193 194 195 196
197