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.

designating output memory locations with a Linker command file

I have a question about linker files and allocating object code to specific memory locations.  I found a post that had a similar question but was never fully answered:

http://e2e.ti.com/support/dsp/tms320c6000_floating-point_dsps/f/115/p/12423/48593.aspx#48593

My question is how can I tell the linker to put libraries or parts of libraries in a particular memory output section?  For example, I have tried this:

SECTIONS {
.text:
{
ti.pspiom.uart.a674(.text)
} > L3_CBA_RAM
}

or this

SECTIONS {
ti.pspiom.uart.a674 > L3_CBA_RAM
}

but they don't work.  Has anyone gotten this to work successfully?  There was some reference to spru186q in the above mentioned post, but I don't see a clear example in there of what I'm trying to do.  My goal is to be able to allocate some sections of libraries to L3 memory and other sections to L2.  Is this possible without needing to redefine allocations done by the DSP/BIOS generated cmd file?

thanks,

Mike



  • Hi Mike,

    Mike said:
    SECTIONS {
    .text:
    {
    ti.pspiom.uart.a674(.text)
    } > L3_CBA_RAM
    }

    Try instead:

    SECTIONS {
    .special:
    {
    ti.pspiom.uart.a674(.text)
    } > L3_CBA_RAM
    }

    Mike said:
    but they don't work.

    When you say they did not work, I'm assuming that you did not get any compilation errors, but looked at the map file and saw that the ti.pspiom.uart.a674 was not placed in the correct place. Am I right?

  • Mariana said:

    When you say they did not work, I'm assuming that you did not get any compilation errors, but looked at the map file and saw that the ti.pspiom.uart.a674 was not placed in the correct place. Am I right?

    Thanks Mariana!  Yes, by don't work I meant the build was successful but sections weren't placed in memory like I intended.

    Also, I guess there is nothing special about ".special"; I renamed it to ".uart_sect" and it worked the same.  What if I want the whole library put in L3? I tried to remove the (.text) and the linker didn't like this - it never finished the link process so I had to manual stop the build.  Do I have to list each section like this?

      .uart_sect: 
    {
    ti.pspiom.uart.a674(.text)
    ti.pspiom.uart.a674(.far)
    /* ... (more sections) */
    } > L3_CBA_RAM
    In general what sections of libraries should I place in slower L3? .const? .cinit? maybe not .bss? I'm trying to plan out the best use of L2/L3 for efficient program execution.

    thanks again,
    Mike
  •  

    Mike said:
    Also, I guess there is nothing special about ".special"; I renamed it to ".uart_sect" and it worked the same.

    That is true, just do not pick a name of an existing section.

    Mike said:
    I tried to remove the (.text) and the linker didn't like this

    Usually that is possible, I was able to do it with libraries with less complicated names... But I guess not even "" is making it work.

    Mike said:
    In general what sections of libraries should I place in slower L3? .const? .cinit? maybe not .bss? I'm trying to plan out the best use of L2/L3 for efficient program execution.

    That varies a lot according to your program. Please see page 121 of the:

    http://www-s.ti.com/sc/techlit/spru187

    I would say that your critical section, like the data (.bss, .far) and code section (.text), should be prioritized for fast memory, but to make sure that you do not loose much performance when putting things in the shared memory, you need to make sure to enable the MAR bits (cache) like described in this post:

    http://e2e.ti.com/support/dsp/tms320c6000_floating-point_dsps/f/115/p/38181/134077.aspx#134077

    http://tiexpressdsp.com/index.php/Enabling_64x%2B_Cache

    I think most of what you need is on section 7.8 of the:

    http://www-s.ti.com/sc/techlit/spru186