Otawa  0.10
otawa::dcache::ACS Class Reference

Representation of an Abstract Cache State where each data cache block is represented by its age. More...

#include <otawa/dcache/features.h>

Inheritance diagram for otawa::dcache::ACS:
otawa::dcache::MAYProblem::Domain otawa::dcache::MUSTProblem::Domain otawa::dcache::PERSProblem::Item

Public Member Functions

 ACS (const int _size, const int _A, int init=-1)
 
 ~ACS ()
 
int getSize (void) const
 Get the number of blocks of the ACS. More...
 
int getA (void) const
 
 ACS (const ACS &source)
 Constructor by cloning. More...
 
ACSoperator= (const ACS &src)
 
bool equals (const ACS &dom) const
 Test if two ACS are equals. More...
 
void empty (void)
 Set all block to age -1. More...
 
bool contains (const int id) const
 Test if a block is in the ACS , that is, its each age is in the interval [0, A[ where A is the associativity of the cache. More...
 
void print (elm::io::Output &output) const
 Print the ACS. More...
 
int getAge (int id) const
 Get the age of a block. More...
 
void setAge (const int id, const int _age)
 Change the age of a block. More...
 
void set (const ACS &dom)
 Set the ages of the given ACS to the current one. More...
 
const int & operator[] (int i) const
 
int & operator[] (int i)
 

Protected Attributes

int A
 
int size
 
int * age
 

Detailed Description

Representation of an Abstract Cache State where each data cache block is represented by its age.

The initial state is the unknown one, that is when each block has an age of -1 (unknown age).

Constructor & Destructor Documentation

otawa::dcache::ACS::ACS ( const int  _size,
const int  _A,
int  init = -1 
)
inline

References age, and size.

otawa::dcache::ACS::~ACS ( )
inline

References age.

otawa::dcache::ACS::ACS ( const ACS source)
inline

Constructor by cloning.

Parameters
sourceCloned ACS.

References age, and size.

Member Function Documentation

bool otawa::dcache::ACS::contains ( const int  id) const
inline

Test if a block is in the ACS , that is, its each age is in the interval [0, A[ where A is the associativity of the cache.

Parameters
idNumber of the tested block.
Returns
True if it is in the cache, false else.

References age.

Referenced by otawa::dcache::PERSProblem::Item::inject(), otawa::dcache::MAYProblem::Domain::inject(), otawa::dcache::PERSProblem::Item::isPersistent(), and otawa::dcache::CATBuilder::processLBlockSet().

void otawa::dcache::ACS::empty ( void  )
inline
bool otawa::dcache::ACS::equals ( const ACS acs) const
inline

Test if two ACS are equals.

Parameters
acsACS to compare the current one with.
Returns
True if both ACS are equal, false else.

References A, age, and size.

Referenced by otawa::dcache::MUSTProblem::equals(), and otawa::dcache::MAYProblem::equals().

int otawa::dcache::ACS::getA ( void  ) const
inline

References A.

Referenced by otawa::dcache::PERSProblem::purge().

int otawa::dcache::ACS::getAge ( int  id) const
inline

Get the age of a block.

Parameters
Numberof the block.
Returns
Block age.

References age.

int otawa::dcache::ACS::getSize ( void  ) const
inline

Get the number of blocks of the ACS.

Returns
Number of blocks.

References size.

Referenced by otawa::dcache::PERSProblem::purge().

ACS& otawa::dcache::ACS::operator= ( const ACS src)
inline
const int& otawa::dcache::ACS::operator[] ( int  i) const
inline

References age.

int& otawa::dcache::ACS::operator[] ( int  i)
inline

References age.

void otawa::dcache::ACS::print ( elm::io::Output output) const

Print the ACS.

Parameters
outStream to output to.

References age, and size.

Referenced by otawa::dcache::operator<<(), and otawa::dcache::MUSTPERS::print().

void otawa::dcache::ACS::set ( const ACS acs)
inline

Set the ages of the given ACS to the current one.

Parameters
acsACS to set.

References A, age, and size.

Referenced by operator=().

void otawa::dcache::ACS::setAge ( const int  id,
const int  _age 
)
inline

Change the age of a block.

Parameters
idBlock number.
ageNew age to set.

References A, and age.

Member Data Documentation


The documentation for this class was generated from the following files: