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