Otawa  0.10
otawa::dcache::BlockAccess Class Reference

A block access represents a data memory access of an instruction. More...

#include <otawa/dcache/features.h>

Inheritance diagram for otawa::dcache::BlockAccess:
otawa::PropList

Public Types

enum  action_t { NONE = 0, LOAD = 1, STORE = 2, PURGE = 3 }
 
enum  kind_t { ANY = 0, BLOCK = 1, RANGE = 2 }
 
typedef enum
otawa::dcache::BlockAccess::action_t 
action_t
 
typedef enum
otawa::dcache::BlockAccess::kind_t 
kind_t
 

Public Member Functions

 BlockAccess (void)
 Build a null block access. More...
 
 BlockAccess (Inst *instruction, action_t action)
 Build a block access of type ANY. More...
 
 BlockAccess (Inst *instruction, action_t action, const Block &block)
 
 BlockAccess (Inst *instruction, action_t action, Address::offset_t first, Address::offset_t last)
 Build a block access of type range. More...
 
 BlockAccess (const BlockAccess &acc)
 Construction by cloning. More...
 
BlockAccessoperator= (const BlockAccess &acc)
 
Instinstruction (void) const
 Get the instruction performing the access. More...
 
kind_t kind (void) const
 Get the kind of the access. More...
 
bool isAny (void) const
 
action_t action (void) const
 Get the performed action. More...
 
const Blockblock (void) const
 Only for kind BLOCK, get the accessed block. More...
 
int first (void) const
 
int last (void) const
 
bool inRange (int block) const
 Test if the given block is the range of the given access. More...
 
bool inSet (int set, const hard::Cache *cache) const
 Test if the given set concerns the range access. More...
 
bool in (const Block &block) const
 Test if the given block may be concerned by the current access. More...
 
void print (io::Output &out) const
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
void setProp (Property *prop)
 Set the property in the property list removing any double. More...
 
void setProp (const AbstractIdentifier *id)
 
void removeProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier. More...
 
void removeProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertyextractProp (const AbstractIdentifier &id)
 Remove a property matching the given identifier and return it. More...
 
void addProp (Property *prop)
 Add property to the list without checking of duplication. More...
 
void removeAllProp (const AbstractIdentifier *id)
 Remove all the properties matching the given identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 Test if the property list contains a property matching the given identifier. More...
 
void clearProps (void)
 Remove all properties from the list. More...
 
void addProps (const PropList &props)
 Add all properties from the given property list, in a reverse order. More...
 

Static Public Attributes

static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Private Attributes

Instinst
 
t::uint8 _kind
 
t::uint8 _action
 
union {
   const Block *   blk
 
   struct {
      hard::Cache::block_t   first
 
      hard::Cache::block_t   last
 
   }   range
 
data
 

Detailed Description

A block access represents a data memory access of an instruction.

The action is defined by BlockAccess::action_t that may be:

  • NONE – invalid action (only for convenience),
  • READ – read of cache,
  • WRITE – write of cache,
  • PURGE – target block are purged (possibly written back to memory).

Possible kinds of data accesses include:

