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