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.

Get Platform information through the CFG

Hello everyone

(target C6678, CCS 5.5, BIOS 1.25, XDCTools 3.25)

My question is :

in the .cfg is it possible to get the platform (for example ti.platforms.evmc6678) memory map ?

I'd like to retrieve this kind of information " L2SRAM @ 0x00800000 length 0x80000"

Thank you
Regards
Clement

  • Clement,
    here is the code that will print all objects in the memory map. You can easily adapt it to your needs.

    for (var prop in Program.cpu.memoryMap) {
        print("    " + Program.cpu.memoryMap[prop].name
            + ", 0x" + Program.cpu.memoryMap[prop].base.toString(16)
            + ", 0x" + Program.cpu.memoryMap[prop].len.toString(16));

  • Sasha,

    Thank you it works :)

    For others reading this :

    the properties of "memoryMap" are found in xdc/platform/IPlatform.xdc

    Just a piece of feedback : it'd be great if such thing would be documented in a wiki or something.

    Clement

  • For the record : example how to use it.

    I'm setting up a sharedregion like below and for the base address I want to use one from my custom platform.

    SharedRegion.setEntryMeta(0,
        { base: baseaddr,
          len:  0x10000,
          ownerProcId: 0,
          isValid: true,
          cacheEnable: true,
          cacheLineSize: 64,
          createHeap: true,
          name: "SHAREDREGION",
        });

    Solution :

    var baseaddr = Program.cpu.memoryMap[0].base;

    and it works

    Clement

  • Hi Clement,

    If you try this

    http://www.w3schools.com/jsref/jsref_parseint.asp

    and use a decimal number, instead of a hex, will it work?

    And I have a question for you, how can I see what's printed by

    print("    " + Program.cpu.memoryMap[prop].name.... ?

    Regards

    J

  • Johannes,

    I edited my previous post, I found out what my error was (I had a mistake on how I used created 'var')

    Program.cpu.memoryMap[prop].base is the decimal number (converted from the hexadecimal)

    Program.cpu.memoryMap[prop].base.toString(16) is the string in hex format

    print("    " + Program.cpu.memoryMap[prop].name.... ?

    is printed in the CCS console when you build the project.

    Clement

  • Oh, yeah. I should've noted that.

    Thanks

    J