NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Codec Engine skelCachingPolicy

From Texas Instruments Wiki
Jump to: navigation, search

The Server.skelCachingPolicy feature was introduced in Codec Engine 2.25.02.

Introduction[edit]

For remote execution of codecs, the DSP server manages cache for I/O buffers exchanged between the codec (running on the DSP) and the ARM side app. The cache management is performed in the "skeleton" for the codec. The default cache management policy is for the skeleton to invalidate the input and output buffers from the DSP cache, before calling the codec's process() function. After returning from the process() function, the skeleton then performs a cache writeback of output buffers to ensure that CPU writes to the cache are flushed to external memory. Below is a section of code from the sphenc_skel.c illustrating the default caching policy:

<syntaxhighlight lang='c'> /* invalidate cache for all input buffers */ for (i = 0; i < inBufs.numBufs; i++) {

   Memory_cacheInv(inBufs.bufs[i], inBufs.bufSizes[i]);

}

/* invalidate cache for all output buffers */ for (i = 0; i < outBufs.numBufs; i++) {

   Memory_cacheInv(outBufs.bufs[i], outBufs.bufSizes[i]);

}

/* unmarshall outArgs based on the "size" of inArgs */ pOutArgs = (ISPHENC_OutArgs *)((UInt)(&(msg->cmd.process.inArgs)) +

       msg->cmd.process.inArgs.size);

/* make the process call */ msg->visa.status = SPHENC_process(handle,

       &inBufs, &outBufs, &(msg->cmd.process.inArgs), pOutArgs);

/* writeback the cache for all output buffers */ for (i = 0; i < outBufs.numBufs; i++) {

   Memory_cacheWb(outBufs.bufs[i], outBufs.bufSizes[i]);

} </syntaxhighlight>

The default cache management policy is conservative in that it guarantees correctness, but it does not necessarily give optimal performance. For example, if the buffer sizes are very large, the cost of performing the Memory_cacheInv() before processing and Memory_cacheWb() after processing, may be greater than performing a single Memory_cacheWbInvAll() after processing. However, to ensure correctness if the Memory_cacheInv() and Memory_cacheWb() calls are replaced with a single Memory_cacheWbInvAll(), the system must ensure that the following conditions are met:

  • The cache is clean before the first process() call
  • Input and output buffers are not touched by the local processor after the Memory_cacheWbInv() and before they are used in the next process() call.

The Server.skelCachingPolicy feature allows the system designer to choose one of the three cache management policies used by the skeletons:

  • The default policy, where Memory_cacheInv() is performed on input and output buffers before processing, and Memory_cacheWb() is performed on output buffers after processing.
  • The wbInvAll policy, where no cache operations are performed before processing, and Memory_cacheWBInvAll() is performed after processing.
  • No cache management is performed in the skeletons.

Configuration[edit]

The Server module has an new configuration parameter, skelCachingPolicy, which can be set to one of the following values:

  • LOCALBUFFERINVWB - The default policy that will be used if this configuration parameter is not set.
  • WBINVALL - Skeletons perform only Memory_cacheWbInvAll() after processing.
  • NONE - No cache management performed in skeletons

Here is an example configuration in a server's configuration file:

<syntaxhighlight lang='javascript'> var Server = xdc.useModule('ti.sdo.ce.Server'); Server.skelCachingPolicy = Server.WBINVALL; </syntaxhighlight>

See Also[edit]

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Codec Engine skelCachingPolicy here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Codec Engine skelCachingPolicy here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Codec Engine skelCachingPolicy here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Codec Engine skelCachingPolicy here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity