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