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.

Compiler/TMS320C6412: Linker Optimization: L2 Cache memory size reached - methods to optimize

Part Number: TMS320C6412

Tool/software: TI C/C++ Compiler

Hello,

Continuing from my thread outlining upgrading from BIOS v5.31.02 to BIOS v5.42.02.10, as per the note on the DSP/BIOS 5.42.02.10 GA Release Notes release notes: "However users *must* rebuild their configuration since the generated linker .cmd file (<prog>cfg.cmd) is different."

I'm getting the following error (a few times over), which in hindsight, I should have expected:

"/BIOS/Dspcfg.cmd", line 294: error: program will not
   fit into available memory.  placement with alignment fails for section
   ".log" size 0x18 .  Available memory ranges:
   ISRAM        size: 0x40000      unused: 0x1c         max hole: 0x10      

As I said in the original thread, I want to avoid changing the code itself and with the original BIOS version, I had only approx 0x2000 free on the IRAM. If I lower the bios.ISRAM.len from 0x40000 to 0x39900 using my original configuration, I get these error messages too. Space-wise, I don't have a lot of wiggle room. And it seems like this new BIOS requires a bit more space.

My question: is there anything on the BIOS side, or compile options that may help me optimize? (I know this is a vague question). I've been looking into breaking up the section .text, (which occupies 0x22400), in the hopes that the linker will be better able to optimize without dealing with this one massive chunk. Would this be a good approach? Does anyone have an alternative idea?

Thanks,

Amanda

(PS: This may require a separate thread, but are there any inherent risks with filling the L2 Cache so completely? Could this result in weird behavior?)

  • Can you provide more details on the overall memory available? Do you have SDRAM on your board, or does everything need to fit in internal memory? There are compiler options that relate to optimizing for size vs speed. You could potentially look into using those. Before you go down that route however I'd like to understand your available memory and how things are currently allocated. For example, I would want to be sure that you don't have a section like .cinit allocated to internal memory since that gets used only one time at startup.
  • Sure. There is SDRAM available and that is used. I know that the two cache buffers need to be on the internal memory, but apart from that, I think I have some flexibility. I have included some data from the .map file of the version built using the old BIOS. I don't have up-to-date data here since I'm getting compile errors. However, the code itself hasn't been modified and I think it should still provide useful information. I have modified this data for conciseness and removed a lot of the memory configurations for SDRAM sections.

    As a starting point, it does look like .cinit is on the internal memory - I'll start looking into how to go about putting it on SDRAM instead.

    Can you recommend a document to learn the purpose of each of these sections? For instance, I didn't know that .cinit is only used once.

    ******************************************************************************
              TMS320C6x COFF Linker PC v6.0.8
    ******************************************************************************
    ENTRY POINT SYMBOL: "_c_int00"  address: 0003cd80

    MEMORY CONFIGURATION

             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      ISRAM                 00000000   00040000  0003d7f7  00002809  RWIX
      SDRAM                 80000000   02000000  01722a70  008dd590  RWIX


    SECTION ALLOCATION MAP

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

    .tiMessMailboxArea
    *          0    8156df80    000aa41c     UNINITIALIZED

    .tiMessMailboxBuff
    *          0    816b8840    00031000     UNINITIALIZED

    .tiMessBuffers
    *          0    816e9840    0002088c     UNINITIALIZED

    .tiMessIsibQueue
    *          0    817221d8    00000800     UNINITIALIZED

    .tiMessIsibArea
    *          0    817229d8    000000a0     UNINITIALIZED

    .cio       0    00000000    00000000     UNINITIALIZED
    .data      0    00000000    00000000     UNINITIALIZED
    .dsm       0    00000000    00000000     UNINITIALIZED
    .gio       0    00000000    00000000     UNINITIALIZED
    .hst       0    00000000    00000000     UNINITIALIZED
    .hwi       0    00000000    00000000     UNINITIALIZED
    .mem       0    00000000    00000000     UNINITIALIZED
    .pip       0    00000000    00000000     UNINITIALIZED
    .sysdata   0    00000000    00000000     UNINITIALIZED
    .sysregs   0    00000000    00000000     UNINITIALIZED
    frt        0    00000000    00000000     UNINITIALIZED

    .hwi_vec   0    00000000    00000200
    .text      0    00000200    00022400
    .far       0    00022600    000096c4     UNINITIALIZED
    .log       0    0002bcc4    00000018
    .args      0    0002bcdc    00000004
    .bios      0    0002bce0    00003dc0
    .cacheBuffer0
    *          0    0002faa0    00003000     UNINITIALIZED

    .cacheBuffer1
    *          0    00032aa0    00003000     UNINITIALIZED

    .const     0    00035aa0    00002c71
    .cinit     0    00038718    000021cc
    .stack     0    0003a8e8    00001000     UNINITIALIZED
    .swi       0    0003b8e8    00000630     UNINITIALIZED
    .bss       0    0003bf18    00000402     UNINITIALIZED
    .TSK_idle$stk
    *          0    0003c320    00000400     UNINITIALIZED

    .dispersionProcessing$stk
    *          0    0003c720    00000400     UNINITIALIZED

    .sysinit   0    0003cb20    000003a0
    .sts       0    0003cec0    00000260
    .trace     0    0003d120    00000200
    .tsk       0    0003d320    000000c0     UNINITIALIZED
    .pinit     0    0003d3e0    00000014
    .clk       0    0003d3f4    0000000c     UNINITIALIZED
    .LOG_system$buf
    *          0    0003d400    00000100     UNINITIALIZED

    .switch    0    0003d500    000001bc

    .tiMessPsibArea
    *          0    0003d6c0    00000080     UNINITIALIZED
    .prd       0    0003d740    00000040     UNINITIALIZED
    .gblinit   0    0003d780    00000034
    .sem       0    0003d7b4    0000002c     UNINITIALIZED
    .idl       0    0003d7e0    00000010     UNINITIALIZED
    .sys       0    0003d7f0    00000010     UNINITIALIZED
    .trcdata   0    0003d800    0000000c


  • Amanda said:
    Can you recommend a document to learn the purpose of each of these sections?

    See section 5.3.5 of the Compiler Guide.

    I'm not sure what the action is for this thread right now.  In short, your error related to running out of space in internal memory and so you need to do a little shifting of your allocations to get everything to fit again.

  • Hi Amanda -- were you able to work through your issue? Will you please update this thread on the current status?