  • ANY Most imprecised access: one memory accessed is performed but the address is unknown.
  • BLOCK A single block is accessed (given by block() method).
  • RANGE A range of block may be accessed (between first() and last() methods addresses).

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
NONE 
LOAD 
STORE 
PURGE 
Enumerator
ANY 
BLOCK 
RANGE 

Constructor & Destructor Documentation

otawa::dcache::BlockAccess::BlockAccess ( void  )
inline

Build a null block access.

otawa::dcache::BlockAccess::BlockAccess ( Inst instruction,
action_t  action 
)
inline

Build a block access of type ANY.

Parameters
instructionInstruction performing the access.
actionType of action.
otawa::dcache::BlockAccess::BlockAccess ( Inst instruction,
action_t  action,
const Block block 
)
inline

References block(), and data.

otawa::dcache::BlockAccess::BlockAccess ( Inst instruction,
action_t  action,
Address::offset_t  first,
Address::offset_t  last 
)
inline

Build a block access of type range.

Notice the address of first block may be greater than the address of the second block, meaning that the accessed addresses ranges across the address modulo by 0.

Parameters
instructionInstruction performing the access.
actionType of action.
firstFirst accessed block (must a cache block boundary address).
lastLast access block (must a cache block boundary address).

References data, first(), and last().

otawa::dcache::BlockAccess::BlockAccess ( const BlockAccess acc)
inline

Construction by cloning.

Parameters
accCloned access.

References data.

Member Function Documentation

void otawa::PropList::clearProps ( void  )
inherited
Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::script::Script::makeConfig().

Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inlineinherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::PropList::extractProp().

Referenced by otawa::PropList::extractProp().

int otawa::dcache::BlockAccess::first ( void  ) const
inline

References _kind, data, and RANGE.

Referenced by BlockAccess(), and inRange().

bool otawa::PropList::hasProp ( const AbstractIdentifier id) const
inlineinherited

Test if the property list contains a property matching the given identifier.

Parameters
idProperty identifier to look for.
Returns
True if the list contains the matching property, false else.

References otawa::PropList::getProp().

Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().

bool otawa::dcache::BlockAccess::in ( const Block block) const

Test if the given block may be concerned by the current access.

Parameters
blockBlock to test.
Returns
True if it concerned, false else.

References otawa::dcache::Block::address(), otawa::etime::BLOCK, otawa::dcache::Block::index(), and kind.

bool otawa::dcache::BlockAccess::inRange ( int  block) const
inline

Test if the given block is the range of the given access.

Parameters
blockAddress of the cache block.
Returns
True if it is in the range, false else.

References block(), first(), and last().

Referenced by otawa::dcache::MUSTProblem::purge(), otawa::dcache::PERSProblem::purge(), and otawa::dcache::DirtyManager::update().

bool otawa::dcache::BlockAccess::inSet ( int  set,
const hard::Cache cache 
) const

Test if the given set concerns the range access.

Parameters
setSet to test for.
cacheCurrent cache (to get set information).
Returns
True if the set contains a block of the range, false else.

References otawa::hard::Cache::set(), otawa::hard::Cache::setCount(), and otawa::hard::Cache::tag().

Inst * otawa::dcache::BlockAccess::instruction ( void  ) const
inline

Get the instruction performing the access.

Returns
Instruction performing the access (must be an instruction of the basic block the access is applied to).

References inst.

Referenced by otawa::etime::StandardEventBuilder::processBB(), and otawa::dcache::CatConstraintBuilder::processWorkSpace().

bool otawa::dcache::BlockAccess::isAny ( void  ) const
inline

References _kind, and ANY.

int otawa::dcache::BlockAccess::last ( void  ) const
inline

References _kind, data, and RANGE.

Referenced by BlockAccess(), and inRange().

BlockAccess& otawa::dcache::BlockAccess::operator= ( const BlockAccess acc)
inline

References _action, _kind, data, and inst.

void otawa::dcache::BlockAccess::print ( io::Output out) const
void otawa::PropList::removeAllProp ( const AbstractIdentifier id)
inherited

Remove all the properties matching the given identifier.

Parameters
idIdentifier of properties to remove.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::LoopUnroller::unroll().

void otawa::PropList::removeProp ( const AbstractIdentifier id)
inherited
void otawa::PropList::removeProp ( const AbstractIdentifier id)
inlineinherited
void otawa::PropList::setProp ( Property prop)
inherited

Set the property in the property list removing any double.

Parameters
propProperty to set.

References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().

void otawa::PropList::setProp ( const AbstractIdentifier id)
inlineinherited

Member Data Documentation

t::uint8 otawa::dcache::BlockAccess::_action
private

Referenced by action(), operator=(), and print().

t::uint8 otawa::dcache::BlockAccess::_kind
private
const Block* otawa::dcache::BlockAccess::blk
union { ... } otawa::dcache::BlockAccess::data
const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.

Address::offset_t otawa::dcache::BlockAccess::first

Only for the RANGE kind, get the first accessed block.

Returns
First accessed block.

Referenced by otawa::etime::StandardEventBuilder::processBB(), otawa::dcache::MUSTPERS::update(), and otawa::dcache::MUSTProblem::update().

Inst* otawa::dcache::BlockAccess::inst
private

Referenced by instruction(), operator=(), and print().

Address::offset_t otawa::dcache::BlockAccess::last

Only for the RANGE kind, get the last accessed block.

Returns
Last accessed block.

Referenced by otawa::dcache::MUSTPERS::update(), and otawa::dcache::MUSTProblem::update().

struct { ... } otawa::dcache::BlockAccess::range

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