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     *  Platform support for simVayu
    36     *
    37     */
    38    
    39    /*!
    40     *  ======== Platform ========
    41     *  Platform support for simVayu
    42     *
    43     *  This module implements xdc.platform.IPlatform and defines configuration
    44     *  parameters that correspond to this platform's Cpu's, Board's, etc.
    45     *
    46     *  The configuration parameters are initialized in this package's
    47     *  configuration script (package.cfg) and "bound" to the TCOM object
    48     *  model.  Once they are part of the model, these parameters are
    49     *  queried by a program's configuration script.
    50     *
    51     *  This particular platform has 1 Cortex-A15, 4 EVE's, 2 Benelli/IPU
    52     *  Sub-system (Dual M4's) and 2 C66x DSP's.
    53     */
    54    metaonly module Platform inherits xdc.platform.IPlatform
    55    {
    56        readonly config xdc.platform.IPlatform.Board BOARD = {
    57            id:             "0",
    58            boardName:      "simVayu",
    59            boardFamily:    "simVayu",
    60            boardRevision:  null,
    61        };
    62    
    63        readonly config xdc.platform.IExeContext.Cpu DSP = {
    64            id:             "0",
    65            clockRate:      1000,
    66            catalogName:    "ti.catalog.c6000",
    67            deviceName:     "Vayu",
    68            revision:       "1.0",
    69        };
    70    
    71        /* Benelli M4 Subsystem */
    72        readonly config xdc.platform.IExeContext.Cpu M4 = {
    73            id:             "1",
    74            clockRate:      266.0,
    75            catalogName:    "ti.catalog.arm.cortexm4",
    76            deviceName:     "Vayu",
    77            revision:       "1.0",
    78        };
    79    
    80        /* EVE */
    81        readonly config xdc.platform.IExeContext.Cpu EVE = {
    82            id:             "2",
    83            clockRate:      200.0,
    84            catalogName:    "ti.catalog.arp32",
    85            deviceName:     "Vayu",
    86            revision:       "1.0"
    87        };
    88    
    89        /* GPP */
    90        readonly config xdc.platform.IExeContext.Cpu GPP = {
    91            id:             "3",
    92            clockRate:      800.0,  /* Typically set by the HLOS */
    93            catalogName:    "ti.catalog.arm.cortexa15",
    94            deviceName:     "Vayu",
    95            revision:       "1.0"
    96        };
    97    
    98    /*  Memory Map for ti.platforms.simVayu
    99     *
   100     *  Virtual     Physical        Size            Comment
   101     *  ------------------------------------------------------------------------
   102     *              8000_0000  1000_0000  ( 256 MB) External Memory
   103     *
   104     *  0000_0000 0 8000_0000        100  ( 256  B) EVE1_VECS (vector table)
   105     *              8000_0100       FF00  ( ~64 KB) --------
   106     *  0000_0000   8001_0000        100  ( 256  B) EVE2_VECS (vector table)
   107     *              8001_0100       FF00  ( ~64 KB) --------
   108     *  0000_0000   8002_0000        100  ( 256  B) EVE3_VECS (vector table)
   109     *              8002_0100       FF00  ( ~64 KB) --------
   110     *  0000_0000   8003_0000        100  ( 256  B) EVE4_VECS (vector table)
   111     *              8003_0100    FE_FF00  ( ~16 MB) --------
   112     *            1 8100_0000    40_0000  (   4 MB) EVE1_PROG (code, data)
   113     *              8140_0000    C0_0000  (  12 MB) --------
   114     *            2 8200_0000    40_0000  (   4 MB) EVE2_PROG (code, data)
   115     *              8240_0000    C0_0000  (  12 MB) --------
   116     *            3 8300_0000    40_0000  (   4 MB) EVE3_PROG (code, data)
   117     *              8340_0000    C0_0000  (  12 MB) --------
   118     *            4 8400_0000    40_0000  (   4 MB) EVE4_PROG (code, data)
   119     *              8440_0000    C0_0000  (  12 MB) --------
   120     *            5 8500_0000   100_0000  (  16 MB) --------
   121     *            6 8600_0000   100_0000  (  16 MB) --------
   122     *            7 8700_0000   100_0000  (  16 MB) --------
   123     *            8 8800_0000   100_0000  (  16 MB) --------
   124     *            9 8900_0000   100_0000  (  16 MB) --------
   125     *            A 8A00_0000    80_0000  (   8 MB) IPU1 (code, data), benelli
   126     *              8A80_0000    80_0000  (   8 MB) IPU2 (code, data), benelli
   127     *            B 8B00_0000   100_0000  (  16 MB) HOST (code, data)
   128     *            C 8C00_0000   100_0000  (  16 MB) DSP1 (code, data)
   129     *            D 8D00_0000   100_0000  (  16 MB) DSP2 (code, data)
   130     *            E 8E00_0000   100_0000  (  16 MB) SR_0 (ipc)
   131     *            F 8F00_0000   100_0000  (  16 MB) --------
   132     */
   133    
   134        readonly config Any SR_0 = {
   135            name: "SR_0", space: "data", access: "RWX",
   136            base: 0x8E000000, len: 0x1000000,
   137            comment: "SR#0 Memory (16 MB)"
   138        };
   139    
   140        readonly config Any DSP1 = {
   141            externalMemoryMap: [
   142                [ "DSP1_PROG", {
   143                    name: "DSP1_PROG", space: "code/data", access: "RWX",
   144                    base: 0x8C000000, len: 0x1000000,
   145                    comment: "DSP1 Program Memory (16 MB)"
   146                }],
   147                [ "SR_0", SR_0 ]
   148            ],
   149            codeMemory:  "DSP1_PROG",
   150            dataMemory:  "DSP1_PROG",
   151            stackMemory: "DSP1_PROG",
   152            l1DMode: "32k",
   153            l1PMode: "32k",
   154            l2Mode: "128k"
   155        };
   156    
   157        readonly config Any DSP2 = {
   158            externalMemoryMap: [
   159                [ "DSP2_PROG", {
   160                    name: "DSP2_PROG", space: "code/data", access: "RWX",
   161                    base: 0x8D000000, len: 0x1000000,
   162                    comment: "DSP2 Program Memory (16 MB)"
   163                }],
   164                [ "SR_0", SR_0 ]
   165            ],
   166            codeMemory:  "DSP2_PROG",
   167            dataMemory:  "DSP2_PROG",
   168            stackMemory: "DSP2_PROG",
   169            l1DMode: "32k",
   170            l1PMode: "32k",
   171            l2Mode: "128k"
   172        };
   173    
   174        readonly config Any EVE1 = {
   175            externalMemoryMap: [
   176                [ "EVEVECS", { /* name used by SYS/BIOS */
   177                    name: "EVEVECS", space: "code/data", access: "RWX",
   178                    base: 0x80000000, len: 0x100, page: 0,
   179                    comment: "EVE1 Vector Table (256 B)"
   180                }],
   181                [ "EVE1_PROG", {
   182                    name: "EVE1_PROG", space: "code/data", access: "RWX",
   183                    base: 0x81000000, len: 0x400000, page: 1,
   184                    comment: "EVE1 Program Memory (4 MB)"
   185                }],
   186                [ "SR_0", SR_0 ]
   187            ],
   188            codeMemory:  "EVE1_PROG",
   189            dataMemory:  "EVE1_PROG",
   190            stackMemory: "EVE1_PROG"
   191        };
   192    
   193        readonly config Any EVE2 = {
   194            externalMemoryMap: [
   195                [ "EVEVECS", { /* name used by SYS/BIOS */
   196                    name: "EVEVECS", space: "code/data", access: "RWX",
   197                    base: 0x80010000, len: 0x100, page: 0,
   198                    comment: "EVE2 Vector Table (256 B)"
   199                }],
   200                [ "EVE2_PROG", {
   201                    name: "EVE2_PROG", space: "code/data", access: "RWX",
   202                    base: 0x82000000, len: 0x400000, page: 1,
   203                    comment: "EVE2 Program Memory (4 MB)"
   204                }],
   205                [ "SR_0", SR_0 ]
   206            ],
   207            codeMemory:  "EVE2_PROG",
   208            dataMemory:  "EVE2_PROG",
   209            stackMemory: "EVE2_PROG"
   210        };
   211    
   212        readonly config Any EVE3 = {
   213            externalMemoryMap: [
   214                [ "EVEVECS", { /* name used by SYS/BIOS */
   215                    name: "EVEVECS", space: "code/data", access: "RWX",
   216                    base: 0x80020000, len: 0x100, page: 0,
   217                    comment: "EVE3 Vector Table (256 B)"
   218                }],
   219                [ "EVE3_PROG", {
   220                    name: "EVE3_PROG", space: "code/data", access: "RWX",
   221                    base: 0x83000000, len: 0x400000, page: 1,
   222                    comment: "EVE3 Program Memory (4 MB)"
   223                }],
   224                [ "SR_0", SR_0 ]
   225            ],
   226            codeMemory:  "EVE3_PROG",
   227            dataMemory:  "EVE3_PROG",
   228            stackMemory: "EVE3_PROG"
   229        };
   230    
   231        readonly config Any EVE4 = {
   232            externalMemoryMap: [
   233                [ "EVEVECS", { /* name used by SYS/BIOS */
   234                    name: "EVEVECS", space: "code/data", access: "RWX",
   235                    base: 0x80030000, len: 0x100, page: 0,
   236                    comment: "EVE4 Vector Table (256 B)"
   237                }],
   238                [ "EVE4_PROG", {
   239                    name: "EVE4_PROG", space: "code/data", access: "RWX",
   240                    base: 0x84000000, len: 0x400000, page: 1,
   241                    comment: "EVE4 Program Memory (4 MB)"
   242                }],
   243                [ "SR_0", SR_0 ]
   244            ],
   245            codeMemory:  "EVE4_PROG",
   246            dataMemory:  "EVE4_PROG",
   247            stackMemory: "EVE4_PROG"
   248        };
   249    
   250        readonly config Any IPU1 = {
   251            externalMemoryMap: [
   252                [ "IPU1_PROG", {
   253                    name: "IPU1_PROG", space: "code/data", access: "RWX",
   254                    base: 0x8A000000, len: 0x800000,
   255                    comment: "IPU1 Program Memory (8 MB)"
   256                }],
   257                [ "SR_0", SR_0 ]
   258            ],
   259            codeMemory:  "IPU1_PROG",
   260            dataMemory:  "IPU1_PROG",
   261            stackMemory: "IPU1_PROG"
   262        };
   263    
   264        readonly config Any IPU2 = {
   265            externalMemoryMap: [
   266                [ "IPU2_PROG", {
   267                    name: "IPU2_PROG", space: "code/data", access: "RWX",
   268                    base: 0x8A800000, len: 0x800000,
   269                    comment: "IPU2 Program Memory (8 MB)"
   270                }],
   271                [ "SR_0", SR_0 ]
   272            ],
   273            codeMemory:  "IPU2_PROG",
   274            dataMemory:  "IPU2_PROG",
   275            stackMemory: "IPU2_PROG"
   276        };
   277    
   278        readonly config Any HOST = {
   279            externalMemoryMap: [
   280                [ "HOST_PROG", {
   281                    name: "HOST_PROG", space: "code/data", access: "RWX",
   282                    base: 0x8B000000, len: 0x1000000,
   283                    comment: "HOST Program Memory (16 MB)"
   284                }],
   285                [ "SR_0", SR_0 ]
   286            ],
   287            codeMemory:  "HOST_PROG",
   288            dataMemory:  "HOST_PROG",
   289            stackMemory: "HOST_PROG"
   290        };
   291    
   292    instance:
   293    
   294        /*!
   295         *  ======== externalMemoryMap ========
   296         *  Memory regions as defined in the Vayu Simulator Specification
   297         */
   298        override readonly config xdc.platform.IPlatform.Memory
   299            externalMemoryMap[string] = [
   300                ["EXT_RAM", {
   301                    comment: "1 GB External RAM Memory",
   302                    name: "EXT_RAM",
   303                    base: 0x80000000,
   304                    len:  0x40000000
   305                }]
   306            ];
   307    
   308        /*
   309         *  ======== l1PMode ========
   310         *  Define the amount of L1P RAM used for L1 Program Cache.
   311         *
   312         *  Check the device documentation for valid values.
   313         */
   314        config String l1PMode = "32k";
   315    
   316        /*
   317         *  ======== l1DMode ========
   318         *  Define the amount of L1D RAM used for L1 Data Cache.
   319         *
   320         *  Check the device documentation for valid values.
   321         */
   322        config String l1DMode = "32k";
   323    
   324        /*
   325         *  ======== l2Mode ========
   326         *  Define the amount of L2 RAM used for L2 Cache.
   327         *
   328         *  Check the device documentation for valid values.
   329         */
   330        config String l2Mode = "0k";
   331    };