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.c6000;
    38    
    39    /*!
    40     *  ======== Platform ========
    41     *  Generic platform support for the c6000
    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 board6748 = {
    52     *      BOARD: {
    53     *          boardName:      "board6748",
    54     *          boardFamily:    "board6xxx",
    55     *      },
    56     *      CPU: {
    57     *          clockRate:      300.0,
    58     *          catalogName:    "ti.catalog.c6000",
    59     *          deviceName:     "TMS320C6748",
    60     *      },
    61     *      externalMemoryMap: [
    62     *          ["EXTRAM",  {
    63     *              name: "DDR",  base: 0xC0000000, len: 0x08000000,
    64     *          }]
    65     *      ],
    66     *      codeMemory:  "DDR",
    67     *      dataMemory:  "DDR",
    68     *      stackMemory: "DDR",
    69     *      l1PMode:     "32k",
    70     *      l1DMode:     "32k",
    71     *      l2Mode:      "0k",
    72     *  };
    73     *  @p
    74     */
    75    metaonly module Platform inherits xdc.platform.IPlatform
    76    {
    77        config xdc.platform.IPlatform.Board BOARD;
    78    
    79    instance:
    80    
    81        /*!
    82         *  ======== CPU ========
    83         *  CPU Attributes necessary to create an execution context
    84         *
    85         *  The platform requires these attributes to get the device internal
    86         *  memory map.
    87         *
    88         *  @see xdc.platform.IExeContext#Cpu
    89         */
    90        config xdc.platform.IExeContext.Cpu CPU = {
    91            id:             "0",
    92            clockRate:      1.0,
    93            catalogName:    "ti.catalog.c6000",
    94            deviceName:     "",
    95            revision:       "",
    96        };
    97    
    98        override config String codeMemory = null;
    99    
   100        override config String dataMemory = null;
   101    
   102        override config String stackMemory = null;
   103    
   104        /*!
   105         *  ======== sectionMap ========
   106         *  A section name to SectionSpec mapping
   107         *
   108         *  @see xdc.cfg.Program#sectMap
   109         */
   110        config Any sectionMap[string];
   111    
   112        /*!
   113         *  ======== sectionsExclude ========
   114         *  Section to exclude from linker command file generation
   115         *
   116         *  @see xdc.cfg.Program#sectionsExclude
   117         */
   118        config String sectionsExclude = null;
   119    
   120        /*!
   121         *  ======== memoryExclude ========
   122         *  Section to exclude from linker command file generation
   123         *
   124         *  @see xdc.cfg.Program#memoryExclude
   125         */
   126        config Bool memoryExclude = false;
   127    
   128        /*!
   129         *  ======== sectionsTemplate ========
   130         *  Replace the sections portion of the generated linker command file.
   131         *
   132         *  @see xdc.cfg.Program#sectionsTemplate
   133         */
   134        config String sectionsTemplate = null;
   135    
   136        /*!
   137         *  ======== l1PMode ========
   138         *  Define the amount of L1P RAM used for L1 Program Cache.
   139         */
   140        config String l1PMode = null;
   141    
   142        /*!
   143         *  ======== l1DMode ========
   144         *  Define the amount of L1D RAM used for L1 Data Cache.
   145         */
   146        config String l1DMode = null;
   147    
   148        /*!
   149         *  ======== l2Mode ========
   150         *  Define the amount of L2 RAM used for L2 Cache.
   151         */
   152        config String l2Mode = null;
   153    
   154        /*!
   155         *  ======== sectMap ========
   156         *  @_nodoc
   157         */
   158        override config String sectMap[string];
   159    
   160        /*!
   161         *  ======== getCpuDataSheet ========
   162         *  @_nodoc
   163         */
   164        override function getCpuDataSheet(cpuId);
   165    
   166        /*!
   167         *  ======== getExeContext ========
   168         *  @_nodoc
   169         */
   170        override function getExeContext(prog);
   171    
   172        /*!
   173         *  ======== getExecCmd ========
   174         *  @_nodoc
   175         */
   176        override function getExecCmd(prog, platPath);
   177    
   178        /*!
   179         *  ======== getLinkTemplate ========
   180         *  @_nodoc
   181         */
   182        override function getLinkTemplate(prog);
   183    };