1    /*
     2     * Copyright (c) 2016, Texas Instruments Incorporated
     3     * All rights reserved.
     4     *
     5     * Redistribution and use in source and binary forms, with or without
     6     * modification, are permitted provided that the following conditions
     7     * are met:
     8     *
     9     * *  Redistributions of source code must retain the above copyright
    10     *    notice, this list of conditions and the following disclaimer.
    11     *
    12     * *  Redistributions in binary form must reproduce the above copyright
    13     *    notice, this list of conditions and the following disclaimer in the
    14     *    documentation and/or other materials provided with the distribution.
    15     *
    16     * *  Neither the name of Texas Instruments Incorporated nor the names of
    17     *    its contributors may be used to endorse or promote products derived
    18     *    from this software without specific prior written permission.
    19     *
    20     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    22     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    23     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    24     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    25     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    26     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    27     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    28     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    29     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    30     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31     */
    32    
    33    /*
    34     *  ======== Platform.xdc ========
    35     */
    36    
    37    package ti.platforms.arm;
    38    
    39    /*!
    40     *  ======== Platform ========
    41     *  Generic platform support for the arm
    42     *
    43     *  This platform requires a memory map file called `board.xs` to be available
    44     *  in the same directory as the application config file. It should define
    45     *  values for the config parameters which are declared in this platform.
    46     *
    47     *  @a(Examples)
    48     *  A sample `board.xs` file.
    49     *
    50     *  @p(code)
    51     *  var boardARM = {
    52     *      CPU: {
    53     *          clockRate:      300.0,
    54     *          catalogName:    "ti.catalog.arm.cortexm3",
    55     *          deviceName:     "TMS320DM8168",
    56     *      },
    57     *      externalMemoryMap: [
    58     *          ["EXTRAM",  {
    59     *              name: "DDR",  base: 0xC0000000, len: 0x08000000,
    60     *          }]
    61     *      ],
    62     *      codeMemory:  "DDR",
    63     *      dataMemory:  "DDR",
    64     *      stackMemory: "DDR",
    65     *      l1PMode:     "32k",
    66     *      l1DMode:     "32k",
    67     *      l2Mode:      "0k",
    68     *  };
    69     *  @p
    70     */
    71    metaonly module Platform inherits xdc.platform.IPlatform
    72    {
    73        config xdc.platform.IPlatform.Board BOARD;
    74    
    75    instance:
    76    
    77        /*!
    78         *  ======== CPU ========
    79         *  CPU Attributes necessary to create an execution context
    80         *
    81         *  The platform requires these attributes to get the device internal
    82         *  memory map.
    83         *
    84         *  @see xdc.platform.IExeContext#Cpu
    85         */
    86        config xdc.platform.IExeContext.Cpu CPU = {
    87            id:             "0",
    88            clockRate:      1.0,
    89            catalogName:    "ti.catalog.arm",
    90            deviceName:     "",
    91            revision:       "",
    92        };
    93    
    94        override config String codeMemory = null;
    95    
    96        override config String dataMemory = null;
    97    
    98        override config String stackMemory = null;
    99    
   100        /*!
   101         *  ======== sectionMap ========
   102         *  A section name to SectionSpec mapping
   103         *
   104         *  @see xdc.cfg.Program#sectMap
   105         */
   106        config Any sectionMap[string];
   107    
   108        /*!
   109         *  ======== sectionsExclude ========
   110         *  Section to exclude from linker command file generation
   111         *
   112         *  @see xdc.cfg.Program#sectionsExclude
   113         */
   114        config String sectionsExclude = null;
   115    
   116        /*!
   117         *  ======== memoryExclude ========
   118         *  Section to exclude from linker command file generation
   119         *
   120         *  @see xdc.cfg.Program#memoryExclude
   121         */
   122        config Bool memoryExclude = false;
   123    
   124        /*!
   125         *  ======== sectionsTemplate ========
   126         *  Replace the sections portion of the generated linker command file.
   127         *
   128         *  @see xdc.cfg.Program#sectionsTemplate
   129         */
   130        config String sectionsTemplate = null;
   131    
   132        /*!
   133         *  ======== l1PMode ========
   134         *  Define the amount of L1P RAM used for L1 Program Cache.
   135         */
   136        config String l1PMode = null;
   137    
   138        /*!
   139         *  ======== l1DMode ========
   140         *  Define the amount of L1D RAM used for L1 Data Cache.
   141         */
   142        config String l1DMode = null;
   143    
   144        /*!
   145         *  ======== l2Mode ========
   146         *  Define the amount of L2 RAM used for L2 Cache.
   147         */
   148        config String l2Mode = null;
   149    
   150        /*!
   151         *  ======== sectMap ========
   152         *  @_nodoc
   153         */
   154        override config String sectMap[string];
   155    
   156        /*!
   157         *  ======== getCpuDataSheet ========
   158         *  @_nodoc
   159         */
   160        override function getCpuDataSheet(cpuId);
   161    
   162        /*!
   163         *  ======== getExeContext ========
   164         *  @_nodoc
   165         */
   166        override function getExeContext(prog);
   167    
   168        /*!
   169         *  ======== getExecCmd ========
   170         *  @_nodoc
   171         */
   172        override function getExecCmd(prog, platPath);
   173    
   174        /*!
   175         *  ======== getLinkTemplate ========
   176         *  @_nodoc
   177         */
   178        override function getLinkTemplate(prog);
   179    };