1    /*
     2     *  Copyright 2020 by Texas Instruments Incorporated.
     3     *
     4     */
     5    
     6    /*
     7     * Copyright (c) 2008-2019 Texas Instruments Incorporated
     8     * All rights reserved.
     9     *
    10     * Redistribution and use in source and binary forms, with or without
    11     * modification, are permitted provided that the following conditions
    12     * are met:
    13     *
    14     * *  Redistributions of source code must retain the above copyright
    15     *    notice, this list of conditions and the following disclaimer.
    16     *
    17     * *  Redistributions in binary form must reproduce the above copyright
    18     *    notice, this list of conditions and the following disclaimer in the
    19     *    documentation and/or other materials provided with the distribution.
    20     *
    21     * *  Neither the name of Texas Instruments Incorporated nor the names of
    22     *    its contributors may be used to endorse or promote products derived
    23     *    from this software without specific prior written permission.
    24     *
    25     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    26     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    27     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    28     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    29     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    30     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    31     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    32     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    33     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    34     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    35     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    36     */
    37    
    38    /*!
    39     *  ======== IArm.xdc ========
    40     *  Common settings for all Arm targets
    41     */
    42    metaonly interface IArm inherits ti.targets.ITarget {
    43    
    44        override config String stdInclude = "ti/targets/arm/elf/std.h";
    45    
    46        override config string platform   = "ti.platforms.sim470xx";
    47    
    48        override config string includeOpts =
    49            "-I$(rootDir)/include ";
    50    
    51        override readonly config xdc.bld.ITarget.Model model = {
    52            shortEnums: true,
    53        };
    54    
    55        override readonly config xdc.bld.ITarget2.Command ar = {
    56            cmd:  "armar",
    57            opts: "rq"
    58        };
    59    
    60        override readonly config xdc.bld.ITarget2.Command vers = {
    61            cmd:  "armcl",
    62            opts: "--compiler_revision"
    63        };
    64    
    65        override readonly config xdc.bld.ITarget2.Command lnk = {
    66            cmd:  "armcl",
    67            opts: "-z"
    68        };
    69    
    70        /*!
    71         *  ======== ccOpts ========
    72         *  User configurable compiler options.
    73         *
    74         *  Defaults:
    75         *  @p(dlist)
    76         *      -`-qq`
    77         *          super quiet mode
    78         *      -`-pdsw225`
    79         *          generate a warning for implicitly declared functions; i.e.,
    80         *          functions without prototypes
    81         */
    82        override config xdc.bld.ITarget2.Options ccOpts = {
    83            prefix: "-qq -pdsw225",
    84            suffix: ""
    85        };
    86    
    87        /*!
    88         *  ======== ccConfigOpts ========
    89         *  User configurable compiler options for the generated config C file.
    90         *      -`--fp_mode=strict`
    91         *          disable conversion of double-precision computations to
    92         *          single-precision computations when the result is assigned to
    93         *          a single-precision variable.
    94         */
    95        override config xdc.bld.ITarget2.Options ccConfigOpts = {
    96            prefix: "$(ccOpts.prefix) -ms --fp_mode=strict",
    97            suffix: "$(ccOpts.suffix)"
    98        };
    99    
   100        /*!
   101         *  ======== asmOpts ========
   102         *  User configurable assembler options.
   103         *
   104         *  Defaults:
   105         *  @p(dlist)
   106         *      -`-qq`
   107         *          super quiet mode
   108         */
   109        override config xdc.bld.ITarget2.Options asmOpts = {
   110            prefix: "-qq",
   111            suffix: ""
   112        };
   113    
   114        /*!
   115         *  ======== profiles ========
   116         *  Standard options profiles for the TI tool-chain.
   117         */
   118        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   119            ["debug", {
   120                compileOpts: {
   121                    copts: "--symdebug:dwarf",
   122                    defs:  "-D_DEBUG_=1",
   123                }
   124            }],
   125            ["release", {
   126                compileOpts: {
   127                    copts: "-O2",
   128                },
   129            }],
   130            ["profile", {
   131                compileOpts: {
   132                    copts: "--symdebug:dwarf",
   133                },
   134            }],
   135            ["coverage", {
   136                compileOpts: {
   137                    copts: "--symdebug:dwarf",
   138                },
   139            }],
   140        ];
   141    
   142        final override readonly config string sectMap[string] = [
   143            [".text", "code"],
   144            [".stack", "stack"],
   145            [".bss", "data"],
   146            [".binit", "code"],
   147            [".cinit", "code"],
   148            [".init_array", "code"],
   149            [".const", "code"],
   150            [".data", "data"],
   151            [".rodata", "data"],
   152            [".neardata", "data"],
   153            [".fardata", "data"],
   154            [".switch", "data"],
   155            [".sysmem", "data"],
   156            [".far", "data"],
   157            [".args", "data"],
   158            [".cio", "data"],
   159            [".ARM.exidx", "data"],
   160            [".ARM.extab", "data"]
   161        ];
   162    
   163        override readonly config Bool splitMap[string] = [
   164            [".text", true],
   165            [".const", true],
   166            [".data", true],
   167            [".fardata", true],
   168            [".switch", true],
   169            [".far", true],
   170            [".args", true],
   171            [".cio", true],
   172            [".ARM.extab", true]
   173        ];
   174    
   175        override readonly config Int bitsPerChar = 8;
   176    
   177        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   178            t_IArg          : { size: 4, align: 4 },
   179            t_Char          : { size: 1, align: 1 },
   180            t_Double        : { size: 8, align: 8 },
   181            t_Float         : { size: 4, align: 4 },
   182            t_Fxn           : { size: 4, align: 4 },
   183            t_Int           : { size: 4, align: 4 },
   184            t_Int8          : { size: 1, align: 1 },
   185            t_Int16         : { size: 2, align: 2 },
   186            t_Int32         : { size: 4, align: 4 },
   187            t_Int64         : { size: 8, align: 8 },
   188            t_Long          : { size: 4, align: 4 },
   189            t_LDouble       : { size: 8, align: 8 },
   190            t_LLong         : { size: 8, align: 8 },
   191            t_Ptr           : { size: 4, align: 4 },
   192            t_Short         : { size: 2, align: 2 },
   193            t_Size          : { size: 4, align: 4 },
   194        };
   195    
   196        override config String binaryParser = "xdc.targets.omf.Elf";
   197    }
   198    /*
   199     *  @(#) ti.targets.arm.elf; 1, 0, 0,; 1-17-2020 15:49:13; /db/ztree/library/trees/xdctargets/xdctargets-w07/src/ xlibrary
   200    
   201     */
   202