1    /*
     2     *  Copyright 2019 by Texas Instruments Incorporated.
     3     *
     4     */
     5    
     6    /*
     7     *  Copyright (c) 2012-2017 Texas Instruments and others.
     8     *  All rights reserved. This program and the accompanying materials
     9     *  are made available under the terms of the Eclipse Public License v1.0
    10     *  which accompanies this distribution, and is available at
    11     *  http://www.eclipse.org/legal/epl-v10.html
    12     *
    13     *  Contributors:
    14     *      Texas Instruments - initial implementation
    15     */
    16    import xdc.bld.ITarget2;
    17    
    18    /*!
    19     *  ======== A9F.xdc ========
    20     *  Embedded Cortex A9, little endian, hard-float, bare metal target
    21     *
    22     *  This module defines an embedded bare metal target on Cortex A9. The target
    23     *  generates code compatible with the "v7A" architecture.
    24     *
    25     */
    26    metaonly module A9F inherits gnu.targets.arm.ITarget {
    27        override readonly config string name                = "A9F";
    28        override readonly config string suffix              = "a9fg";
    29        override readonly config string isa                 = "v7A9";
    30        override readonly config xdc.bld.ITarget.Model model= {
    31            endian: "little",
    32            shortEnums: true
    33        };
    34    
    35        override readonly config Bool alignDirectiveSupported = true;
    36    
    37        override readonly config string rts = "gnu.targets.arm.rtsv7A";
    38        override config string platform     = "ti.platforms.sdp4430";
    39    
    40        override config string GCCTARG = "arm-none-eabi";
    41    
    42        override readonly config String stdInclude = "gnu/targets/arm/std.h";
    43    
    44        override readonly config ITarget2.Command cc = {
    45            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -MD -MF $@.dep",
    46            opts: "-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    47        };
    48    
    49        readonly config ITarget2.Command ccBin = {
    50            cmd: "bin/arm-none-eabi-gcc -c -MD -MF $@.dep",
    51            opts: "-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    52        };
    53    
    54        override config ITarget2.Options ccOpts = {
    55            prefix: "-Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections ",
    56            suffix: "-Dfar= -D__DYNAMIC_REENT__ "
    57        };
    58    
    59        /*!
    60         *  ======== ccConfigOpts ========
    61         *  User configurable compiler options for the generated config C file.
    62         */
    63        override config ITarget2.Options ccConfigOpts = {
    64            prefix: "$(ccOpts.prefix)",
    65            suffix: "$(ccOpts.suffix)"
    66        };
    67    
    68        override readonly config ITarget2.Command asm = {
    69            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -x assembler-with-cpp",
    70            opts: "-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard"
    71        };
    72    
    73        readonly config ITarget2.Command asmBin = {
    74            cmd: "bin/arm-none-eabi-gcc -c -x assembler-with-cpp",
    75            opts: "-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard"
    76        };
    77    
    78        override config ITarget2.Options lnkOpts = {
    79            prefix: "-mfloat-abi=hard -nostartfiles -Wl,-static -Wl,--gc-sections",
    80            suffix: "-L$(packageBase)/libs/install-native/$(GCCTARG)/lib/hard -Wl,--start-group -lgcc -lc -lm -Wl,--end-group --specs=nano.specs -Wl,-Map=$(XDCCFGDIR)/$@.map"
    81        };
    82    
    83        readonly config ITarget2.Command arBin = {
    84            cmd: "bin/arm-none-eabi-ar ",
    85            opts: ""
    86        };
    87    
    88        /*!
    89         *  ======== bspLib ========
    90         *  bspLib is assigned the name of the BSP library. The specified library
    91         *  is included on the link line.
    92         *
    93         *  Possible values for this field are "nosys" and "rdimon" with the default
    94         *  being "nosys".
    95         */
    96        override config string bspLib = "nosys";
    97    
    98        /*!
    99         *  ======== includeOpts ========
   100         *  Additional user configurable target-specific include path options
   101         *
   102         *  This target uses newlib-nano run-time.
   103         */
   104        override config string includeOpts = "-I$(packageBase)/libs/install-native/$(GCCTARG)/include/newlib-nano -I$(packageBase)/libs/install-native/$(GCCTARG)/include";
   105    
   106        /*
   107         *  ======== profiles ========
   108         */
   109        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   110            ["debug", {
   111                compileOpts: {
   112                    copts: "-g",
   113                    defs:  "-D_DEBUG_=1",
   114                },
   115                linkOpts: "-g",
   116            }],
   117    
   118            ["release", {
   119                compileOpts: {
   120                    copts: " -O2 ",
   121                },
   122                linkOpts: " ",
   123            }],
   124        ];
   125    
   126        /*
   127         *  ======== compatibleSuffixes ========
   128         */
   129        override config String compatibleSuffixes[] = [];
   130    
   131        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   132            t_IArg          : { size: 4, align: 4 },
   133            t_Char          : { size: 1, align: 1 },
   134            t_Double        : { size: 8, align: 8 },
   135            t_Float         : { size: 4, align: 4 },
   136            t_Fxn           : { size: 4, align: 4 },
   137            t_Int           : { size: 4, align: 4 },
   138            t_Int8          : { size: 1, align: 1 },
   139            t_Int16         : { size: 2, align: 2 },
   140            t_Int32         : { size: 4, align: 4 },
   141            t_Int64         : { size: 8, align: 8 },
   142            t_Long          : { size: 4, align: 4 },
   143            t_LDouble       : { size: 8, align: 8 },
   144            t_LLong         : { size: 8, align: 8 },
   145            t_Ptr           : { size: 4, align: 4 },
   146            t_Short         : { size: 2, align: 2 },
   147            t_Size          : { size: 4, align: 4 },
   148        };
   149    }
   150    /*
   151     *  @(#) gnu.targets.arm; 1, 0, 0,0; 4-18-2019 17:32:46; /db/ztree/library/trees/xdctargets/xdctargets-t04/src/ xlibrary
   152    
   153     */
   154