Otawa  0.10
otawa::sim::State Class Referenceabstract

This class represents a running simulator. More...

#include <otawa/sim/State.h>

Inheritance diagram for otawa::sim::State:
otawa::PropList

Public Member Functions

virtual Stateclone (void)=0
 Build a copy of the current simulation state. More...
 
virtual void run (Driver &driver)=0
 Run the simulator with the given driver. More...
 
virtual void stop (void)=0
 Stop the simulator at the end of the current cycle. More...
 
virtual void flush (void)=0
 Run the simulator, preventing the instruction fetch, until the pipeline is empty. More...
 
virtual int cycle (void)=0
 Return the number of running cycles. More...
 
virtual void reset (void)=0
 Reset the cycle counter. More...
 
virtual Processprocess (void)=0
 Get the process where the simulator is running in. 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...
 

Protected Member Functions

virtual ~State (void)
 

Detailed Description

This class represents a running simulator.

Objects of this class may be used for driving the simulation. As most methods are pure virtual,this class must be derivated before being used.

Constructor & Destructor Documentation

otawa::sim::State::~State ( void  )
protectedvirtual

Member Function Documentation

void otawa::PropList::clearProps ( void  )
inherited
State * otawa::sim::State::clone ( void  )
pure virtual

Build a copy of the current simulation state.

Returns
Simulation state copy.
int otawa::sim::State::cycle ( void  )
pure virtual

Return the number of running cycles.

Returns
Number of cycles.

Referenced by otawa::tsim::BBTimeSimulator::processBB(), and otawa::tsim::BBPath::simulate().

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

mode_t otawa::sim::State::flush ( void  )
pure virtual

Run the simulator, preventing the instruction fetch, until the pipeline is empty.

Returns
Processor state.

Referenced by otawa::tsim::BBPath::simulate().

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

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

Process * otawa::sim::State::process ( void  )
pure virtual

Get the process where the simulator is running in.

Returns
Current process.
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::sim::State::reset ( void  )
pure virtual

Reset the cycle counter.

Referenced by otawa::tsim::BBTimeSimulator::processBB(), and otawa::tsim::BBPath::simulate().

void otawa::sim::State::run ( Driver driver)
pure virtual

Run the simulator with the given driver.

This method stops when the driver stops the simulator.

Parameters
driverSimulator driver.

Referenced by otawa::tsim::BBTimeSimulator::processBB(), and otawa::tsim::BBPath::simulate().

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
void otawa::sim::State::stop ( void  )
pure virtual

Stop the simulator at the end of the current cycle.

Referenced by otawa::sim::BasicBlockDriver::nextInstruction().

Member Data Documentation

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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