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.

[K2G] 512KB of L2 Memory not existing ?



Hi,

I noticed your PDK example code (for example, GPIO_LedBlink_evmK2G_armExampleProject) for ARM side (CortexA15) did not define 512KB of L2 Memory in RTSC platform (ti.platforms.evmTCI66AK2G02). Please note I'm using pdk_k2g_1_0_2 with bios_6_45_01_29 package. Actually, the platform comes from bios package (C:\ti\bios_6_45_01_29\packages\ti\platforms\evmTCI66AK2G02\Platform.xdc) and that looks below:

metaonly module Platform inherits xdc.platform.IPlatform
{
    readonly config xdc.platform.IPlatform.Board BOARD = {      
        id:             "0",
        boardName:      "evmTCI66AK2G02",
        boardFamily:    "evmTCI66AK2G02",
        boardRevision:  null,
    };

    /* DSP */   
    readonly config xdc.platform.IExeContext.Cpu DSP = {        
        id:             "0",
        clockRate:      1220,
        catalogName:    "ti.catalog.c6000",
        deviceName:     "TCI66AK2G02",
        revision:       "1.0",
    };

    /* GPP */
    readonly config xdc.platform.IExeContext.Cpu GPP = {
        id:             "1",
        clockRate:      1000.0,  /* Typically set by the HLOS */
        catalogName:    "ti.catalog.arm.cortexa15",
        deviceName:     "TCI66AK2G02",
        revision:       "1.0"
    };
    
instance:

    override readonly config xdc.platform.IPlatform.Memory
        externalMemoryMap[string] = [
            ["DDR3", {name: "DDR3", base: 0x80000000, len: 0x80000000}],
    ];

    /*
     *  ======== l1PMode ========
     *  Define the amount of L1P RAM used for L1 Program Cache.
     *
     *  Check the device documentation for valid values.
     */
    config String l1PMode = "32k";
    
    /*
     *  ======== l1DMode ========
     *  Define the amount of L1D RAM used for L1 Data Cache.
     *
     *  Check the device documentation for valid values.
     */
    config String l1DMode = "32k";
    
    /*
     *  ======== l2Mode ========
     *  Define the amount of L2 RAM used for L2 Cache.
     *
     *  Check the device documentation for valid values.
     */
    config String l2Mode = "0k";

};

This defines DDR3 only and other internal memory definitions are coming from ti/catalog/arm/cortexa15/TCI66AK2G02.xdc, but that defines NOTHING. I also could not find memory map for 512KB of L2 Memory for CortexA15 in the datasheet / TRM.  I'm wondering if 512KB of L2 memory is really present on K2G platform....

Best Regards,
Naoki

  • Hi Naoki,

    I've notified the team. They should respond here soon.

    Best Regards,
    Yordan
  • Naoki,

    Please refer to the A15 core documentation for the L2 controller:
    infocenter.arm.com/.../index.jsp

    note that unlike DSP(GEM) core, the A15 L2 is integrated in the MPcluster as per ARM documentation and the base address is not specified to the end user. Enabling cache will enable all of L1 and L2 for cache operations and the cache coherency for these memories is internally managed by the A15 architecture. Also note, the L2 memory on the A15 is usually configured as Cache and isn`t divided as data and cache like on DSP cores.

    Regards,
    Rahul
  • Hi Rahhul,

    Ok, thank you for the clarifications. I had miss understanding about L2 memory.

    So how about MSMC SRAM ? That should be regarded as a memory-mapped shared  SRAM on SoC. To me, the definition of MSMCSRAM should be in something xdc script.

    The following the script (Mmu.xs) for MMU and it statically configures MMU according to existing memory in Program.cpu.memoryMap.

        /* Make a 1-to-1 mapping of virtual to physical address for memory map */
        var map = Program.cpu.memoryMap;
        for (var i=0; i < map.length; i++) {
            /* Get base address and length and unsigned right shift to get index */
            var start = map[i].base >>> LEVEL2_BLOCK_DESC_SHIFT;
            var end = (map[i].base + map[i].len - 1) >>> LEVEL2_BLOCK_DESC_SHIFT;
            var index = start;
            var attrs = new Mmu.DescriptorAttrs();
    
            initDescAttrsMeta(attrs);
            attrs.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
            attrs.accPerm = 0;                        // access permissions
            attrs.attrIndx = 2;                       // MAIR0 Byte 1 defines
                                                      // memory region attributes
            attrs.shareable = 3;                      // inner-sharerable
    
            do {
                /* only set if table descriptor has not been set */
                if ((Mmu.secondLevelTableBuf[index >>> 9][2*(index & 0x1FF)] ==
                            undefined) &&
                    (Mmu.secondLevelTableBuf[index >>> 9][2*(index & 0x1FF)+1] ==
                            undefined)) {
    
                    if (Mmu.cachePlatformMemory == true) {
                        setSecondLevelDescMeta(
                                convertToUInt32(index << LEVEL2_BLOCK_DESC_SHIFT),
                                convertToUInt32(index << LEVEL2_BLOCK_DESC_SHIFT),
                                attrs);
                    }
                    else {
                        setSecondLevelDescMeta(
                                convertToUInt32(index << LEVEL2_BLOCK_DESC_SHIFT),
                                convertToUInt32(index << LEVEL2_BLOCK_DESC_SHIFT),
                                Mmu.defaultAttrs);
                    }
                }
                index++;
            } while (index <= end);
        }
    
     

    Because there is no definition of MSMCSRAM in Program.cpu.memoryMap by default, exceptions can happen when accessing MSMCRAM.

    Best Regards,
    Naoki

  • typically, TI RTOS will not configure and use Shared memory on the SOC unless explicitly specified by the application developer. The simplest way of using MSMC would be to add a secondary linker command file in the project with the correct section definitions. Please refer to this FAQ TI RTOS question regarding adding more memory sections.
    processors.wiki.ti.com/.../BIOS_FAQs

    Regards,
    Rahul

    As a application developer you can also create your own custom platform using the tool described in the section 10.9 in the training slides here:

     

  • Hi Rahul,

    Yes, i know your points. In fact, I've already defined my own RTSC platform for ARM side because no memory defined except for DDR3. But for DSP side, some internal definitions including MSMC are defined by default . I feel a contradiction at this point.

    If you open ti.platforms.evmTCI66AK2G02 for DSP side, you will see the following setup. As you see MSMC has been defined by default.

    And if you open ti.platforms.evmTCI66AK2G02 for ARM side, there is no definitions for internal memory.

    You say internal shared memory would not be defined typically, but I feel defining all available internal memories would be more appropriate guideline in RTSC point of view.

    Anyway, I have no question about L2 memory now. Please input MSMC stuff to your internal team and if required, please consider the fix in the future release. I close the thread now.

    Best Regards,
    Naoki