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