SWRZ150A December 2024 – October 2025 AWR2544
L2 Cache Corruption during block and global coherence operations issue
AWR2544
Under a specific set of circumstances, L1D or L2 block and global coherence operations can cause L2 cache corruption. The problem arises when the following four actions happen back-to-back in the same L2 set:
This issue applies to all the block and global coherence operations EXCEPT:
See also: Advisory 63 - Potential L2 Cache Corruption During Block Coherence Operations Issue
Generic Workaround:
The workarounds below are very generic and may have performance impacts. Customers are requested to understand the application and see which one suits them better.
Workaround #1:
This workaround requires that the memory system be idle during the block and global coherence operations. Hence programs must wait for block and global coherence operations to complete before continuing. This applies to L1D and L2 memory block and global coherence operations.
To issue a block coherence operation, follow the sequence below:
Disable interrupts.
Write the starting address to the corresponding BAR register.
Write the word count to the corresponding WC register
Wait for completion by one of the following methods:
Issue an MFENCE instruction (preferred)
Poll the WC register until the word count field reads as 0
Perform 16 NOPs
Restore interrupts
To issue a global coherence operation, follow the sequence below:
Disable interrupts.
Write 1 to the corresponding global coherence register (L1DINV, L1DWBINV, L2DINV, and L2DWBINV)
Wait for completion by one of the following methods
Issue an MFENCE instruction (preferred)
Poll the corresponding global coherence register (L1DINV, L1DWBINV, L2DINV, and L2DWBINV) until the bit [0] field reads as 0
Perform 16 NOPs
Restore interrupts
Workaround #2:
This workaround is also generic, but will allow CPU traffic to go on in parallel with cache coherence operations. To issue a block coherence operation, follow the sequence below:
Issue a MFENCE command.
Freeze L1D cache
Start L1D WBINV
Restart CPU traffic (CPU operations happen in parallel with WBINV and do not need to wait for cache coherency operation to complete)
Poll the WC register until the word count field reads as 0.
WBINV completes when word count field reads 0
Issue an MFENCE command.
Unfreeze L1D cache.
For more information about the cache control registers (BAR, WC, L1DINV, L1DWBINV, L2DINV, and L2DWBINV) see the TMS320C66x DSP CorePac User Guide (SPRUGW0). The MFENCE instruction is new to the C66x DSP. It stalls the DSP until all outstanding memory operations complete. For further information about the MFENCE instruction, see the C66x DSP and Instruction Set Reference Guide (SPRUGH7).