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