#include <CACHE.hpp>
Collaboration diagram for CACHE:

Public Member Functions | |
| void | clearStatistics () |
| Resets all counters. | |
| const STATUS & | getStatus () |
| 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 | |
| CACHE * | getInstance () |
| 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_COLLECTION * | getCacheLines (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. | |
|
|
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) |
|
||||||||||||
|
Detects a cache hit or miss. Does not update statistics! |
1.3.9.1