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