Otawa  0.10
otawa::etime::Event Class Referenceabstract

An event represents a time variation in the execution of an instruction. More...

#include <otawa/etime/features.h>

Inheritance diagram for otawa::etime::Event:
otawa::PropList

Public Member Functions

 Event (Inst *inst)
 Build an event. More...
 
virtual ~Event (void)
 
Instinst (void) const
 Get the instruction this event applies to. More...
 
virtual kind_t kind (void) const =0
 Get the kind of the event. More...
 
virtual ot::time cost (void) const =0
 Get the cost in cycles of the occurrence of the event. More...
 
virtual type_t type (void) const =0
 
virtual occurrence_t occurrence (void) const
 Get the occurrences class of this event. More...
 
virtual cstring name (void) const
 Get the name of the event (for human user). More...
 
virtual string detail (void) const =0
 
virtual const hard::Stagestage (void) const
 For events applying to a particular processor stage, get this stage. More...
 
virtual const
hard::FunctionalUnit
fu (void) const
 For events applying to a particular processor functional unit, get this functional unit. More...
 
virtual int weight (void) const
 Weight is a coarse-grain estimation of the number of times an event arises. More...
 
virtual bool isEstimating (bool on)
 Ask for support of overestimation for the event when activated (on is true) or desactivated (on is false). More...
 
virtual void estimate (ilp::Constraint *cons, bool on)
 Add an estimation of the event at the left of the given constraint. More...
 
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...
 
void print (elm::io::Output &out) const
 Display the current property list. More...
 

Static Public Attributes

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

Private Attributes

Inst_inst
 

Detailed Description

An event represents a time variation in the execution of an instruction.

Examples of events include instruction/data cache hit/miss, resolution of a branch prediction, hit/miss in the prefetch device of flash memory, etc.

Events are used to compute the execution time of code blocks and are usually linked to their matching block.

Constructor & Destructor Documentation

otawa::etime::Event::Event ( Inst inst)

Build an event.

Parameters
instInstruction it applies to.
otawa::etime::Event::~Event ( void  )
virtual

Member Function Documentation

void otawa::PropList::clearProps ( void  )
inherited
ot::time otawa::etime::Event::cost ( void  ) const
pure virtual

Get the cost in cycles of the occurrence of the event.

Returns
Cost of the event (in cycles).

Referenced by otawa::etime::EdgeTimeBuilder::apply().

virtual string otawa::etime::Event::detail ( void  ) const
pure virtual
void otawa::etime::Event::estimate ( ilp::Constraint cons,
bool  on 
)
virtual

Add an estimation of the event at the left of the given constraint.

If the event is considered on, it should an overestimation. If the event is considered off, it should be an underestimation.

May be overridden to provide specific behavior for the actual event. As a default, do nothing.

Parameters
consConstraint to add overestimation to.
onAdd overestimation when the event is triggered (true) or not triggered (false).

Referenced by otawa::etime::EventCollector::make().

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().

const hard::FunctionalUnit * otawa::etime::Event::fu ( void  ) const
virtual

For events applying to a particular processor functional unit, get this functional unit.

Returns
Processor functional unit the event applies to.
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().

Inst * otawa::etime::Event::inst ( void  ) const
inline

Get the instruction this event applies to.

Returns
Event instruction.

References _inst.

Referenced by otawa::etime::EdgeTimeBuilder::processSequence().

bool otawa::etime::Event::isEstimating ( bool  on)
virtual

Ask for support of overestimation for the event when activated (on is true) or desactivated (on is false).

May be overridden according to the actual event. As a default, return false.

Parameters
onTest for event activated, or not activated.
Returns
True if the event provides support for the activation.

Referenced by otawa::etime::EventCollector::make().

kind_t otawa::etime::Event::kind ( void  ) const
pure virtual

Get the kind of the event.

Returns
Event kind.

Referenced by otawa::etime::EdgeTimeBuilder::apply(), and otawa::etime::EdgeTimeBuilder::rollback().

cstring otawa::etime::Event::name ( void  ) const
virtual

Get the name of the event (for human user).

Returns
Event name.

Referenced by otawa::etime::EventCollector::make().

occurrence_t otawa::etime::Event::occurrence ( void  ) const
virtual

Get the occurrences class of this event.

Returns
Event occurrence class.

References otawa::etime::SOMETIMES.

Referenced by otawa::etime::EdgeTimeBuilder::processSequence().

void otawa::PropList::print ( elm::io::Output out) const
inherited

Display the current property list.

Parameters
outOutput to use.

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

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
const hard::Stage * otawa::etime::Event::stage ( void  ) const
virtual

For events applying to a particular processor stage, get this stage.

Returns
Processor stage the event applies to.
virtual type_t otawa::etime::Event::type ( void  ) const
pure virtual
int otawa::etime::Event::weight ( void  ) const
virtual

Weight is a coarse-grain estimation of the number of times an event arises.

As a default returns 1 but may be customized to get more precise weight estimation. This result will be used by heuristic approach to assess the impact of this event.

Returns
Weight of the event.

Member Data Documentation

Inst* otawa::etime::Event::_inst
private

Referenced by inst().

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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