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.

Code placement in OMAPL138

Other Parts Discussed in Thread: OMAPL138

Hi,

In my OMAPL138 application, in DSP, I would like to place time- critical code to L2 and less critical to DDR. I have created a section to L2 and I can "manually" place single instances/functions and global variables there; what I have not managed to do is to put object's private data there.

What I would like to do is to forward full class instances, code and data, to certain section, statically. I'm using SYS/BIOS and it would also be good to put Hwi, and Swi -real-time parts to fast memory, if there is any executing code additional to my interrupt server. 

I would appreciate if an expert could assist me. 

Best Regards,

Risto

  • Risto,
    each module has a property common$, which specifies various parameters applicable to all modules (http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/Defaults.html#common$). The property common$.instanceSection defines the section where the static instances of a module are allocated. This is how you would configure a module Mod to allocate all its instances to a section that you already created, and that goes to L2:
    Mod.common$.instanceSection = ".goesToL2";
    You could use the module Default to specify that all static instances of all RTSC modules should be allocated to L2:
    Defaults.common$.instanceSection = ".goesToL2";
    Finally, if you never call create() for a module or all modules, you can set Mod.common$.memoryPolicy to STATIC_POLICY:
    Mod.common$.memoryPolicy = Types.STATIC_POLICY;
    which will prevent generation of create() or delete() functions for Mod. Again, to do that for all modules use Defaults.

    As for the code, if you check the generated map file you can notice that each RTSC function has its own section. You can allocate these sections to L2 using statements similar to these ones:
    Program.sectMap[".hwicode : {*(.text:*Hwi*)}"] = new Program.SectionSpec();
    Program.sectMap[".hwicode : {*(.text:*Hwi*)}"].loadSegment = "L2";

    These statements will allocate all input sections whose name matches the regular expression inside the braces to L2. You can do the same thing in your own linker command file, inside a SECTIONS directive:
    SECTIONS {
        ".hwicode : {*(.text:*Hwi*)}" > L2
    }

    The regular expression that I used here might be too general for your purposes. You can find out more about linker's processing of regular expressions in the linker documentation: www.ti.com/lit/pdf/spru186, Section 7.5.4 "The SECTIONS Directive".

  • Thank you,

    Sasha for your prompt reply - I will survive with this.

    Best Regards,

    Risto