1 2 3 4 5 6 7 8 9 10 11
12 /*!
13 * ======== MSP430 ========
14 * IAR MSP430 little endian, small code model, small data model target
15 */
16 metaonly module MSP430 inherits ITarget
17 {
18 override readonly config String name = "MSP430";
19 override readonly config String suffix = "r430";
20 override readonly config String isa = "430";
21 override readonly config xdc.bld.ITarget.Model model = {
22 endian: "little",
23 codeModel: "small",
24 dataModel: "small",
25 shortEnums: true
26 };
27
28 /*!
29 * ======== cc ========
30 * The command used to compile C/C++ source files into object files
31 *
32 * Defaults:
33 * @p(dlist)
34 * -`-e`
35 * enable compiler extensions so it's possible to get segment
36 * start addresses in C, via:
37 * @p(code)
38 * #pragma segment = "CSTACK"
39 * isrStack = __segment_begin("CSTACK");
40 * @p
41 * -`--core=430`
42 * MSP430 architecture
43 * -`--data_model`
44 * Small data model for 430 core
45 * @p
46 */
47 override readonly config Command cc = {
48 cmd: "icc430",
49 opts: "-e --core=430 --data_model=small"
50 };
51
52 /*!
53 * ======== asm ========
54 * The command used to assembles assembly source files into object files
55 */
56 override readonly config Command asm = {
57 cmd: "a430",
58 opts: "--data_model small"
59 };
60
61 /*!
62 * ======== profiles ========
63 * Standard options profiles for the IAR MSP430 tool-chain.
64 */
65 override config xdc.bld.ITarget.OptionSet profiles[string] = [
66 ["debug", {
67 compileOpts: {
68 copts: "--debug --dlib_config $(rootDir)/lib/dlib/dl430fn.h",
69 },
70 linkOpts: "$(rootDir)/lib/dlib/dl430fn.r43",
71 }],
72 ["release", {
73 compileOpts: {
74 copts: "-Ohs --dlib_config $(rootDir)/lib/dlib/dl430fn.h",
75 },
76 linkOpts: "$(rootDir)/lib/dlib/dl430fn.r43",
77 }],
78 ["debug_full", {
79 compileOpts: {
80 copts: "--debug --dlib_config $(rootDir)/lib/dlib/dl430ff.h",
81 },
82 linkOpts: "$(rootDir)/lib/dlib/dl430ff.r43",
83 }],
84 ["release_full", {
85 compileOpts: {
86 copts: "-Ohs --dlib_config $(rootDir)/lib/dlib/dl430ff.h",
87 },
88 linkOpts: "$(rootDir)/lib/dlib/dl430ff.r43",
89 }],
90 ];
91
92 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
93 t_IArg : { size: 2, align: 2 },
94 t_Char : { size: 1, align: 1 },
95 t_Double : { size: 4, align: 2 },
96 t_Float : { size: 4, align: 2 },
97 t_Fxn : { size: 2, align: 2 },
98 t_Int : { size: 2, align: 2 },
99 t_Int8 : { size: 1, align: 1 },
100 t_Int16 : { size: 2, align: 2 },
101 t_Int32 : { size: 4, align: 2 },
102 t_Long : { size: 4, align: 2 },
103 t_LDouble : { size: 4, align: 2 },
104 t_LLong : { size: 8, align: 2 },
105 t_Ptr : { size: 2, align: 2 },
106 t_Short : { size: 2, align: 2 },
107 t_Size : { size: 2, align: 2 },
108 };
109
110 }
111 112 113 114
115