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