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