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