Otawa  0.10
otawa::sim::CacheDriver Class Referenceabstract

This class provides a simple interface to drive the cache management unit of a simulator. More...

#include <otawa/sim/CacheDriver.h>

Inheritance diagram for otawa::sim::CacheDriver:
otawa::sim::AbstractCacheDriver otawa::sim::DirectMappedCacheDriver otawa::sim::FIFOCacheDriver otawa::sim::LRUCacheDriver

Public Types

enum  result_t { MISS = 0, HIT = 1 }
 This enumeration allows to know the result of a cache access. More...
 
enum  action_t { READ, WRITE }
 This enumeration identifies the kind of cache access. More...
 

Public Member Functions

virtual ~CacheDriver (void)
 
virtual result_t access (address_t address, size_t size, action_t action)=0
 This function is called each time the cache is accessed. More...
 

Static Public Attributes

static CacheDriverALWAYS_HIT = HIT_DRIVER
 This cache driver specialization generates a hit each time it is accessed. More...
 
static CacheDriverALWAYS_MISS = MISS_DRIVER
 This cache driver specialization generates a miss each time it is accessed. More...
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

otawa::sim::CacheDriver::~CacheDriver ( void  )
virtual

Member Function Documentation

result_t otawa::sim::CacheDriver::access ( address_t  address,
size_t  size,
action_t  action 
)
pure virtual

This function is called each time the cache is accessed.

It must be overload to specialize the cache behavior.

Parameters
addressAddress of the accessed data.
sizeSize of the accessed data.
actionAction performed.
Returns
HIT or MISS according presence of the block of data in the cache.

Implemented in otawa::sim::AbstractCacheDriver.

Member Data Documentation

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: