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