const Cache_PC |
|
Permit Caching
#define Cache_PC (UInt32)1
const Cache_PCX |
|
Permit caching in external cache
#define Cache_PCX (UInt32)4
const Cache_PFX |
|
Prefetchable by external engines
#define Cache_PFX (UInt32)8
const Cache_WTE |
|
Write through enabled
#define Cache_WTE (UInt32)2
enum Cache_L1Size |
|
Level 1 cache size type definition. Can be used for both L1D & L1P
typedef enum Cache_L1Size {
Cache_L1Size_0K,
// Amount of cache is 0K, Amount of SRAM is 32K
Cache_L1Size_4K,
// Amount of cache is 4K, Amount of SRAM is 28K
Cache_L1Size_8K,
// Amount of cache is 8K, Amount of SRAM is 24K
Cache_L1Size_16K,
// Amount of cache is 16K, Amount of SRAM is 16K
Cache_L1Size_32K
// Amount of cache is 32K, Amount of SRAM is 0K
} Cache_L1Size;
enum Cache_L2Size |
|
Level 2 cache size type definition
typedef enum Cache_L2Size {
Cache_L2Size_0K,
// L2 is all SRAM
Cache_L2Size_32K,
// Amount of cache is 32K
Cache_L2Size_64K,
// Amount of cache is 64K
Cache_L2Size_128K,
// Amount of cache is 128K
Cache_L2Size_256K,
// Amount of cache is 256K
Cache_L2Size_512K,
// Amount of cache is 512K
Cache_L2Size_1024K
// Amount of cache is 1024K
} Cache_L2Size;
enum Cache_Mode |
|
Lists of cache modes for L1/L2 caches
typedef enum Cache_Mode {
Cache_Mode_FREEZE,
// No new cache lines are allocated
Cache_Mode_BYPASS,
// All access result in long-distance access
Cache_Mode_NORMAL
// Normal operation of cache
} Cache_Mode;
enum Cache_Type |
|
Lists of bitmask cache types
typedef enum Cache_Type {
Cache_Type_L1P,
// Level 1 Program cache
Cache_Type_L1D,
// Level 1 Data cache
Cache_Type_L1,
// Level 1 caches
Cache_Type_L2P,
// Level 2 Program cache
Cache_Type_L2D,
// Level 2 Data cache
Cache_Type_L2,
// Level 2 caches
Cache_Type_ALLP,
// All Program caches
Cache_Type_ALLD,
// All Data caches
Cache_Type_ALL
// All caches
} Cache_Type;
struct Cache_Size |
|
Structure for specifying all cache sizes
typedef struct Cache_Size {
// L1 Program cache size
// L1 Data data size
// L2 cache size
} Cache_Size;
config Cache_enableCache // module-wide |
|
Enable supported caches during startup
extern const Bool Cache_enableCache;
DETAILS
Not implemented by all architectures. Refer to specific
architecture Cache module for details.
Cache_disable() // module-wide |
|
Disables the 'type' cache(s)
Void Cache_disable(Bits16 type);
ARGUMENTS
type
bit mask of Cache type
DETAILS
Disabling of L2 cache is currently not supported.
Cache_enable() // module-wide |
|
Enables all cache(s)
Void Cache_enable(Bits16 type);
ARGUMENTS
type
bit mask of Cache type
Cache_getL1DCFG() // module-wide |
|
Cache_getL2CFG() // module-wide |
|
Cache_getSize() // module-wide |
|
Get sizes of all caches
ARGUMENTS
size
pointer to structure of type Cache_Size
Cache_inv() // module-wide |
|
Invalidate the range of memory within the specified starting
address and byte count. The range of addresses operated on
gets quantized to whole cache lines in each cache. All lines
in range are invalidated for all the 'type' caches
Void Cache_inv(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait);
ARGUMENTS
blockPtr
start address of range to be invalidated
byteCnt
number of bytes to be invalidated
type
bit mask of Cache type
wait
wait until the operation is completed
Cache_setL1DCFG() // module-wide |
|
Void Cache_setL1DCFG(UInt size);
Cache_setL1DWB() // module-wide |
|
Void Cache_setL1DWB(UInt flag);
Cache_setL1DWBINV() // module-wide |
|
Void Cache_setL1DWBINV(UInt flag);
Cache_setL2CFG() // module-wide |
|
Void Cache_setL2CFG(UInt size);
Cache_setL2WB() // module-wide |
|
Void Cache_setL2WB(UInt flag);
Cache_setL2WBINV() // module-wide |
|
Void Cache_setL2WBINV(UInt flag);
Cache_setSize() // module-wide |
|
Set sizes of all caches
ARGUMENTS
size
pointer to structure of type Cache_Size
Cache_wait() // module-wide |
|
Wait for a previous cache operation to complete
DETAILS
Wait for the cache wb/wbInv/inv operation to complete. A cache
operation is not truly complete until it has worked its way
through all buffering and all memory writes have landed in the
source memory.
Cache_wb() // module-wide |
|
Writes back a range of memory from all cache(s)
Void Cache_wb(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait);
ARGUMENTS
blockPtr
start address of range to be invalidated
byteCnt
number of bytes to be invalidated
type
bit mask of Cache type
wait
wait until the operation is completed
DETAILS
Writes back the range of memory within the specified starting
address and byte count. The range of addresses operated on
gets quantized to whole cache lines in each cache. All lines
within the range are left valid in the 'type' caches and the data
within the range will be written back to the source memory.
Cache_wbAll() // module-wide |
|
Write back all caches
DETAILS
Perform a global write back. There is no effect on program cache.
All data cache lines are left valid.
Perform a global write back. There is no effect on L1P cache.
All cache lines are left valid in L1D cache and dirty lines in L1D cache
are written back to L2 or external. All cache lines are left valid in
L2 cache and dirty lines in L2 cache are written back to external.
This function does not wait for write back operation to perculate
through the whole memory system before returing. Call Cache_wait(),
after this function if necessary.
Cache_wbInv() // module-wide |
|
Writes back and invalidates the range of memory within the
specified starting address and byte count. The range of
addresses operated on gets quantized to whole cache lines in
each cache. All lines within the range are written back to the
source memory and then invalidated for all 'type' caches
Void Cache_wbInv(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait);
ARGUMENTS
blockPtr
start address of range to be invalidated
byteCnt
number of bytes to be invalidated
type
bit mask of Cache type
wait
wait until the operation is completed
Cache_wbInvAll() // module-wide |
|
Write back invalidate all caches
DETAILS
Performs a global write back and invalidate. All cache lines
are written out to physical memory and then invalidated.
Performs a global write back and invalidate. All cache lines are
invalidated in L1P cache. All dirty cache lines are written back to L2
or external and then invalidated in L1D cache. All dirty cache lines
are written back to external and then invalidated in L2 cache.
This function does not wait for write back operation to perculate
through the whole memory system before returing. Call Cache_wait(),
after this function if necessary.
Cache_wbInvL1dAll() // module-wide |
|
Write back invalidate L1D cache
Void Cache_wbInvL1dAll();
DETAILS
Performs a global write back and invalidate of L1D cache.
All dirty cache lines are written back to L2 or
external and then invalidated in L1D cache.
This function does not wait for write back operation to perculate
through the whole memory system before returing. Call Cache_wait(),
after this function if necessary.
Cache_wbL1dAll() // module-wide |
|
Write back L1D cache
DETAILS
Perform a global write back of L1D cache. There is no effect on L1P
or L2 cache. All cache lines are left valid in L1D cache and the
dirty lines in L1D cache are written back to L2 or external.
This function does not wait for write back operation to perculate
through the whole memory system before returing. Call Cache_wait(),
after this function if necessary.
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool Cache_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Cache_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 Cache_Module_getMask();
// Returns the diagnostics mask for this module
Void Cache_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module