1    /* 
     2     *  Copyright (c) 2012 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    import xdc.bld.ITarget2;
    13    
    14    /*!
    15     *  ======== A8F.xdc ========
    16     *  Embedded Cortex A8, little endian, hard-float, bare metal target
    17     *
    18     *  This module defines an embedded bare metal target on Cortex A8. The target
    19     *  generates code compatible with the "v7A" architecture.
    20     *
    21     */
    22    metaonly module A8F inherits gnu.targets.arm.ITarget {
    23        override readonly config string name                = "A8F";
    24        override readonly config string suffix              = "a8fg";
    25        override readonly config string isa                 = "v7A";
    26        override readonly config xdc.bld.ITarget.Model model= {
    27            endian: "little",
    28            shortEnums: true
    29        };
    30    
    31        override readonly config Bool alignDirectiveSupported = true;
    32    
    33        override readonly config string rts = "gnu.targets.arm.rtsv7A";
    34        override config string platform     = "ti.platforms.evmAM3359";
    35    
    36        override config string GCCTARG = "arm-none-eabi";
    37    
    38        override readonly config String stdInclude = "gnu/targets/arm/std.h";
    39    
    40        override readonly config ITarget2.Command cc = {
    41            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -MD -MF $@.dep",
    42            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    43        };
    44    
    45        readonly config ITarget2.Command ccBin = {
    46            cmd: "bin/arm-none-eabi-gcc -c -MD -MF $@.dep",
    47            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    48        };
    49    
    50        override config ITarget2.Options ccOpts = {
    51            prefix: "-Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections ",
    52            suffix: "-Dfar= -D__DYNAMIC_REENT__ "
    53        };
    54    
    55        /*!
    56         *  ======== ccConfigOpts ========
    57         *  User configurable compiler options for the generated config C file.
    58         */
    59        override config ITarget2.Options ccConfigOpts = {
    60            prefix: "$(ccOpts.prefix)",
    61            suffix: "$(ccOpts.suffix)"
    62        };
    63    
    64        override readonly config ITarget2.Command asm = {
    65            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -x assembler-with-cpp",
    66            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
    67        };
    68    
    69        readonly config ITarget2.Command asmBin = {
    70            cmd: "bin/arm-none-eabi-gcc -c -x assembler-with-cpp",
    71            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
    72        };
    73    
    74        override config ITarget2.Options lnkOpts = {
    75            prefix: "-mfloat-abi=hard -nostartfiles -Wl,-static -Wl,--gc-sections",
    76            suffix: "-Wl,--start-group -lgcc -lc -lm -Wl,--end-group -Wl,-Map=$(XDCCFGDIR)/$@.map"
    77        };
    78    
    79        readonly config ITarget2.Command arBin = {
    80            cmd: "bin/arm-none-eabi-ar ",
    81            opts: ""
    82        };
    83    
    84        /*!
    85         *  ======== bspLib ========
    86         *  bspLib is assigned the name of the BSP library. The specified library
    87         *  is included on the link line.
    88         *
    89         *  Possible values for this field are "nosys" and "rdimon" with the default
    90         *  being "nosys".
    91         */
    92        override config string bspLib = "nosys";
    93    
    94        /*!
    95         *  ======== targetPkgPath ========
    96         *  targetPkgPath controls the path to the package that contains the GNU
    97         *  libraries.
    98         */
    99        config string targetPkgPath = null;
   100    
   101        /*
   102         *  ======== profiles ========
   103         */
   104        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   105            ["debug", {
   106                compileOpts: {
   107                    copts: "-g",
   108                    defs:  "-D_DEBUG_=1",
   109                },
   110                linkOpts: "-g",
   111            }],
   112    
   113            ["release", {
   114                compileOpts: {
   115                    copts: " -O2 ",
   116                },
   117                linkOpts: " ",
   118            }],
   119        ];
   120    
   121        /*
   122         *  ======== compatibleSuffixes ========
   123         */
   124        override config String compatibleSuffixes[] = [];
   125    
   126        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   127            t_IArg          : { size: 4, align: 4 },
   128            t_Char          : { size: 1, align: 1 },
   129            t_Double        : { size: 8, align: 8 },
   130            t_Float         : { size: 4, align: 4 },
   131            t_Fxn           : { size: 4, align: 4 },
   132            t_Int           : { size: 4, align: 4 },
   133            t_Int8          : { size: 1, align: 1 },
   134            t_Int16         : { size: 2, align: 2 },
   135            t_Int32         : { size: 4, align: 4 },
   136            t_Int64         : { size: 8, align: 8 },
   137            t_Long          : { size: 4, align: 4 },
   138            t_LDouble       : { size: 8, align: 8 },
   139            t_LLong         : { size: 8, align: 8 },
   140            t_Ptr           : { size: 4, align: 4 },
   141            t_Short         : { size: 2, align: 2 },
   142            t_Size          : { size: 4, align: 4 },
   143        };
   144    }
   145    /*
   146     *  @(#) gnu.targets.arm; 1, 0, 0,0; 2-10-2017 09:06:32; /db/ztree/library/trees/xdctargets/xdctargets-m11/src/ xlibrary
   147    
   148     */
   149