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         *      -`--fp_mode=strict`
    65         *          disable conversion of double-precision computations to
    66         *          single-precision computations when the result is assigned to
    67         *          a single-precision variable.
    68         */
    69        override config xdc.bld.ITarget2.Options ccConfigOpts = {
    70            prefix: "$(ccOpts.prefix) -ms --fp_mode=strict",
    71            suffix: "$(ccOpts.suffix)"
    72        };
    73    
    74        /*!
    75         *  ======== asmOpts ========
    76         *  User configurable assembler options.
    77         *
    78         *  Defaults:
    79         *  @p(dlist)
    80         *      -`-qq`
    81         *          super quiet mode
    82         */
    83        override config xdc.bld.ITarget2.Options asmOpts = {
    84            prefix: "-qq",
    85            suffix: ""
    86        };
    87    
    88        /*!
    89         *  ======== lnkOpts ========
    90         *  User configurable linker options.
    91         *
    92         *  Defaults:
    93         *  @p(dlist)
    94         *      -`-w`
    95         *          Display linker warnings
    96         *      -`-q`
    97         *          Quite run
    98         *      -`-u`
    99         *          Place unresolved external symbol into symbol table
   100         *      -`-c`
   101         *          ROM autoinitialization model
   102         *      -`-m`
   103         *          create a map file
   104         */
   105        override config xdc.bld.ITarget2.Options lnkOpts = {
   106            prefix: "-w -q -u _c_int00",
   107            suffix: "-c -m $(XDCCFGDIR)/$@.map " /* + -l $(rootDir)/lib/linkLib */
   108        };
   109    
   110        /*!
   111         *  ======== profiles ========
   112         *  Standard options profiles for the TI tool-chain.
   113         */
   114        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   115            ["debug", {
   116                compileOpts: {
   117                    copts: "--symdebug:dwarf",
   118                    defs:  "-D_DEBUG_=1",
   119                }
   120            }],
   121            ["release", {
   122                compileOpts: {
   123                    copts: "-O2",
   124                },
   125            }],
   126            ["profile", {
   127                compileOpts: {
   128                    copts: "--symdebug:dwarf",
   129                },
   130            }],
   131            ["coverage", {
   132                compileOpts: {
   133                    copts: "--symdebug:dwarf",
   134                },
   135            }],
   136            ["whole_program", {
   137                compileOpts: {
   138                    copts: "-oe -O2 -ms",
   139                },
   140            }],
   141            ["whole_program_debug", {
   142                compileOpts: {
   143                    copts: "-oe --symdebug:dwarf -ms",
   144                },
   145            }],
   146        ];
   147    
   148        final override readonly config string sectMap[string] = [
   149            [".text", "code"],
   150            [".stack", "stack"],
   151            [".bss", "data"],
   152            [".cinit", "code"],
   153            [".init_array", "code"],
   154            [".const", "code"],
   155            [".data", "data"],
   156            [".rodata", "data"],
   157            [".neardata", "data"],
   158            [".fardata", "data"],
   159            [".switch", "data"],
   160            [".sysmem", "data"],
   161            [".far", "data"],
   162            [".args", "data"],
   163            [".cio", "data"],
   164        ];
   165    
   166        override readonly config Int bitsPerChar = 8;
   167    
   168        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   169            t_IArg          : { size: 4, align: 4 },
   170            t_Char          : { size: 1, align: 1 },
   171            t_Double        : { size: 8, align: 8 },
   172            t_Float         : { size: 4, align: 4 },
   173            t_Fxn           : { size: 4, align: 4 },
   174            t_Int           : { size: 4, align: 4 },
   175            t_Int8          : { size: 1, align: 1 },
   176            t_Int16         : { size: 2, align: 2 },
   177            t_Int32         : { size: 4, align: 4 },
   178            t_Int64         : { size: 8, align: 8 },
   179            t_Long          : { size: 4, align: 4 },
   180            t_LDouble       : { size: 8, align: 8 },
   181            t_LLong         : { size: 8, align: 8 },
   182            t_Ptr           : { size: 4, align: 4 },
   183            t_Short         : { size: 2, align: 2 },
   184            t_Size          : { size: 4, align: 4 },
   185        };
   186    
   187        override config String binaryParser = "ti.targets.omf.elf.Elf32";
   188    }
   189    
   190    /*
   191     *  @(#) ti.targets.arm.elf; 1, 0, 0,184; 1-12-2011 12:55:34; /db/ztree/library/trees/xdctargets/xdctargets-c40x/src/ xlibrary
   192    
   193     */
   194