LCEnable

Syntax

#include <revolution/os.h>

void LCEnable ( void );

Arguments

None.

Return Values

None.

Description

Enables the locked cache feature on the Broadway chip. The L1 data cache is partitioned into a 16 K 4-way set associative data cache and a 16 K locked cache partition. The location of the locked cache can be found by calling the LCGetBase function. The locked cache partition (referred to as locked cache) functions as a form of scratchpad memory.  Data can only be moved in and out of the locked cache via a DMA transaction.

Note: The locked cache is off by default at boot time. 

Enabling the locked cache is a fairly long process. The cache must be flushed entirely; because there is no simple full cache flush instruction, the LCEnable function touches and stores a 32 KB region at the bottom of the address space. Next, the locked cache must be enabled. The cache tags must then be allocated for the locked partition. Disabling the locked cache is not entirely free from cost because the locked partition must be invalidated. Therefore, you must weigh carefully the costs of enabling/disabling the locked cache and ensure that the benefits of using a full 32 KB L1 cache amortize the enable/disable costs.

Current measurements of the LCEnable function indicate that it will take between 15000 and 19510 cycles (25.0 to 32.5 microseconds), depending on how much invalid data is in the cache. This number is not the final figure. The total additional cost for the LCEnable/LCDisable function pair is between 17000 and 22000 cycles (28.3 to 36.7 microseconds). This cost is the total end-to-end time imposed if you enable and disable the locked cache on a per-frame basis. 

Note: The LCEnable function uses the DBAT3 pair to map in the addresses for the locked cache.

See Also

Cache Functions
LCDisable
LCIsEnable
LCGetBase
LCLoadData
LCLoadBlocks
LCStoreData
LCStoreBlocks

Revision History

2009/01/05 Added LCIsEnable to See Also.
2006/03/01 Initial version.


CONFIDENTIAL