Cache Management

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

What Should I know about Cache Coherence?

The following are common customer issues in DaVinci and OMAP environments, though they're present in any multi-core system which utilizes cache.

General Conventions

Input Buffers (application captures/generates the buffer and passes it to the algorithm)

Output buffers (algorithm processes the input buffers and generates output buffers for the application)

Input/Output Buffers (application and/or algorithm can read and/or write to the buffer)

DMA-Related

If the GPP or DSP uses DMA to access the shared buffers, then there is more work to ensure coherence. XDAIS provides some Rules for frameworks: DMA Rules 6, 7 and 8. (See: http://www-s.ti.com/sc/techlit/spru352)

Note that: if these alignment and size constraints are violated, then any data object allocated adjacent to the the application buffer will be sharing a cache line with a portion of the app-buffer. This has the potential to corrupt the portion of the app buffer residing in the shared cache-line. Corruption may happen as a side-effect of Cache Controller writing back the shared cache line to evict it while it was dirty due to (valid) CPU write accesses to the non-app-buffer data objects. This would be a very nasty bug to track!

Common Cache errors

Finally, for completeness, a common error frameworks employ when dealing with cache coherence issues is when:

Also please note that the DSP-side L2 Cache line size on DM644x is 128-bytes.

Codec Engine Cache Maintenance

There are some details described above for how some parts of Codec Engine (specifically, the VISA Server-side skeletons) manage cache. This section consolidates some of that information and presents it for the Codec Engine user.

Codec Engine's only cache management is done in the Server-side skeletons - that is, on the remote processor, when managing data buffers for remote algorithms. Codec Engine never manages the cache for application side buffers and/or local algorithms; this is always the responsibility of the application. See the sections above for some reasons why generic frameworks can't do this right in all cases.

In Codec Engine environments, the following general, HW-agnostic statement can be made:

The application must manage the application-side processor's cache for any data buffers that are cached to the application processor.

Historically, the ARM-side data buffers (typically acquired from CMEM or video drivers) are not cached to the application processor, so the applications didn't have to manage it. This general lack of app exposure to cache details is why it's commonly mis-perceived that "Codec Engine handles cache". This is a mis-perception, CE doesn't, in general, handle cache for the application. However, CE will take care of the cache if these data buffers end up being given to remote algs.

See Also

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox