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.ITarget {
    23        override readonly config string name                = "A8F";
    24        override readonly config string suffix              = "a8fg";
    25        override readonly config string isa                 = "v7A8";
    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 LONGNAME = "bin/arm-none-eabi-gcc";
    37    
    38        override readonly config String stdInclude = "gnu/targets/arm/std.h";
    39    
    40        override readonly config ITarget2.Command cc = {
    41            cmd: "$(rootDir)/$(LONGNAME) -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: "-Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections",
    61            suffix: "-Dfar= -D__DYNAMIC_REENT__ "
    62        };
    63    
    64        override readonly config ITarget2.Command asm = {
    65            cmd: "$(rootDir)/$(LONGNAME) -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 -L$(XDCROOT)/packages/gnu/targets/arm/libs/install-native/$(GCCTARG)/lib/fpu"
    77        };
    78    
    79        readonly config ITarget2.Command arBin = {
    80            cmd: "bin/arm-none-eabi-ar ",
    81            opts: ""
    82        };
    83    
    84        /*
    85         *  ======== profiles ========
    86         */
    87        override config xdc.bld.ITarget.OptionSet profiles[string] = [
    88            ["debug", {
    89                compileOpts: {
    90                    copts: "-g",
    91                    defs:  "-D_DEBUG_=1",
    92                },
    93                linkOpts: "-g",
    94            }],
    95    
    96            ["release", {
    97                compileOpts: {
    98                    copts: " -O2 ",
    99                },
   100                linkOpts: " ",
   101            }],
   102        ];
   103    
   104        /*
   105         *  ======== compatibleSuffixes ========
   106         */
   107        override config String compatibleSuffixes[] = [];
   108    
   109        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   110            t_IArg          : { size: 4, align: 4 },
   111            t_Char          : { size: 1, align: 1 },
   112            t_Double        : { size: 8, align: 8 },
   113            t_Float         : { size: 4, align: 4 },
   114            t_Fxn           : { size: 4, align: 4 },
   115            t_Int           : { size: 4, align: 4 },
   116            t_Int8          : { size: 1, align: 1 },
   117            t_Int16         : { size: 2, align: 2 },
   118            t_Int32         : { size: 4, align: 4 },
   119            t_Int64         : { size: 8, align: 8 },
   120            t_Long          : { size: 4, align: 4 },
   121            t_LDouble       : { size: 8, align: 8 },
   122            t_LLong         : { size: 8, align: 8 },
   123            t_Ptr           : { size: 4, align: 4 },
   124            t_Short         : { size: 2, align: 2 },
   125            t_Size          : { size: 4, align: 4 },
   126        };
   127    }
   128    /*
   129     *  @(#) gnu.targets.arm; 1, 0, 0,408; 3-12-2013 15:04:42; /db/ztree/library/trees/xdctargets/xdctargets-g22x/src/ xlibrary
   130    
   131     */
   132