TEMU
4.4
The Terma Emulator
|
#include </builds/termade/temu/temu/include/temu-c/Memory/Cache.h>
Data Fields | |
void(* | enable )(void *Obj) |
Enable cache. More... | |
void(* | disable )(void *Obj) |
Disable cache. More... | |
void(* | freeze )(void *Obj) |
Freeze cache. More... | |
void(* | lockLine )(void *Obj, uint64_t Addr) |
Lock line for addr. More... | |
void(* | unlockLine )(void *Obj, uint64_t Addr) |
Unlock line. More... | |
void(* | invalidateAll )(void *Obj) |
Invalidate entire cache. More... | |
void(* | invalidateLine )(void *Obj, uint64_t Addr) |
Invalidate single line. More... | |
void(* | evictAll )(void *Obj) |
Evict all (i.e. spill to memory) More... | |
void(* | evictLine )(void *Obj, uint64_t Addr) |
Evict line. More... | |
uint32_t(* | getReplacementPolicy )(void *Obj) |
uint32_t(* | getSets )(void *Obj) |
Get number of sets. More... | |
uint32_t(* | getWays )(void *Obj) |
Get number of ways. More... | |
uint32_t(* | getLineSize )(void *Obj) |
Get line size in bytes. More... | |
int(* | isValid )(void *Obj, uint64_t Addr) |
Check if an address belong to a cached line. More... | |
uint64_t(* | readFlags )(void *Obj, uint64_t Addr) |
void(* | writeFlags )(void *Obj, uint64_t Addr, uint64_t Flags) |
Write flags data. More... | |
uint64_t(* | readData )(void *Obj, uint64_t Addr) |
int(* | writeData )(void *Obj, uint64_t Addr, uint64_t Data) |
Write data in cache. More... | |
Caches implement the memory access interface and the cache control interface. For invalidate and evict operation the address given is a physical address which should be mapped to a line. For Harward style caches, the cache model would typically implement the interface twice, once for instructions and once for data. Invalidation: cache line will be tagged as invalid (i.e. flushed) Eviction: cache line will be invalidated and in writeBack caches the content will be written back to memory.
void(* temu_CacheIface::disable) (void *Obj) |
Disable cache.
void(* temu_CacheIface::enable) (void *Obj) |
Enable cache.
void(* temu_CacheIface::evictAll) (void *Obj) |
Evict all (i.e. spill to memory)
void(* temu_CacheIface::evictLine) (void *Obj, uint64_t Addr) |
Evict line.
void(* temu_CacheIface::freeze) (void *Obj) |
Freeze cache.
uint32_t(* temu_CacheIface::getLineSize) (void *Obj) |
Get line size in bytes.
uint32_t(* temu_CacheIface::getReplacementPolicy) (void *Obj) |
Interrogation of cache properties
uint32_t(* temu_CacheIface::getSets) (void *Obj) |
Get number of sets.
uint32_t(* temu_CacheIface::getWays) (void *Obj) |
Get number of ways.
void(* temu_CacheIface::invalidateAll) (void *Obj) |
Invalidate entire cache.
void(* temu_CacheIface::invalidateLine) (void *Obj, uint64_t Addr) |
Invalidate single line.
int(* temu_CacheIface::isValid) (void *Obj, uint64_t Addr) |
Check if an address belong to a cached line.
void(* temu_CacheIface::lockLine) (void *Obj, uint64_t Addr) |
Lock line for addr.
uint64_t(* temu_CacheIface::readData) (void *Obj, uint64_t Addr) |
Get cached data for the given address. The data returned comes from RAM using a normal memory transaction in case the cache is modelled for timing only, otherwise it comes from the cache model. Addr is a cache local address space, which depends on the cache implementation. The functions are intended for diagnostic cache access which is implemented in some systems. Note that on writes, the data will NOT be written to memory except in the case the cache line would be evicted in an accurate cache model. All reads from valid addresses succeed, other addresses are undefined. writeData returns non-zero on failure (e.g. invalid address).
uint64_t(* temu_CacheIface::readFlags) (void *Obj, uint64_t Addr) |
Access the flags data, the format is cache model specific and can for specific models include also the tag. Typically, this is used for diagnostic access for more accurate cache models. Note that addr is not a physical address, but rather an address interpreted differently for different caches. I.e. the address is in a cache local address space.
void(* temu_CacheIface::unlockLine) (void *Obj, uint64_t Addr) |
Unlock line.
int(* temu_CacheIface::writeData) (void *Obj, uint64_t Addr, uint64_t Data) |
Write data in cache.
void(* temu_CacheIface::writeFlags) (void *Obj, uint64_t Addr, uint64_t Flags) |
Write flags data.