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 
    20     */
    21    metaonly module TMS470 inherits ti.targets.ITarget {
    22        override readonly config string name             = "TMS470"; 
    23        override readonly config string suffix           = "470";
    24        override readonly config string isa              = "470";    
    25        override readonly config string rts              = "ti.targets.rts470";
    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 xdc.bld.ITarget2.Command ar = {
    38            cmd:  "ar470",
    39            opts: "rq"
    40        };
    41    
    42        override readonly config xdc.bld.ITarget2.Command cc = {
    43            cmd:  "cl470 -c",
    44            opts: " -me -mv4"
    45        };
    46    
    47        override readonly config xdc.bld.ITarget2.Command vers = {
    48            cmd:  "cl470",
    49            opts: "--compiler_revision"
    50        };
    51    
    52        override readonly config xdc.bld.ITarget2.Command asm = {
    53            cmd:  "cl470 -c",
    54            opts: " -me -mv4"
    55        };
    56    
    57        override readonly config xdc.bld.ITarget2.Command lnk = {
    58            cmd:  "lnk470",
    59            opts: ""
    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 xdc.bld.ITarget2.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 xdc.bld.ITarget2.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 xdc.bld.ITarget2.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: rts16e.lib, rts32e.lib)
   106         */
   107        config string linkLib = "rts16e.lib";
   108        
   109        /*!
   110         *  ======== profiles ========
   111         *  Standard options profiles for the TI tool-chain.
   112         */
   113        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   114            ["debug", {
   115                compileOpts: {
   116                    copts: "-g",
   117                    defs:  "-D_DEBUG_=1",
   118                }
   119            }],
   120            ["release", {
   121                compileOpts: {
   122                    copts: "-O2",
   123                },
   124            }],
   125            ["profile", {
   126                compileOpts: {
   127                    copts: "-gp",
   128                },
   129            }],
   130            ["coverage", {
   131                compileOpts: {
   132                    copts: "-gp",
   133                },
   134            }],
   135            ["whole_program", {
   136                compileOpts: {
   137                    copts: "-oe -O2 -ms",
   138                },
   139            }],
   140            ["whole_program_debug", {
   141                compileOpts: {
   142                    copts: "-oe --symdebug:dwarf -ms",
   143                },
   144            }],
   145        ];
   146    
   147        /*!
   148         *  ======== lnkOpts ========
   149         *  User configurable linker options.
   150         *
   151         *  Defaults:
   152         *  @p(dlist)
   153         *      -`-w`
   154         *          Display linker warnings
   155         *      -`-q`
   156         *          Quite run
   157         *      -`-u`
   158         *          Place unresolved external symbol into symbol table
   159         *      -`-c`
   160         *          ROM autoinitialization model
   161         *      -`-m`
   162         *          create a map file
   163         */
   164        override config xdc.bld.ITarget2.Options lnkOpts = {
   165            prefix: "-w -q -u _c_int00",
   166            suffix: "-c -m $(XDCCFGDIR)/$@.map " /* + -l $(rootDir)/lib/linkLib */
   167        };
   168    
   169        override config string includeOpts = "-I$(rootDir)/include/rts -I$(rootDir)/include ";
   170    
   171        final override readonly config string sectMap[string] = [
   172            [".intvecs", "code"],
   173    
   174            [".text", "code"],
   175            [".cinit", "code"],
   176            [".const", "code"],
   177            [".pinit", "code"],
   178    
   179            [".bss", "data"],
   180            [".sysmem", "data"],
   181            [".stack", "stack"],
   182            [".args", "data"],
   183        ];
   184    
   185        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   186            t_IArg          : { size: 4, align: 4 },
   187            t_Char          : { size: 1, align: 1 },
   188            t_Double        : { size: 8, align: 4 },
   189            t_Float         : { size: 4, align: 4 },
   190            t_Fxn           : { size: 4, align: 4 },
   191            t_Int           : { size: 4, align: 4 },
   192            t_Int8          : { size: 1, align: 1 },
   193            t_Int16         : { size: 2, align: 2 },
   194            t_Int32         : { size: 4, align: 4 },
   195            t_Int64         : { size: 8, align: 4 },
   196            t_Long          : { size: 4, align: 4 },
   197            t_LDouble       : { size: 8, align: 4 },
   198            t_LLong         : { size: 8, align: 4 },
   199            t_Ptr           : { size: 4, align: 4 },
   200            t_Short         : { size: 2, align: 2 },
   201            t_Size          : { size: 4, align: 4 },
   202        };
   203    };
   204    /*
   205     *  @(#) ti.targets; 1, 0, 3,401; 9-15-2010 15:03:42; /db/ztree/library/trees/xdctargets/xdctargets-c28x/src/ xlibrary
   206    
   207     */
   208