Otawa  0.10
otawa::dcache::DirtyManager Class Reference

A dirty manager allows to exploit the results of the dirty analysis (DIRTY_FEATURE). More...

#include <otawa/dcache/features.h>

Classes

struct  t
 

Public Types

typedef struct
otawa::dcache::DirtyManager::t 
t
 State for the dirty analysis. More...
 

Public Member Functions

 DirtyManager (const BlockCollection &coll)
 
bool mayBeDirty (const t &value, int block) const
 Test if the given block may be dirty. More...
 
bool mustBeDirty (const t &value, int block) const
 Test if the given block must be dirty. More...
 
const tbottom (void) const
 Build a bottom dirty state. More...
 
const ttop (void) const
 Build a top dirty state. More...
 
void set (t &d, const t &s) const
 Copy a state in an existing one. More...
 
void update (t &d, const BlockAccess &acc)
 Update the dirty state with the given block access. More...
 
void join (t &d, const t &s) const
 Join two dirty states. More...
 
bool equals (const t &s1, const t &s2) const
 Test if both dirty states are equals. More...
 

Private Attributes

t bot
 
t _top
 
const BlockCollection_coll
 

Detailed Description

A dirty manager allows to exploit the results of the dirty analysis (DIRTY_FEATURE).

The code below shows how to use it:

DirtyManager man(my_block_row, my_cache);
DirtyManager::t s = man.clone(DIRTY(my_bb));
Pair<int, BlockAccess *> accs = DATA_BLOCKS(my_bb);
for(int i = 0; i < accs.fst; i++) {
man.update(s, accs.snd[i]);
if(man.mustBeDirty(d, my_cache_block)) ...;
if(man.mayBeDirty(d, my_cache_block)) ...;
}

Member Typedef Documentation

State for the dirty analysis.

Constructor & Destructor Documentation

Member Function Documentation

const DirtyManager::t & otawa::dcache::DirtyManager::bottom ( void  ) const

Build a bottom dirty state.

References bot.

bool otawa::dcache::DirtyManager::equals ( const t s1,
const t s2 
) const

Test if both dirty states are equals.

Parameters
s1First state to compare.
s2Second state to compare.
Returns
True if they are equal, false else.

References otawa::dfa::BitSet::equals(), otawa::dcache::DirtyManager::t::may(), and otawa::dcache::DirtyManager::t::must().

void otawa::dcache::DirtyManager::join ( t d,
const t s 
) const

Join two dirty states.

Parameters
dFirst and target dirty state.
sSecond dirty state.

References otawa::dcache::DirtyManager::t::may(), and otawa::dcache::DirtyManager::t::must().

bool otawa::dcache::DirtyManager::mayBeDirty ( const t state,
int  block 
) const

Test if the given block may be dirty.

Parameters
stateDirty state.
blockBlock to test.
Returns
True if it may be dirty, false else.

References otawa::dfa::BitSet::contains(), and otawa::dcache::DirtyManager::t::may().

bool otawa::dcache::DirtyManager::mustBeDirty ( const t state,
int  block 
) const

Test if the given block must be dirty.

Parameters
stateDirty state.
blockBlock to test.
Returns
True if it must be dirty, false else.

References otawa::dfa::BitSet::contains(), and otawa::dcache::DirtyManager::t::must().

void otawa::dcache::DirtyManager::set ( t d,
const t s 
) const

Copy a state in an existing one.

Parameters
dState to copy to.
sState to copy from.

References otawa::dcache::DirtyManager::t::may(), and otawa::dcache::DirtyManager::t::must().

const DirtyManager::t & otawa::dcache::DirtyManager::top ( void  ) const

Build a top dirty state.

References _top.

Member Data Documentation

const BlockCollection& otawa::dcache::DirtyManager::_coll
private

Referenced by update().

t otawa::dcache::DirtyManager::_top
private

Referenced by DirtyManager(), and top().

t otawa::dcache::DirtyManager::bot
private

Referenced by bottom(), and DirtyManager().


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