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_float.xdc ========
    15     *
    16     */
    17    
    18    /*!
    19     *  ======== C28_float ========
    20     *  TI C28 large model little endian with floating point support (fpu32)
    21     */
    22    metaonly module C28_float inherits ti.targets.ITarget {
    23        override readonly config string name                = "C28_float";        
    24        override readonly config string suffix              = "28FP";
    25        override readonly config string isa                 = "28FP"; 
    26        override readonly config xdc.bld.ITarget.Model model = {
    27            dataModel: "large",
    28            endian: "little"
    29        };
    30        
    31        override readonly config string rts                 = "ti.targets.rts2800";
    32    
    33        /*
    34         *  ======== compatibleSuffixes ========
    35         */
    36        override config String compatibleSuffixes[] = ["28L"];
    37    
    38        final override readonly config Bool alignDirectiveSupported = false;
    39    
    40        /*!
    41         *  ======== ar ========
    42         *  Define archiver executable
    43         *
    44         *  Options:
    45         *  @p(dlist)
    46         *      -`-r`
    47         *          replace file
    48         *      -`-q`
    49         *          quiet mode
    50         */
    51        override readonly config xdc.bld.ITarget2.Command ar = {
    52            cmd: "ar2000",
    53            opts: "rq"
    54        };
    55    
    56    
    57        /*!
    58         *  ======== cc ========
    59         *  Define compiler executable
    60         *
    61         *  Options:
    62         *  @p(dlist)
    63         *      -`-c`
    64         *          no linking
    65         *      -`-v28`
    66         *          compile for c28x.
    67         *      -`-ml`
    68         *          use large memory model
    69         *      -`-DLARGE_MODEL=1`
    70         *          required to use va_arg in large model
    71         *      -`--float_support=fpu32`
    72         *          Enable FPU
    73         */
    74        override readonly config xdc.bld.ITarget2.Command cc = {
    75            cmd: "cl2000 -c",
    76            opts: "-v28 -DLARGE_MODEL=1 -ml --float_support=fpu32"
    77        };
    78    
    79        /*!
    80         *  ======== vers ========
    81         *  Define the vers command
    82         */
    83        override readonly config xdc.bld.ITarget2.Command vers = {
    84            cmd: "cl2000",
    85            opts: "--compiler_revision"
    86        };
    87    
    88    
    89        /*!
    90         *  ======== asm ========
    91         *  Define assembler executable
    92         *
    93         *  Options:
    94         *  @p(dlist)
    95         *      -`-c`
    96         *          no linking
    97         *      -`-v28`
    98         *          compile for c28x.
    99         *      -`-ml`
   100         *          use large memory model
   101         *      -`-DLARGE_MODEL=1`
   102         *          because compiler and BIOS are broken; asembler
   103         *          defines __LARGE_MODEL but BIOS uses LARGE_MODEL
   104         *      -`--float_support=fpu32`
   105         *          Enable FPU
   106         */
   107        override readonly config xdc.bld.ITarget2.Command asm = {
   108            cmd: "cl2000 -c",
   109            opts: "-v28 -ml -DLARGE_MODEL=1 --float_support=fpu32"
   110        };
   111    
   112    
   113        /*!
   114         *  ======== lnk ========
   115         *  Define linker executable
   116         */
   117        override readonly config xdc.bld.ITarget2.Command lnk = {
   118            cmd: "lnk2000",
   119            opts: ""
   120        };
   121        
   122    
   123        /*!
   124         *  ======== asmOpts ========
   125         *  User configurable assembler options.
   126         *
   127         *  Defaults:
   128         *  @p(dlist)
   129         *      -`-qq`
   130         *          super quiet mode
   131         */
   132        override config xdc.bld.ITarget2.Options asmOpts = {
   133            prefix: "-qq",
   134            suffix: ""
   135        };
   136    
   137        /*!
   138         *  ======== ccOpts ========
   139         *  Compiler options
   140         *  @p(dlist)
   141         *      -`-qq`
   142         *          super quiet mode
   143         *      -`-pdsw225`
   144         *          generate a warning for implicitly declared functions; i.e.,
   145         *          functions without prototypes
   146         *      -`-Dfar= `
   147         *          ignore keyword far; this allows one to write code that can
   148         *          be compiled in large model and small model without #ifdef's
   149         */
   150        override config xdc.bld.ITarget2.Options ccOpts = {
   151            prefix: "-qq -pdsw225 -Dfar= ",
   152            suffix: ""
   153        };
   154    
   155    
   156        /*!
   157         *  ======== lnkOpts ========
   158         *  Linker options
   159         *
   160         *  Options:
   161         *  @p(dlist)
   162         *      -`-q`
   163         *          Quite run
   164         *      -`-u`
   165         *          Place unresolved external symbol into symbol table
   166         *      -`-c`
   167         *          ROM autoinitialization model
   168         *      -`-m`
   169         *          create a map file
   170         *      -`-l`
   171         *          archive library file as linker input
   172         */
   173        override config xdc.bld.ITarget2.Options lnkOpts = {
   174            prefix: "-w -q -u _c_int00",
   175            suffix: "-c -m $(XDCCFGDIR)/$@.map -l $(rootDir)/lib/rts2800_fpu32.lib"
   176        };
   177            
   178        /*!
   179         *  ======== includeOpts ========
   180         *  Default include search path
   181         */
   182        override config string includeOpts = "-I$(rootDir)/include";
   183    
   184        final override readonly config string sectMap[string] =
   185            ti.targets.C28.sectMap;
   186    
   187        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   188            t_IArg          : { size: 2, align: 2 },
   189            t_Char          : { size: 1, align: 1 },
   190            t_Double        : { size: 2, align: 2 },
   191            t_Float         : { size: 2, align: 2 },
   192            t_Fxn           : { size: 2, align: 2 }, /* far */
   193            t_Int           : { size: 1, align: 1 },
   194            t_Int8          : { size: 1, align: 1 },
   195            t_Int16         : { size: 1, align: 1 },
   196            t_Int32         : { size: 2, align: 2 },
   197            t_Int64         : { size: 4, align: 2 },
   198            t_Long          : { size: 2, align: 2 },
   199            t_LDouble       : { size: 2, align: 2 },
   200            t_LLong         : { size: 4, align: 2 },
   201            t_Ptr           : { size: 2, align: 2 },
   202            t_Short         : { size: 1, align: 1 },
   203            t_Size          : { size: 2, align: 2 },
   204        };
   205    
   206        override readonly config Int bitsPerChar = 16;
   207    }
   208    /*
   209     *  @(#) ti.targets; 1, 0, 3,401; 9-15-2010 15:03:33; /db/ztree/library/trees/xdctargets/xdctargets-c28x/src/ xlibrary
   210    
   211     */
   212