1    /* 
     2     *  Copyright (c) 2008-2016 Texas Instruments Incorporated
     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 =
    24            "-I$(rootDir)/include ";
    25    
    26        override readonly config xdc.bld.ITarget.Model model = {
    27            shortEnums: true,
    28        };
    29    
    30        override readonly config xdc.bld.ITarget2.Command ar = {
    31            cmd:  "armar",
    32            opts: "rq"
    33        };
    34    
    35        override readonly config xdc.bld.ITarget2.Command vers = {
    36            cmd:  "armcl",
    37            opts: "--compiler_revision"
    38        };
    39    
    40        override readonly config xdc.bld.ITarget2.Command lnk = {
    41            cmd:  "armcl",
    42            opts: "-z"
    43        };
    44    
    45        /*!
    46         *  ======== ccOpts ========
    47         *  User configurable compiler options.
    48         *
    49         *  Defaults:
    50         *  @p(dlist)
    51         *      -`-qq`
    52         *          super quiet mode
    53         *      -`-pdsw225`
    54         *          generate a warning for implicitly declared functions; i.e.,
    55         *          functions without prototypes
    56         */
    57        override config xdc.bld.ITarget2.Options ccOpts = {
    58            prefix: "-qq -pdsw225",
    59            suffix: ""
    60        };
    61    
    62        /*!
    63         *  ======== ccConfigOpts ========
    64         *  User configurable compiler options for the generated config C file.
    65         *      -`--fp_mode=strict`
    66         *          disable conversion of double-precision computations to
    67         *          single-precision computations when the result is assigned to
    68         *          a single-precision variable.
    69         */
    70        override config xdc.bld.ITarget2.Options ccConfigOpts = {
    71            prefix: "$(ccOpts.prefix) -ms --fp_mode=strict",
    72            suffix: "$(ccOpts.suffix)"
    73        };
    74    
    75        /*!
    76         *  ======== asmOpts ========
    77         *  User configurable assembler options.
    78         *
    79         *  Defaults:
    80         *  @p(dlist)
    81         *      -`-qq`
    82         *          super quiet mode
    83         */
    84        override config xdc.bld.ITarget2.Options asmOpts = {
    85            prefix: "-qq",
    86            suffix: ""
    87        };
    88    
    89        /*!
    90         *  ======== profiles ========
    91         *  Standard options profiles for the TI tool-chain.
    92         */
    93        override config xdc.bld.ITarget.OptionSet profiles[string] = [
    94            ["debug", {
    95                compileOpts: {
    96                    copts: "--symdebug:dwarf",
    97                    defs:  "-D_DEBUG_=1",
    98                }
    99            }],
   100            ["release", {
   101                compileOpts: {
   102                    copts: "-O2",
   103                },
   104            }],
   105            ["profile", {
   106                compileOpts: {
   107                    copts: "--symdebug:dwarf",
   108                },
   109            }],
   110            ["coverage", {
   111                compileOpts: {
   112                    copts: "--symdebug:dwarf",
   113                },
   114            }],
   115        ];
   116    
   117        final override readonly config string sectMap[string] = [
   118            [".text", "code"],
   119            [".stack", "stack"],
   120            [".bss", "data"],
   121            [".binit", "code"],
   122            [".cinit", "code"],
   123            [".init_array", "code"],
   124            [".const", "code"],
   125            [".data", "data"],
   126            [".rodata", "data"],
   127            [".neardata", "data"],
   128            [".fardata", "data"],
   129            [".switch", "data"],
   130            [".sysmem", "data"],
   131            [".far", "data"],
   132            [".args", "data"],
   133            [".cio", "data"],
   134            [".ARM.exidx", "data"],
   135            [".ARM.extab", "data"]
   136        ];
   137    
   138        override readonly config Bool splitMap[string] = [
   139            [".text", true],
   140            [".const", true],
   141            [".data", true],
   142            [".fardata", true],
   143            [".switch", true],
   144            [".far", true],
   145            [".args", true],
   146            [".cio", true],
   147            [".ARM.extab", true]
   148        ];
   149    
   150        override readonly config Int bitsPerChar = 8;
   151    
   152        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   153            t_IArg          : { size: 4, align: 4 },
   154            t_Char          : { size: 1, align: 1 },
   155            t_Double        : { size: 8, align: 8 },
   156            t_Float         : { size: 4, align: 4 },
   157            t_Fxn           : { size: 4, align: 4 },
   158            t_Int           : { size: 4, align: 4 },
   159            t_Int8          : { size: 1, align: 1 },
   160            t_Int16         : { size: 2, align: 2 },
   161            t_Int32         : { size: 4, align: 4 },
   162            t_Int64         : { size: 8, align: 8 },
   163            t_Long          : { size: 4, align: 4 },
   164            t_LDouble       : { size: 8, align: 8 },
   165            t_LLong         : { size: 8, align: 8 },
   166            t_Ptr           : { size: 4, align: 4 },
   167            t_Short         : { size: 2, align: 2 },
   168            t_Size          : { size: 4, align: 4 },
   169        };
   170    
   171        override config String binaryParser = "ti.targets.omf.elf.Elf32";
   172    }
   173    /*
   174     *  @(#) ti.targets.arm.elf; 1, 0, 0,0; 2-10-2017 09:06:44; /db/ztree/library/trees/xdctargets/xdctargets-m11/src/ xlibrary
   175    
   176     */
   177