Otawa  0.10
otawa::dcache::PERSProblem::Item Class Reference

ACS for the multi-level data cache persistence analysis. More...

#include <otawa/dcache/PERSProblem.h>

Inheritance diagram for otawa::dcache::PERSProblem::Item:
otawa::dcache::ACS

Public Member Functions

 Item (const int _size, const int _A)
 
 Item (const Item &source)
 
 Item (const ACS &source)
 
Itemoperator= (const Item &src)
 
Itemoperator= (const ACS &src)
 
void refresh (int id, int newage)
 
void lub (const Item &dom)
 Perform join on persistent ACS. More...
 
bool equals (const Item &dom) const
 Test if two ACS are equals. More...
 
void inject (MUSTProblem::Domain *must, const int id)
 Consider that an access to the designed block is performed. More...
 
bool isWiped (const int id)
 
bool isPersistent (const int id)
 
void addDamage (const int id, int damage)
 Change the age of the designed block considering the given damage to the ACS. More...
 
void ageAll (void)
 Consider that an unknown access is performed and, therefore, all blocks must be aged. More...
 
int getSize (void) const
 Get the number of blocks of the ACS. More...
 
int getA (void) const
 
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

ACS for the multi-level data cache persistence analysis.

Items are composed on each level.

Constructor & Destructor Documentation

otawa::dcache::PERSProblem::Item::Item ( const int  _size,
const int  _A 
)
inline
otawa::dcache::PERSProblem::Item::Item ( const Item source)
inline
otawa::dcache::PERSProblem::Item::Item ( const ACS source)
inline

Member Function Documentation

void otawa::dcache::PERSProblem::Item::addDamage ( const int  id,
int  damage 
)

Change the age of the designed block considering the given damage to the ACS.

Parameters
idBlock identifier.
damageNumber of aging to apply.
void otawa::dcache::PERSProblem::Item::ageAll ( void  )

Consider that an unknown access is performed and, therefore, all blocks must be aged.

References otawa::dcache::ACS::A, otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

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

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 otawa::dcache::ACS::age.

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

bool otawa::dcache::PERSProblem::Item::equals ( const Item dom) const

Test if two ACS are equals.

Parameters
domACS to test with.
Returns
True if they are equals, false else.

References otawa::dcache::ACS::A, otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

bool otawa::dcache::ACS::equals ( const ACS acs) const
inlineinherited

Test if two ACS are equals.

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

References otawa::dcache::ACS::A, otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

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

int otawa::dcache::ACS::getA ( void  ) const
inlineinherited
int otawa::dcache::ACS::getAge ( int  id) const
inlineinherited

Get the age of a block.

Parameters
Numberof the block.
Returns
Block age.

References otawa::dcache::ACS::age.

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

Get the number of blocks of the ACS.

Returns
Number of blocks.

References otawa::dcache::ACS::size.

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

void otawa::dcache::PERSProblem::Item::inject ( MUSTProblem::Domain must,
const int  id 
)

Consider that an access to the designed block is performed.

Parameters
mustMust ACS (useful to work around a bug in the initial persistent ACS implementation).
idIdentifier of the injected block.

References otawa::dcache::ACS::contains().

bool otawa::dcache::PERSProblem::Item::isPersistent ( const int  id)
inline
bool otawa::dcache::PERSProblem::Item::isWiped ( const int  id)
inline
void otawa::dcache::PERSProblem::Item::lub ( const Item dom)

Perform join on persistent ACS.

Parameters
domDomain to join with.

References otawa::dcache::ACS::A, otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

Item& otawa::dcache::PERSProblem::Item::operator= ( const Item src)
inline
Item& otawa::dcache::PERSProblem::Item::operator= ( const ACS src)
inline
const int& otawa::dcache::ACS::operator[] ( int  i) const
inlineinherited
int& otawa::dcache::ACS::operator[] ( int  i)
inlineinherited
void otawa::dcache::ACS::print ( elm::io::Output output) const
inherited

Print the ACS.

Parameters
outStream to output to.

References otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

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

void otawa::dcache::PERSProblem::Item::refresh ( int  id,
int  newage 
)
inline
void otawa::dcache::ACS::set ( const ACS acs)
inlineinherited

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

Parameters
acsACS to set.

References otawa::dcache::ACS::A, otawa::dcache::ACS::age, and otawa::dcache::ACS::size.

Referenced by otawa::dcache::ACS::operator=().

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

Change the age of a block.

Parameters
idBlock number.
ageNew age to set.

References otawa::dcache::ACS::A, and otawa::dcache::ACS::age.

Member Data Documentation


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