Otawa  0.10
otawa::hard::PureCache Class Reference

#include <otawa/hard/PureCache.h>

Inheritance diagram for otawa::hard::PureCache:
otawa::hard::BHT

Public Types

enum  replace_policy_t {
  NONE = 0, OTHER = 1, LRU = 2, RANDOM = 3,
  FIFO = 4, PLRU = 5
}
 
typedef enum
otawa::hard::PureCache::replace_policy_t 
replace_policy_t
 

Public Member Functions

 PureCache (void)
 
virtual ~PureCache (void)
 
ot::size cacheSize (void) const
 
ot::size blockSize (void) const
 
int wayCount (void) const
 
int rowCount (void) const
 
int blockCount (void) const
 
replace_policy_t replacementPolicy (void) const
 
int blockBits (void) const
 
int rowBits (void) const
 
int tagBits (void) const
 
int wayBits (void) const
 
ot::mask blockMask (void) const
 
ot::mask lineMask (void) const
 
ot::mask tagMask (void) const
 
ot::mask offset (address_t addr) const
 
ot::mask line (address_t addr) const
 
ot::mask tag (address_t addr) const
 
ot::mask block (address_t addr) const
 
void setBlockBits (int block_bits)
 
void setRowBits (int set_bits)
 Set the row count as a number of bits. More...
 
void setWayBits (int way_bits)
 Set the way count as a number of bits. More...
 
void setReplacePolicy (replace_policy_t replace)
 Set the replace policy of the cache. More...
 

Public Attributes

int block_bits
 
int row_bits
 
int way_bits
 
replace_policy_t replace
 

Private Member Functions

 SERIALIZABLE (PureCache, DFIELD(block_bits, 4)&DFIELD(row_bits, 12)&DFIELD(way_bits, 0)&elm::field("replace", replace, LRU))
 

Private Attributes

const PureCache_next
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
NONE 
OTHER 
LRU 
RANDOM 
FIFO 
PLRU 

Constructor & Destructor Documentation

otawa::hard::PureCache::PureCache ( void  )
inline
virtual otawa::hard::PureCache::~PureCache ( void  )
inlinevirtual

Member Function Documentation

ot::mask otawa::hard::PureCache::block ( address_t  addr) const
inline
int otawa::hard::PureCache::blockBits ( void  ) const
inline

References block_bits.

Referenced by block(), blockSize(), cacheSize(), line(), lineMask(), tag(), and tagBits().

int otawa::hard::PureCache::blockCount ( void  ) const
inline

References row_bits, and way_bits.

ot::mask otawa::hard::PureCache::blockMask ( void  ) const
inline

References blockSize().

Referenced by offset(), and tagMask().

ot::size otawa::hard::PureCache::blockSize ( void  ) const
inline

References blockBits().

Referenced by blockMask().

ot::size otawa::hard::PureCache::cacheSize ( void  ) const
inline

References blockBits(), rowBits(), and wayBits().

ot::mask otawa::hard::PureCache::line ( address_t  addr) const
inline
ot::mask otawa::hard::PureCache::lineMask ( void  ) const
inline

References blockBits(), and rowCount().

Referenced by line(), and tagMask().

ot::mask otawa::hard::PureCache::offset ( address_t  addr) const
inline
PureCache::replace_policy_t otawa::hard::PureCache::replacementPolicy ( void  ) const
inline

References replace.

int otawa::hard::PureCache::rowBits ( void  ) const
inline

References row_bits.

Referenced by cacheSize(), rowCount(), tag(), and tagBits().

int otawa::hard::PureCache::rowCount ( void  ) const
inline

References rowBits().

Referenced by lineMask().

otawa::hard::PureCache::SERIALIZABLE ( PureCache  ,
DFIELD(block_bits, 4)&DFIELD(row_bits, 12)&DFIELD(way_bits, 0)&elm::field("replace", replace, LRU  
)
private
void otawa::hard::PureCache::setBlockBits ( int  block_bits)
void otawa::hard::PureCache::setReplacePolicy ( replace_policy_t  replace)

Set the replace policy of the cache.

Parameters
replaceReplace policy, one of OTHER, LRU, RANDOM, FIFO, PLRU.
void otawa::hard::PureCache::setRowBits ( int  row_bits)

Set the row count as a number of bits.

The actual row count is 1 << row_bits.

Parameters
row_bitsRow count in bits.
void otawa::hard::PureCache::setWayBits ( int  way_bits)

Set the way count as a number of bits.

The actual way count is 1 << way_bits.

Parameters
way_bitsWay count in bits.
ot::mask otawa::hard::PureCache::tag ( address_t  addr) const
inline
int otawa::hard::PureCache::tagBits ( void  ) const
inline

References blockBits(), and rowBits().

ot::mask otawa::hard::PureCache::tagMask ( void  ) const
inline

References blockMask(), and lineMask().

int otawa::hard::PureCache::wayBits ( void  ) const
inline

References way_bits.

Referenced by cacheSize(), and wayCount().

int otawa::hard::PureCache::wayCount ( void  ) const
inline

References wayBits().

Member Data Documentation

const PureCache* otawa::hard::PureCache::_next
private
int otawa::hard::PureCache::block_bits

Referenced by blockBits().

replace_policy_t otawa::hard::PureCache::replace

Referenced by replacementPolicy().

int otawa::hard::PureCache::row_bits

Referenced by blockCount(), and rowBits().

int otawa::hard::PureCache::way_bits

Referenced by blockCount(), and wayBits().


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