1    /* 
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * */
    12    /*
    13     *  ======== MSP430.xdc ========
    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 " /* + -l $(rootDir)/lib/linkLib */
   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            [".intvecs", "code"],
   166    
   167            [".text", "code"],
   168            [".cinit", "code"],
   169            [".const", "code"],
   170            [".pinit", "code"],
   171    
   172            [".bss", "data"],
   173            [".sysmem", "data"],
   174            [".stack", "stack"],
   175            [".args", "data"],
   176            [".cio", "data"],
   177            [".reset", "data"],
   178        ];
   179    
   180        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   181            t_IArg          : { size: 2, align: 2 },
   182            t_Char          : { size: 1, align: 1 },
   183            t_Double        : { size: 4, align: 4 },
   184            t_Float         : { size: 4, align: 4 },
   185            t_Fxn           : { size: 2, align: 2 },
   186            t_Int           : { size: 2, align: 2 },
   187            t_Int8          : { size: 1, align: 1 },
   188            t_Int16         : { size: 2, align: 2 },
   189            t_Int32         : { size: 4, align: 4 },
   190            t_Long          : { size: 4, align: 4 },
   191            t_LDouble       : { size: 4, align: 4 },
   192            t_LLong         : { size: 4, align: 4 },
   193            t_Ptr           : { size: 2, align: 2 },
   194            t_Short         : { size: 2, align: 2 },
   195        };
   196    };
   197    /*
   198     *  @(#) ti.targets; 1, 0, 3,320; 7-29-2009 16:34:47; /db/atree/library/trees/xdctargets/xdctargets-b12x/src/
   199     */
   200