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     *  ======== C28.xdc ========
    15     *
    16     */
    17    
    18    /*!
    19     *  ======== C28 ========
    20     *  TI C28 default runtime model (little endian)
    21     */
    22    metaonly module C28 inherits ti.targets.ITarget {
    23        override readonly config string name                = "C28";        
    24        override readonly config string suffix              = "28";
    25        override readonly config string isa                 = "28"; 
    26        override readonly config xdc.bld.ITarget.Model model= {endian: "little"};
    27        override readonly config string rts                 = "ti.targets.rts2800";
    28        final override readonly config Bool alignDirectiveSupported = false;
    29        
    30        /*!
    31         *  ======== ar ========
    32         *  Define archiver executable
    33         *
    34         *  Options:
    35         *  @p(dlist)
    36         *      -`-r`
    37         *          replace file
    38         *      -`-q`
    39         *          quiet mode
    40         */
    41        override readonly config xdc.bld.ITarget2.Command ar = {
    42            cmd: "ar2000",
    43            opts: "rq"
    44        };
    45    
    46        /*!
    47         *  ======== cc ========
    48         *  Define compiler executable
    49         *
    50         *  Options:
    51         *  @p(dlist)
    52         *      -`-c`
    53         *          no linking
    54         *      -`-v28`
    55         *          compile for c28x.
    56         */
    57        override readonly config xdc.bld.ITarget2.Command cc = {
    58            cmd: "cl2000 -c",
    59            opts: "-v28"
    60        };
    61    
    62        /*!
    63         *  ======== vers ========
    64         *  Define the vers command
    65         */
    66        override readonly config xdc.bld.ITarget2.Command vers = {
    67            cmd: "cl2000",
    68            opts: "--compiler_revision"
    69        };
    70    
    71        /*!
    72         *  ======== asm ========
    73         *  Define assembler executable
    74         *
    75         *  Options:
    76         *  @p(dlist)
    77         *      -`-c`
    78         *          no linking
    79         *      -`-v28`
    80         *          compile for c28x.
    81         *
    82         */
    83        override readonly config xdc.bld.ITarget2.Command asm = {
    84            cmd: "cl2000 -c",
    85            opts: "-v28"
    86        };
    87    
    88        /*!
    89         *  Define linker executable
    90         */
    91        override readonly config xdc.bld.ITarget2.Command lnk = {
    92            cmd: "lnk2000",
    93            opts: ""
    94        };
    95    
    96        /*!
    97         *  ======== asmOpts ========
    98         *  User configurable assembler options.
    99         *
   100         *  Defaults:
   101         *  @p(dlist)
   102         *      -`-qq`
   103         *          super quiet mode
   104         */
   105        override config xdc.bld.ITarget2.Options asmOpts = {
   106            prefix: "-qq",
   107            suffix: ""
   108        };
   109    
   110        /*!
   111         *  ======== ccOpts ========
   112         *  Compiler options
   113         *  @p(dlist)
   114         *      -`-qq`
   115         *          super quiet mode
   116         *      -`-pdsw225`
   117         *          generate a warning for implicitly declared functions; i.e.,
   118         *          functions without prototypes
   119         */
   120        override config xdc.bld.ITarget2.Options ccOpts = {
   121            prefix: "-qq -pdsw225",
   122            suffix: ""
   123        };
   124    
   125        /*!
   126         *  ======== lnkOpts ========
   127         *  Linker options
   128         *
   129         *  Options:
   130         *  @p(dlist)
   131         *      -`-q`
   132         *          Quite run
   133         *      -`-u`
   134         *          Place unresolved external symbol into symbol table
   135         *      -`-c`
   136         *          ROM autoinitialization model
   137         *      -`-m`
   138         *          create a map file
   139         *      -`-l`
   140         *          archive library file as linker input
   141         */
   142        override config xdc.bld.ITarget2.Options lnkOpts = {
   143            prefix: "-w -q -u _c_int00",
   144            suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800.lib"
   145        };
   146            
   147        /*!
   148         *  ======== profiles ========
   149         *  Standard options profiles for the TI tool-chain.
   150         */
   151        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   152            ["debug", {
   153                compileOpts: {
   154                    copts: "-g",
   155                    defs:  "-D_DEBUG_=1",
   156                }
   157            }],
   158            ["release", {
   159                compileOpts: {
   160                    copts: "-O2",
   161                },
   162            }],
   163            ["profile", {
   164                compileOpts: {
   165                    copts: "-gp",
   166                },
   167            }],
   168            ["coverage", {
   169                compileOpts: {
   170                    copts: "-gp",
   171                },
   172            }],
   173            ["whole_program", {
   174                compileOpts: {
   175                    copts: "-oe -O2 -mo",
   176                },
   177            }],
   178            ["whole_program_debug", {
   179                compileOpts: {
   180                    copts: "-oe --symdebug:dwarf -mo",
   181                },
   182            }],
   183        ];
   184    
   185        /*  Include search path  */
   186        override config string includeOpts = "-I$(rootDir)/include";
   187    
   188        final override readonly config string sectMap[string] = [
   189            [".text", "code"],
   190            [".switch", "code"],
   191            [".data", "data"],
   192            [".cinit", "code"],
   193            [".bss", "data"],
   194            [".ebss", "data"],
   195            [".econst", "code"],
   196            [".const", "code"],
   197            [".stack", "stack"],
   198            [".sysmem", "data"],
   199            [".esysmem", "data"],
   200            [".pinit", "code"],
   201            [".args", "data"],
   202            [".cio", "data"],
   203        ];
   204    
   205        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   206            t_IArg          : { size: 2, align: 2 },
   207            t_Char          : { size: 1, align: 1 },
   208            t_Double        : { size: 2, align: 2 },
   209            t_Float         : { size: 2, align: 2 },
   210            t_Fxn           : { size: 2, align: 1 }, /* near */
   211            t_Int           : { size: 1, align: 1 },
   212            t_Int8          : { size: 1, align: 1 },
   213            t_Int16         : { size: 1, align: 1 },
   214            t_Int32         : { size: 2, align: 2 },
   215            t_Int64         : { size: 4, align: 2 },
   216            t_Long          : { size: 2, align: 2 },
   217            t_LDouble       : { size: 2, align: 2 },
   218            t_LLong         : { size: 4, align: 2 },
   219            t_Ptr           : { size: 1, align: 1 },
   220            t_Short         : { size: 1, align: 1 },
   221            t_Size          : { size: 2, align: 2 },
   222        };
   223    
   224        override readonly config Int bitsPerChar = 16;
   225    }
   226    /*
   227     *  @(#) ti.targets; 1, 0, 3,650; 3-28-2013 16:05:05; /db/ztree/library/trees/xdctargets/xdctargets-f60x/src/ xlibrary
   228    
   229     */
   230