Main Page | Class List | File List | Class Members

CACHE Class Reference

The cache simulator main class. More...

#include <CACHE.hpp>

Collaboration diagram for CACHE:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void clearStatistics ()
 Resets all counters.
const STATUSgetStatus ()
 Returns the current cache status.
 CACHE (unsigned long int l, unsigned long int s, unsigned long int k)
 Main constructor.
bool hitOrMiss (void *pointer, unsigned long int size)
 Detects a cache hit or miss.
void access (void *pointer, const unsigned long int size, unsigned long int &FAC)
 Simulates a read.
std::string properties ()
 Prints cache properties to output string.
void clear ()
 Clears all cache contents.

Static Public Member Functions

CACHEgetInstance ()
 Returns the singleton cache.
void createInstance (unsigned long int l, unsigned long int s, unsigned long int k)
 Creates an instance with specific cache parameters.
void recreateInstance (unsigned long int l, unsigned long int s, unsigned long int k)
 Deletes the current cache instance and creates a new one with the given cache parameters.

Protected Member Functions

CACHE_SET_COLLECTIONgetCacheLines (unsigned long int setID)
 Internal function which get the cache set collection corresponding to a given pointer.

Protected Attributes

unsigned long int REINIT
 Reinitialisation counter.
unsigned long int _l
 Total number of cache lines.
unsigned long int _s
 Total cache size.
unsigned long int _k
 Number of subcaches.
unsigned long int _sdl
 Caches _s / _l (cache line size LS).
unsigned long int _ldk
 Caches _l / _k (number of cache lines per subcache).
CACHE_SET_COLLECTION ** _csccollections
 The _l / _k different cache set collections.
STATUS _status
 Keeps track of cache statistics.

Detailed Description

The cache simulator main class.


Member Function Documentation

CACHE * CACHE::getInstance  )  [static]
 

Returns the singleton cache.

If not already initialised, the singleton will be set to the default cache with parameters: l=2^{26} s=2^{32} k=2^4 (Corresponding to an Intel Core 2 4MB L2 cache)

bool CACHE::hitOrMiss void *  pointer,
unsigned long int  size
 

Detects a cache hit or miss.

Does not update statistics!


The documentation for this class was generated from the following files:
Generated on Fri Aug 15 18:12:23 2008 for Run-timeCacheSimulator by  doxygen 1.3.9.1