Otawa  0.10
otawa::hard::CacheConfiguration Class Reference

This class represents the full configuration of caches of a processor. More...

#include <otawa/hard/CacheConfiguration.h>

Public Member Functions

 CacheConfiguration (const Cache *inst_cache=0, const Cache *data_cache=0)
 Build a new configuration from the passed cache. More...
 
virtual ~CacheConfiguration (void)
 
const CacheinstCache (void) const
 Get the instruction cache. More...
 
const CachedataCache (void) const
 Get the data cache. More...
 
bool hasInstCache (void) const
 Check if some instruction is available (in a harvard or an unified architecture). More...
 
bool hasDataCache (void) const
 Check if some data is available (in a harvard or an unified architecture). More...
 
bool isUnified (void) const
 Check if the cache ois unified. More...
 
bool isHarvard (void) const
 Check if the cache follows the Harvard architecture. More...
 
string cacheName (const Cache *cache) const
 Compute name of the cache. More...
 

Static Public Member Functions

static CacheConfigurationload (elm::xom::Element *element)
 Load a cache configuration from the given element. More...
 
static CacheConfigurationload (const elm::system::Path &path)
 Load a cache configuration from an XML file. More...
 

Static Public Attributes

static const CacheConfiguration NO_CACHE
 Useful constant representing a configuration without cache. More...
 

Protected Attributes

const Cacheicache
 
const Cachedcache
 

Private Member Functions

 SERIALIZABLE (CacheConfiguration, FIELD(icache)&FIELD(dcache))
 

Detailed Description

This class represents the full configuration of caches of a processor.

Constructor & Destructor Documentation

otawa::hard::CacheConfiguration::CacheConfiguration ( const Cache inst_cache = 0,
const Cache data_cache = 0 
)
inline

Build a new configuration from the passed cache.

Build a cache configuration.

For creating a no-cache configuration, do not give any cache in argument. If you want to create an unified cache, pass the the same cache as inst_cache and data_cache.

Parameters
inst_cacheInstruction cache.
data_cacheData cache.
icacheInstruction cache.
dcacheData cache.
Note
To get an unified cache, use the same value for icache and dcache.

Referenced by load().

otawa::hard::CacheConfiguration::~CacheConfiguration ( void  )
virtual

Member Function Documentation

string otawa::hard::CacheConfiguration::cacheName ( const Cache cache) const

Compute name of the cache.

Parameters
cacheCache to get name for.
Returns
Cache name.

References buf, dataCache(), dcache, icache, instCache(), otawa::hard::Cache::nextLevel(), and elm::StringBuffer::toString().

const Cache * otawa::hard::CacheConfiguration::dataCache ( void  ) const
inline

Get the data cache.

Returns
Data cache.

References dcache.

Referenced by cacheName(), and otawa::ipet::TrivialDataCacheManager::configure().

bool otawa::hard::CacheConfiguration::hasDataCache ( void  ) const
inline

Check if some data is available (in a harvard or an unified architecture).

Returns
True if a data cache data is available, false else.

References dcache.

bool otawa::hard::CacheConfiguration::hasInstCache ( void  ) const
inline

Check if some instruction is available (in a harvard or an unified architecture).

Returns
True if instruction cache is available, false else.

References icache.

Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::ACSComputation::initialization(), and otawa::ets::ACSComputation::processWorkSpace().

bool otawa::hard::CacheConfiguration::isHarvard ( void  ) const
inline

Check if the cache follows the Harvard architecture.

Returns
True if the cache follows the Harvard architecture, false else.

References dcache, and icache.

bool otawa::hard::CacheConfiguration::isUnified ( void  ) const
inline

Check if the cache ois unified.

Returns
True if the cache is unified, false else.

References dcache, and icache.

Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::ACSComputation::initialization(), and otawa::ets::ACSComputation::processWorkSpace().

CacheConfiguration * otawa::hard::CacheConfiguration::load ( elm::xom::Element element)
static

Load a cache configuration from the given element.

Parameters
elementElement to load from.
Returns
Built cache configuration.

References CacheConfiguration().

Referenced by otawa::hard::Platform::loadCacheConfig().

CacheConfiguration * otawa::hard::CacheConfiguration::load ( const elm::system::Path &  path)
static

Load a cache configuration from an XML file.

Parameters
pathPath to the file.
Returns
Built cache configuration.

References CacheConfiguration().

otawa::hard::CacheConfiguration::SERIALIZABLE ( CacheConfiguration  ,
FIELD(icache)&FIELD(dcache  
)
private

Member Data Documentation

const Cache * otawa::hard::CacheConfiguration::dcache
protected
const Cache* otawa::hard::CacheConfiguration::icache
protected
const CacheConfiguration otawa::hard::CacheConfiguration::NO_CACHE
static

Useful constant representing a configuration without cache.


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