This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRA7XX : Can't configure DSP - L2 as maximum SRAM

Other Parts Discussed in Thread: MATHLIB, AM5728

Hello,

We need to configure whole of L2 memory (as per the Corepac c66x datasheet max of 4MB) as SRAM.

Please find the platform.xdc file details below, here it is by default configured for l2mode as 0kB cache (we do not want L2 as cache) and we have modified the L2SRAM section for 4MB.  However if we perform any simple math operation like multiplication of  2 arrays with size beyond 256k, the operation produces corrupt output. Earlier in this platform.xdc L2SRAM was configured for 256k. However if we restrict the buffers within 256k, the math operation goes fine.

We need to increase the size of L2 for max SRAM to accommodate all our application buffers( which are computation intensive). We will be later using DSPLIB & MATHLIB calls on these buffers.  We have seen MATHLIB & DSPLIB giving pathetic performance if the memory is allocated in DDR.

Our assesment :Even though the L2 is configured as complete 4M SRAM in platform.xdc, we are not seeing its effect when we do operation beyond 256kB. Do we have to make this change elsewhere too ?

Please provide us details as to how we can canfigure L2 for 4MB SRAM.

 

***************************************************** platform.xdc ****************************************************************

/*!
* File generated by platform wizard. DO NOT MODIFY
*
*/

metaonly module Platform inherits xdc.platform.IPlatform {

config ti.platforms.generic.Platform.Instance CPU =
ti.platforms.generic.Platform.create("CPU", {
clockRate: 1000,
catalogName: "ti.catalog.c6000",
deviceName: "Vayu",
customMemoryMap:
[
["EXT_CODE",
{
name: "EXT_CODE",
base: 0x95000000,
len: 0x00200000, //0x00100000
space: "code/data",
access: "RWX",
}
],
["EXT_DATA",
{
name: "EXT_DATA",
base: 0x95200000, //0x95100000
len: 0x00800000, //0x00100000
space: "data",
access: "RW",
}
],
["EXT_HEAP",
{
name: "EXT_HEAP",
base: 0x95A00000, //0x95200000
len: 0x03200000, //0x03200000 0x00300000 50MB
space: "data",
access: "RW",
}
],
["TRACE_BUF",
{
name: "TRACE_BUF",
base: 0x9F000000,
len: 0x00060000,
space: "data",
access: "RW",
}
],
["EXC_DATA",
{
name: "EXC_DATA",
base: 0x9F060000,
len: 0x00010000,
space: "data",
access: "RW",
}
],
["PM_DATA",
{
name: "PM_DATA",
base: 0x9F070000,
len: 0x00020000,
space: "data",
access: "RWX",
}
],
["SR_0",
{
name: "SR_0",
base: 0xBFC00000,
len: 0x6400000,
space: "data",
access: "RWX",
}
],
["L2SRAM",
{
name: "L2SRAM",
base: 0x00800000,
len: 0x000400000,
space: "code/data",
access: "RWX",
}
],


],
l2Mode:"0k",
l1PMode:"32k",
l1DMode:"32k",

});

instance :

override config string codeMemory = "EXT_CODE";
override config string dataMemory = "EXT_DATA";
override config string stackMemory = "EXT_DATA";

}

Thanks,

