Hi, I've just read the following article: http://wiki.davincidsp.com/index.php?title=CodecEngineCodeOverlays Basically it explains how to link a codec such that some of its code gets loaded into slow external memory, but the linker allocates room in fast memory and fools the rest of the program to think that the code is actually located in the fast memory section. The codec is responsible for copying the code from external to internal memory at the correct time, to prevent the wrong code from being called. Unfortunately, the article seems to skip mentioning the reason for actually doing this exercise, rather than simply link the code directly into fast memory in the first place: the ability to have *several* such pieces of code, all located at the same address, each being "swapped in" at the appropriate time. The article also doesn't explain how to do this, and here is where I'm stuck: I have two different codec packages supplied by a third-party developer. Both codecs support overlays, and are capable of performing the memory copy as described above. They both have an option which I may set in the XDC config file, "<alg_name>.alg.overlays = true". The problem is that when enabling overlays for both codecs, both codecs attempt to allocate their "run" addresses in the small section named L1PSRAM, and the linker fails because there is not enough room in L1PSRAM for both code sections, and - here's the important bit - there is nothing to tell the linker that the two run addresses should be overlaid. The only way to tell the linker to overlay two code sections into the same memory location is using the UNION keyword. Unfortunately, the linker command file auto-generated by XDC is divided into parts (each starting with a comment "Content from <package name>"). Each of these parts contain its own SECTIONS { .. } group, containing the code and data allocations relevant to that package. Obviously a UNION { .. } group cannot span two such parts. The only solution I have found so far is to manually modify the auto-generated linker command file, moving the two data sections into a single UNION with a shared run address. Once I did that, the project linked, and ran correctly (both codecs simultaneously) with a measurable performance increase. Unfortunately, this is no good as a permanent fix because the command file gets overwritten at each full build. Since the article I linked to above has no explanation of this, and the codec authors themselves do not currently know how to solve this problem short of repackaging the two codecs as a single package, I'd like to know if the community has answers to this question. Thanks, -itay -- Itay Chamiel Software Engineer Mango DSP itayc at mangodsp.com
_______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
