This class provides a simple interface to drive the cache management unit of a simulator.
More...
#include <otawa/sim/CacheDriver.h>
This class provides a simple interface to drive the cache management unit of a simulator.
To implement a specialized driver, you have just to inherit from this class and override at least the access() function.
- Many specialized driver are already provided in OTAWA. First, the stateless always-hit / always-miss driver accessible by the static fields CacheDriver::ALWAYS_HIT and CacheDriver::ALWAYS_MISS. There is also an abstract driver with specialization for replacement and write policies, AbstractCacheDriver.
This enumeration identifies the kind of cache access.
Enumerator |
---|
READ |
A read is performed on the cache.
|
WRITE |
A write is performed on the cache.
|
This enumeration allows to know the result of a cache access.
Enumerator |
---|
MISS |
The result of a cache access produces a miss.
|
HIT |
The result of a cache access produces a hit.
|
otawa::sim::CacheDriver::~CacheDriver |
( |
void |
| ) |
|
|
virtual |
This function is called each time the cache is accessed.
It must be overload to specialize the cache behavior.
- Parameters
-
address | Address of the accessed data. |
size | Size of the accessed data. |
action | Action performed. |
- Returns
- HIT or MISS according presence of the block of data in the cache.
Implemented in otawa::sim::AbstractCacheDriver.
CacheDriver & otawa::sim::CacheDriver::ALWAYS_HIT = HIT_DRIVER |
|
static |
This cache driver specialization generates a hit each time it is accessed.
CacheDriver & otawa::sim::CacheDriver::ALWAYS_MISS = MISS_DRIVER |
|
static |
This cache driver specialization generates a miss each time it is accessed.
The documentation for this class was generated from the following files: