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    import ti.targets.ITarget;
    13    
    14    /*!
    15     *  ======== IArm.xdc ========
    16     *  Common settings for all Arm targets
    17     */
    18    metaonly interface IArm inherits ti.targets.ITarget {
    19    
    20        override readonly config string stdInclude = "ti/targets/arm/std.h";
    21    
    22        override config string platform   = "ti.platforms.sim470xx";
    23    
    24        override config string includeOpts =
    25            "-I$(rootDir)/include/rts -I$(rootDir)/include ";
    26    
    27        override readonly config xdc.bld.ITarget2.Command ar = {
    28            cmd:  "ar470",
    29            opts: "rq"
    30        };
    31    
    32        override readonly config xdc.bld.ITarget2.Command vers = {
    33            cmd:  "cl470",
    34            opts: "--compiler_revision"
    35        };
    36    
    37        override readonly config xdc.bld.ITarget2.Command lnk = {
    38            cmd:  "lnk470",
    39            opts: ""
    40        };
    41    
    42        /*!
    43         *  ======== ccOpts ========
    44         *  User configurable compiler options.
    45         *
    46         *  Defaults:
    47         *  @p(dlist)
    48         *      -`-qq`
    49         *          super quiet mode
    50         *      -`-pdsw225`
    51         *          generate a warning for implicitly declared functions; i.e.,
    52         *          functions without prototypes
    53         */
    54        override config xdc.bld.ITarget2.Options ccOpts = {
    55            prefix: "-qq -pdsw225",
    56            suffix: ""
    57        };
    58    
    59        /*!
    60         *  ======== ccConfigOpts ========
    61         *  User configurable compiler options for the generated config C file.
    62         */
    63        override config xdc.bld.ITarget2.Options ccConfigOpts = {
    64            prefix: "$(ccOpts.prefix) -ms",
    65            suffix: "$(ccOpts.suffix)"
    66        };
    67    
    68        /*!
    69         *  ======== asmOpts ========
    70         *  User configurable assembler options.
    71         *
    72         *  Defaults:
    73         *  @p(dlist)
    74         *      -`-qq`
    75         *          super quiet mode
    76         */
    77        override config xdc.bld.ITarget2.Options asmOpts = {
    78            prefix: "-qq",
    79            suffix: ""
    80        };
    81    
    82        /*!
    83         *  ======== lnkOpts ========
    84         *  User configurable linker options.
    85         *
    86         *  Defaults:
    87         *  @p(dlist)
    88         *      -`-w`
    89         *          Display linker warnings
    90         *      -`-q`
    91         *          Quite run
    92         *      -`-u`
    93         *          Place unresolved external symbol into symbol table
    94         *      -`-c`
    95         *          ROM autoinitialization model
    96         *      -`-m`
    97         *          create a map file
    98         */
    99        override config xdc.bld.ITarget2.Options lnkOpts = {
   100            prefix: "-w -q -u _c_int00",
   101            suffix: "-c -m $(XDCCFGDIR)/$@.map " /* + -l $(rootDir)/lib/linkLib */
   102        };
   103    
   104        /*!
   105         *  ======== profiles ========
   106         *  Standard options profiles for the TI tool-chain.
   107         */
   108        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   109            ["debug", {
   110                compileOpts: {
   111                    copts: "-g",
   112                    defs:  "-D_DEBUG_=1",
   113                }
   114            }],
   115            ["release", {
   116                compileOpts: {
   117                    copts: "-O2",
   118                },
   119            }],
   120            ["profile", {
   121                compileOpts: {
   122                    copts: "-gp",
   123                },
   124            }],
   125            ["coverage", {
   126                compileOpts: {
   127                    copts: "-gp",
   128                },
   129            }],
   130            ["whole_program", {
   131                compileOpts: {
   132                    copts: "-oe -O2 -ms",
   133                },
   134            }],
   135            ["whole_program_debug", {
   136                compileOpts: {
   137                    copts: "-oe --symdebug:dwarf -ms",
   138                },
   139            }],
   140        ];
   141    
   142        final override readonly config string sectMap[string] = [
   143            [".intvecs", "code"],
   144    
   145            [".text", "code"],
   146            [".cinit", "code"],
   147            [".const", "code"],
   148            [".pinit", "code"],
   149    
   150            [".bss", "data"],
   151            [".sysmem", "data"],
   152            [".stack", "stack"],
   153            [".args", "data"],
   154        ];
   155    
   156        override readonly config Int bitsPerChar = 8;
   157    
   158        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   159            t_IArg          : { size: 4, align: 4 },
   160            t_Char          : { size: 1, align: 1 },
   161            t_Double        : { size: 8, align: 4 },
   162            t_Float         : { size: 4, align: 4 },
   163            t_Fxn           : { size: 4, align: 4 },
   164            t_Int           : { size: 4, align: 4 },
   165            t_Int8          : { size: 1, align: 1 },
   166            t_Int16         : { size: 2, align: 2 },
   167            t_Int32         : { size: 4, align: 4 },
   168            t_Int64         : { size: 8, align: 4 },
   169            t_Long          : { size: 4, align: 4 },
   170            t_LDouble       : { size: 8, align: 4 },
   171            t_LLong         : { size: 8, align: 4 },
   172            t_Ptr           : { size: 4, align: 4 },
   173            t_Short         : { size: 2, align: 2 },
   174            t_Size          : { size: 4, align: 4 },
   175        };
   176    }
   177    /*
   178     *  @(#) ti.targets.arm; 2, 0, 1, 0,216; 8-4-2010 16:21:18; /db/ztree/library/trees/xdctargets/xdctargets-c27x/src/
   179     */
   180