1    /*
     2     *  Copyright 2020 by Texas Instruments Incorporated.
     3     *
     4     */
     5    
     6    /*
     7     * Copyright (c) 2012-2020 Texas Instruments Incorporated - http://www.ti.com
     8     * All rights reserved.
     9     *
    10     * Redistribution and use in source and binary forms, with or without
    11     * modification, are permitted provided that the following conditions
    12     * are met:
    13     *
    14     * *  Redistributions of source code must retain the above copyright
    15     *    notice, this list of conditions and the following disclaimer.
    16     *
    17     * *  Redistributions in binary form must reproduce the above copyright
    18     *    notice, this list of conditions and the following disclaimer in the
    19     *    documentation and/or other materials provided with the distribution.
    20     *
    21     * *  Neither the name of Texas Instruments Incorporated nor the names of
    22     *    its contributors may be used to endorse or promote products derived
    23     *    from this software without specific prior written permission.
    24     *
    25     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    26     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    27     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    28     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    29     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    30     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    31     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    32     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    33     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    34     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    35     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    36     */
    37    import xdc.bld.ITarget2;
    38    
    39    /*!
    40     *  ======== A8F.xdc ========
    41     *  Embedded Cortex A8, little endian, hard-float, bare metal target
    42     *
    43     *  This module defines an embedded bare metal target on Cortex A8. The target
    44     *  generates code compatible with the "v7A" architecture.
    45     *
    46     */
    47    metaonly module A8F inherits gnu.targets.arm.ITarget {
    48        override readonly config string name                = "A8F";
    49        override readonly config string suffix              = "a8fg";
    50        override readonly config string isa                 = "v7A";
    51        override readonly config xdc.bld.ITarget.Model model= {
    52            endian: "little",
    53            shortEnums: true
    54        };
    55    
    56        override readonly config Bool alignDirectiveSupported = true;
    57    
    58        override readonly config string rts = "gnu.targets.arm.rtsv7A";
    59        override config string platform     = "ti.platforms.evmAM3359";
    60    
    61        override config string GCCTARG = "arm-none-eabi";
    62    
    63        override readonly config String stdInclude = "gnu/targets/arm/std.h";
    64    
    65        override readonly config ITarget2.Command cc = {
    66            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -MD -MF $@.dep",
    67            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    68        };
    69    
    70        readonly config ITarget2.Command ccBin = {
    71            cmd: "bin/arm-none-eabi-gcc -c -MD -MF $@.dep",
    72            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g"
    73        };
    74    
    75        override config ITarget2.Options ccOpts = {
    76            prefix: "-Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections ",
    77            suffix: "-Dfar= -D__DYNAMIC_REENT__ "
    78        };
    79    
    80        /*!
    81         *  ======== ccConfigOpts ========
    82         *  User configurable compiler options for the generated config C file.
    83         */
    84        override config ITarget2.Options ccConfigOpts = {
    85            prefix: "$(ccOpts.prefix)",
    86            suffix: "$(ccOpts.suffix)"
    87        };
    88    
    89        override readonly config ITarget2.Command asm = {
    90            cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -x assembler-with-cpp",
    91            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
    92        };
    93    
    94        readonly config ITarget2.Command asmBin = {
    95            cmd: "bin/arm-none-eabi-gcc -c -x assembler-with-cpp",
    96            opts: "-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
    97        };
    98    
    99        override config ITarget2.Options lnkOpts = {
   100            prefix: "-mcpu=cortex-a8 -mfloat-abi=hard -mfpu=neon -nostartfiles -Wl,-static -Wl,--gc-sections",
   101            suffix: "-L$(packageBase)/libs/install-native/$(GCCTARG)/lib/thumb/v7-a/hard -Wl,--start-group -lgcc -lc -lm -Wl,--end-group -Wl,-Map=$(XDCCFGDIR)/$@.map"
   102        };
   103    
   104        readonly config ITarget2.Command arBin = {
   105            cmd: "bin/arm-none-eabi-ar ",
   106            opts: ""
   107        };
   108    
   109        /*!
   110         *  ======== bspLib ========
   111         *  bspLib is assigned the name of the BSP library. The specified library
   112         *  is included on the link line.
   113         *
   114         *  Possible values for this field are "nosys" and "rdimon" with the default
   115         *  being "nosys".
   116         */
   117        override config string bspLib = "nosys";
   118    
   119        /*!
   120         *  ======== includeOpts ========
   121         *  Additional user configurable target-specific include path options
   122         *
   123         *  This target uses newlib run-time.
   124         */
   125        override config string includeOpts = "-I$(packageBase)/libs/install-native/$(GCCTARG)/include";
   126    
   127        /*
   128         *  ======== profiles ========
   129         */
   130        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   131            ["debug", {
   132                compileOpts: {
   133                    copts: "-g",
   134                    defs:  "-D_DEBUG_=1",
   135                },
   136                linkOpts: "-g",
   137            }],
   138    
   139            ["release", {
   140                compileOpts: {
   141                    copts: " -O2 ",
   142                },
   143                linkOpts: " ",
   144            }],
   145        ];
   146    
   147        /*
   148         *  ======== compatibleSuffixes ========
   149         */
   150        override config String compatibleSuffixes[] = [];
   151    
   152        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   153            t_IArg          : { size: 4, align: 4 },
   154            t_Char          : { size: 1, align: 1 },
   155            t_Double        : { size: 8, align: 8 },
   156            t_Float         : { size: 4, align: 4 },
   157            t_Fxn           : { size: 4, align: 4 },
   158            t_Int           : { size: 4, align: 4 },
   159            t_Int8          : { size: 1, align: 1 },
   160            t_Int16         : { size: 2, align: 2 },
   161            t_Int32         : { size: 4, align: 4 },
   162            t_Int64         : { size: 8, align: 8 },
   163            t_Long          : { size: 4, align: 4 },
   164            t_LDouble       : { size: 8, align: 8 },
   165            t_LLong         : { size: 8, align: 8 },
   166            t_Ptr           : { size: 4, align: 4 },
   167            t_Short         : { size: 2, align: 2 },
   168            t_Size          : { size: 4, align: 4 },
   169        };
   170    }
   171    /*
   172     *  @(#) gnu.targets.arm; 1, 0, 0,; 4-8-2020 12:50:22; /db/ztree/library/trees/xdctargets/xdctargets-w13/src/ xlibrary
   173    
   174     */
   175