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.

allocating specific buffers to IRAM

I am trying to benchmark data transfers between DDR and internal memory.

I am trying to get specific buffers in IRAM, but not getting anywhere.

 

 

If I declare a buffer of unsigned chars:

uint8_T mybuff[1000] = {0};

 

Looking at the .map file it shows that this has been placed in .far (Which is in DDR)

 

I added the following to my .cfg file

Program.sectMap[".far:_mybuff"] = new Program.SectionSpec();

Program.sectMap[".far:_mybuff"] = "IRAM";

 

II have tried various combinations (trying to also place code in different sections), but the .map file was not affected at all (except for the date).

 

In the .xdl file I get:

SECTIONS

{

    .text: load >> DDR3_RAM

    .stack: load > DDR3_RAM

    .bss: load > DDR3_RAM

    .cinit: load > DDR3_RAM

    .pinit: load > DDR3_RAM

    .const: load >> DDR3_RAM

    .data: load >> DDR3_RAM

    .switch: load >> DDR3_RAM

    .sysmem: load > DDR3_RAM

    .far: load >> DDR3_RAM

    .args: load > DDR3_RAM align = 0x4, fill = 0 {_argsize = 0x0; }

    .cio: load >> DDR3_RAM

    .far:_mybuff: load >> IRAM

    .vecs: load >> DDR3_RAM

    xdc.meta: load >> DDR3_RAM, type = COPY

 

}

 

So it is getting in this file, but is not affecting the memory location.

 Any help would be appreciated.

  • Do you see any .far:_mybuff sections in the link map file? If not, then it means that you did not actually place the array in a separate section using pragma DATA_SECTION. The Compiler Users Guide documents this pragma if you need further details. If you did make sure to place the array in its own section, you could specify an allocation similar to what you have shows above in the .cfg file.

    If you still have an issue, it would help if you could attach the linker command file (linker.cmd) generated by RTSC (should be in folder \Debug\configPkg within the project folder) and link map file so we could study them further.

  • Just a quick followup. I did a simple test using pragma DATA_SECTION to place myBuff in its own section:

    #pragma DATA_SECTION(mybuff, ".far:_mybuff");
    volatile unsigned char mybuff[1000] = {0};

    Then modified the .cfg file to place this section in IRAM:

    Program.sectMap[".far:_mybuff"] = new Program.SectionSpec();
    Program.sectMap[".far:_mybuff"] = "IRAM";

    This allocates the section to IRAM as expected. Here is the snippet from the link map file:

     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------


    .far:_mybuff
    *          0    10800000    000003e8     UNINITIALIZED
                      10800000    000003e8     stairstep.obj (.far:_mybuff)