Naveen Shetti

  • Hi Naveen,

    As per the TRM, the DSP on DRA7XX has 288KB of L2 of which a maximum of 256KB is cacheable and the remaining 32KB is always mapped as SRAM. So, you can configure the L2SRAM to be a maximum of 288KB only.

    Best,
    Ashish
  • Adding to my previous post:

    Since you mentioned that you are seeing poor Mathlib performance when data is in DDR, I would recommend using the on-chip RAM (OCMC RAM1-3) for storing data that does not fit in L2SRAM. I believe accesses to OCMC RAM are faster and therefore should result in better performance.

    Best,
    Ashish
  • Hello Ashish,

    Thanks for the reply.


    I tried to configure the OCMC sections in platform.xdc file through CCS, but when i try to allocate a global buffer in this region then the DSP image doesn't load at all, looks like its unable to access this theis OCMC region, even once I got an error unable to access corresponding OCMC address.

    Please let me know how can i configure these OCMC regions properly.


    As per the datasheet of DRA7XX (AM5728 EVM) :

    1. OCMC_RAM1 : 0x40300000 (start base address) and  max size supported is 512kB

    2. OCMC_RAM2 : 0x40400000 (start base address) and  max size supported is 1MB

    2. OCMC_RAM3 : 0x40500000 (start base address) and  max size supported is 1MB

    Please find the snippet from linker.cmd file :


    MEMORY
    {
        EXT_CODE (RWX) : org = 0x95000000, len = 0x200000
        EXT_DATA (RW) : org = 0x95200000, len = 0x800000
        EXT_HEAP (RW) : org = 0x95a00000, len = 0x3200000
        TRACE_BUF (RW) : org = 0x9f000000, len = 0x60000
        EXC_DATA (RW) : org = 0x9f060000, len = 0x10000
        PM_DATA (RWX) : org = 0x9f070000, len = 0x20000
        SR_0 (RWX) : org = 0xbfc00000, len = 0x6400000
        L2SRAM (RWX) : org = 0x800000, len = 0x400000
        OCMC_RAM1 (RWX) : org = 0x40300000, len = 0x80000
        OCMC_RAM2 (RWX) : org = 0x40400000, len = 0x100000
        OCMC_RAM3 (RWX) : org = 0x40500000, len = 0x100000
    }

    Please find the snippet from platform.xdc file.

    metaonly module Platform inherits xdc.platform.IPlatform {

        config ti.platforms.generic.Platform.Instance CPU =
            ti.platforms.generic.Platform.create("CPU", {
                clockRate:      1000,                                       
                catalogName:    "ti.catalog.c6000",
                deviceName:     "Vayu",
                customMemoryMap:
               [          
                    ["EXT_CODE",
                         {
                            name: "EXT_CODE",
                            base: 0x95000000,                    
                            len: 0x00200000,                    
                            space: "code/data",
                            access: "RWX",
                         }
                    ],
                    ["EXT_DATA",
                         {
                            name: "EXT_DATA",
                            base: 0x95200000,                    
                            len: 0x00800000,                    
                            space: "data",
                            access: "RW",
                         }
                    ],
                    ["EXT_HEAP",
                         {
                            name: "EXT_HEAP",
                            base: 0x95A00000,                    
                            len: 0x03200000,                    
                            space: "data",
                            access: "RW",
                         }
                    ],
                    ["TRACE_BUF",
                         {
                            name: "TRACE_BUF",
                            base: 0x9F000000,                    
                            len: 0x00060000,                    
                            space: "data",
                            access: "RW",
                         }
                    ],
                    ["EXC_DATA",
                         {
                            name: "EXC_DATA",
                            base: 0x9F060000,                    
                            len: 0x00010000,                    
                            space: "data",
                            access: "RW",
                         }
                    ],
                    ["PM_DATA",
                         {
                            name: "PM_DATA",
                            base: 0x9F070000,                    
                            len: 0x00020000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
                    ["SR_0",
                         {
                            name: "SR_0",
                            base: 0xBFC00000,                    
                            len: 0x6400000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
                    ["L2SRAM",
                         {
                            name: "L2SRAM",
                            base: 0x00800000,                    
                            len: 0x400000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
                    ["OCMC_RAM1",
                         {
                            name: "OCMC_RAM1",
                            base: 0x40300000,                    
                            len: 0x00080000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
                    ["OCMC_RAM2",
                         {
                            name: "OCMC_RAM2",
                            base: 0x40400000,                    
                            len: 0x00100000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
                    ["OCMC_RAM3",
                         {
                            name: "OCMC_RAM3",
                            base: 0x40500000,                    
                            len: 0x00100000,                    
                            space: "data",
                            access: "RWX",
                         }
                    ],
               ],
              l2Mode: "0k",
              l1PMode: "32k",
              l1DMode: "32k",

        });

    Please let me if I have missed out something.

    Thanks,

    Naveen Shetti

  • Hi Naveen,

    A few questions:
    -1- Are you loading the DSP application through CCS or the ARM core is loading the DSP app ?
    -2- Are you able to view the OCMC RAM memory through memory browser in CCS ? If not, it is likely the OCMC RAM's clock is not enabled.

    Best,
    Ashish

  • Hello Ashish,

    Sorry for the delay in response. The answer for your queries.

    -1- Are you loading the DSP application through CCS or the ARM core is loading the DSP app ?

    >> the ARM is loading the DSP through "remoteproc" driver.

     

    -2- Are you able to view the OCMC RAM memory through memory browser in CCS ? If not, it is likely the OCMC RAM's clock is not enabled.

    >> I am able to view the OCMC RAM memory through the memory browser in CCS. It's set to all 0's, if I try to edit/change the same in the memory browser then the change is not reflected.

     

    Please help !

    Thanks,

    Naveen Shetti

  • Hi Naveen,

    I am suspecting the OCMC RAM's clock is not enabled. Can you try enabling it from the A15 side before loading the app on DSP ?

    You can refer the PRCM enable code in the gel script for DRA7XX. The gel script can be found here in your CCS install:

    C:\ti\ccsv5\ccs_base\emulation\gel\DRA7xx\DRA7xx_prcm_config.gel

    And the particular function you want to look at is DRA7xx_PRCM_Module_AllEnable_Config(). There are 3 separate clock control registers for OCMC RAM 1, 2 and 3 that need to be set.

    Best,

    Ashish