Otawa
0.10
|
#include <otawa/tsim/BBPath.h>
Classes | |
class | BBIterator |
Public Member Functions | |
elm::genstruct::Vector< BBPath * > * | nexts () |
Builds a vector containing this BBSequence made longer with all successors of the last basic block it holds. More... | |
int | time (WorkSpace *fw) |
Returns the number of cycles the processor must do to cover the sequence. More... | |
int | countInstructions () |
int | t (WorkSpace *fw) |
tests if two BBSequences are the same or not (same basic blocks in the path) More... | |
int | length () |
Gives the number of basic blocks that composes this path. More... | |
int | l () |
Same as BBPath::length() Gives the number of basic blocks that composes this path. More... | |
BasicBlock * | head () |
BasicBlock * | tail () |
elm::String | makeVarName () |
Creates a human-readable name (or representation) for this sequence This name is like Seq_x1_x2_x3 if the basic blocks have names x1, x2 and x3. More... | |
ilp::Var * | getVar (ilp::System *system, bool explicit_names=false) |
if this sequence doesn't have a var (for the ilp system) attached, creates a new one More... | |
BBPath * | sub (int begin, int end) |
Returns a sub-path. More... | |
BBPath * | operator() (int begin, int end) |
Property * | getProp (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) |
Property * | extractProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier and return it. More... | |
Property * | extractProp (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 Member Functions | |
static BBPath * | getBBPath (BasicBlock *start) |
Returns the path of length 1 composed by only the given basic block. More... | |
static BBPath * | getBBPath (elm::genstruct::Vector< BasicBlock * > *path) |
Returns the path composed by the given path. More... | |
Static Public Attributes | |
static int | instructions_simulated = 0 |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Protected Member Functions | |
BBPath (BasicBlock *start) | |
Builds a new BBPath (length=1) from a given basic block. More... | |
BBPath (elm::genstruct::Vector< BasicBlock * > *path) | |
Builds a new BBPath from a vector of basic blocks. More... | |
int | simulate (WorkSpace *fw) |
Launches a simulation of the sequence. More... | |
Protected Attributes | |
int | _length |
elm::genstruct::Vector < BasicBlock * > | basicBlocks |
WorkSpace * | last_framework_used |
Friends | |
class | PathManager |
This class represents a sequence of basic blocks, making a basic block path. BBPath are linked with others, and linked to basic blocks, and they are unique. One can't have two instances of the same path. It is possible to get a simulated time for this sequence
|
protected |
Builds a new BBPath (length=1) from a given basic block.
framework | FrameWork where one can get a simulator, or IPET::ID_Explicit |
start | starting basic block |
References basicBlocks.
Referenced by getBBPath().
|
protected |
Builds a new BBPath from a vector of basic blocks.
framework | FrameWork where one can get a simulator, or IPET::ID_Explicit |
path | vector of the basic blocks |
References basicBlocks, elm::genstruct::Vector< T >::get(), l(), and elm::genstruct::Vector< T >::length().
|
inherited |
Add property to the list without checking of duplication.
prop | Property to add. |
References otawa::Property::_next.
Referenced by otawa::Identifier< T >::add(), otawa::ast::ASTInfo::ASTInfo(), otawa::Identifier< otawa::arm::Info * >::copy(), otawa::AbstractIdentifier::initProps(), otawa::ContextualProperty::make(), otawa::script::Script::makeConfig(), otawa::ccg::Builder::processLBlockSet(), otawa::ipet::ILPSystemGetter::processWorkSpace(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), and otawa::ContextualProperty::refProps().
|
inherited |
Add all properties from the given property list, in a reverse order.
props | Property list to clone. |
References copy(), otawa::PropList::head, and otawa::Property::next().
Referenced by otawa::display::CFGDrawer::CFGDrawer(), otawa::display::GraphVizGraph::GraphVizGraph(), otawa::ParamFeature::instantiate(), otawa::Manager::loadXML(), otawa::display::GraphVizGraph::newEdge(), otawa::display::GraphVizGraph::newNode(), otawa::PropList::operator=(), otawa::Process::Process(), otawa::PropList::PropList(), otawa::display::GraphVizItem::setProps(), otawa::VirtualBasicBlock::VirtualBasicBlock(), and otawa::VirtualCFG::VirtualCFG().
|
inherited |
Remove all properties from the list.
References otawa::Property::next().
Referenced by otawa::PSTBuilder::getVCFG(), otawa::PropList::operator=(), otawa::display::GraphVizItem::setProps(), otawa::PropList::~PropList(), and otawa::WorkSpace::~WorkSpace().
int otawa::tsim::BBPath::countInstructions | ( | void | ) |
References _length, and basicBlocks.
Referenced by otawa::tsim::Delta::processCFG(), and simulate().
|
inherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::script::Script::makeConfig().
|
inlineinherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::PropList::extractProp().
Referenced by otawa::PropList::extractProp().
|
static |
Returns the path of length 1 composed by only the given basic block.
If this path doesn't exist, creates it.
start | basic block |
References BBPath(), otawa::tsim::TreePath< T1, T2 >::rootData(), and otawa::tsim::Delta::TREE.
Referenced by nexts(), otawa::tsim::Delta::processBBPath(), otawa::tsim::Delta::processCFG(), and sub().
|
static |
Returns the path composed by the given path.
If this path doesn't exist, creates it.
path | vector of basic blocks composing the path |
References otawa::tsim::TreePath< T1, T2 >::add(), otawa::cfgio::bb(), BBPath(), elm::genstruct::Vector< T >::get(), otawa::tsim::TreePath< T1, T2 >::get(), and otawa::tsim::Delta::TREE.
|
inherited |
Find a property by its identifier.
id | Identifier of the property to find. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::Identifier< otawa::arm::Info * >::exists(), otawa::ContextualProperty::exists(), otawa::ContextualProperty::find(), otawa::Identifier< T >::get(), otawa::PropList::hasProp(), otawa::ContextualProperty::make(), otawa::ParamFeature::matches(), otawa::ImmutableRef< T, I >::print(), otawa::ContextualProperty::print(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), otawa::ContextualProperty::refProps(), otawa::Identifier< T >::set(), otawa::Identifier< T >::use(), and otawa::Identifier< T >::value().
ilp::Var * otawa::tsim::BBPath::getVar | ( | ilp::System * | system, |
bool | explicit_names = false |
||
) |
if this sequence doesn't have a var (for the ilp system) attached, creates a new one
References basicBlocks, length(), makeVarName(), otawa::ilp::System::newVar(), and otawa::ipet::VAR.
Referenced by otawa::tsim::Delta::processBBPath().
|
inlineinherited |
Test if the property list contains a property matching the given identifier.
id | Property identifier to look for. |
References otawa::PropList::getProp().
Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().
|
inline |
References basicBlocks.
Referenced by otawa::tsim::Delta::processBBPath(), and otawa::tsim::Delta::processCFG().
|
inline |
Same as BBPath::length()
Gives the number of basic blocks that composes this path.
References length().
|
inline |
Gives the number of basic blocks that composes this path.
References _length.
Referenced by otawa::tsim::Delta::delta(), getVar(), l(), makeVarName(), otawa::tsim::Delta::processBBPath(), otawa::tsim::Delta::processCFG(), and sub().
String otawa::tsim::BBPath::makeVarName | ( | ) |
Creates a human-readable name (or representation) for this sequence
This name is like Seq_x1_x2_x3
if the basic blocks have names x1, x2 and x3.
References basicBlocks, buf, elm::String::isEmpty(), length(), otawa::ilp::Var::name(), elm::StringBuffer::toString(), and otawa::ipet::VAR.
Referenced by getVar().
Builds a vector containing this BBSequence made longer with all successors of the last basic block it holds.
Searches in the Delta Processor if these sequences already exists
References elm::genstruct::Vector< T >::add(), basicBlocks, otawa::cfgio::bb(), otawa::cfgio::edge(), getBBPath(), and l().
Referenced by otawa::tsim::Delta::processBBPath(), and otawa::tsim::Delta::processCFG().
|
inherited |
Display the current property list.
out | Output to use. |
Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().
|
inherited |
Remove all the properties matching the given identifier.
id | Identifier of properties to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::LoopUnroller::unroll().
|
inherited |
Remove a property matching the given identifier.
id | Identifier of the property to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::PSTBuilder::buildTree(), otawa::BBRemover< T >::clean(), otawa::display::CFGOutput::processCFG(), otawa::SubCFGBuilder::processWorkSpace(), otawa::Ref< T, I >::remove(), and otawa::ContextualPath::Ref< T >::remove().
|
inlineinherited |
References otawa::PropList::removeProp().
Referenced by otawa::PropList::removeProp().
|
inherited |
Set the property in the property list removing any double.
prop | Property to set. |
References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().
|
inlineinherited |
References otawa::PropList::setProp().
Referenced by otawa::PropList::setProp().
|
protected |
Launches a simulation of the sequence.
If the simulator supports state cloning, it uses the saved state of the sub-sequences in order to simulate less instructions.
References countInstructions(), otawa::sim::State::cycle(), otawa::sim::State::flush(), otawa::sim::Simulator::instantiate(), instructions_simulated, otawa::WorkSpace::process(), otawa::sim::State::reset(), otawa::sim::State::run(), otawa::Process::simulator(), and otawa::sim::USE_MEMORY.
Referenced by time().
BBPath * otawa::tsim::BBPath::sub | ( | int | begin, |
int | end | ||
) |
Returns a sub-path.
Searches if this path already exists
begin | index of the first basic block (first = 1) |
end | index of the last basic block (last = length()) |
begin
to end
indexes References elm::genstruct::Vector< T >::add(), basicBlocks, otawa::p::end, getBBPath(), and length().
Referenced by operator()().
|
inline |
tests if two BBSequences are the same or not (same basic blocks in the path)
bbs | BBSequence to compare |
Same as BBPath::time()
Returns the number of cycles the processor must do to cover the path. Simulates the path if necessary
References time().
Referenced by otawa::tsim::Delta::delta().
|
inline |
References basicBlocks.
Referenced by otawa::tsim::Delta::processBBPath(), and otawa::tsim::Delta::processCFG().
int otawa::tsim::BBPath::time | ( | WorkSpace * | fw | ) |
Returns the number of cycles the processor must do to cover the sequence.
Simulates the sequence if necessary
References simulate(), and otawa::ipet::TIME.
Referenced by otawa::tsim::Delta::delta(), otawa::tsim::Delta::processBBPath(), and t().
|
friend |
|
protected |
Referenced by countInstructions(), and length().
|
protected |
Referenced by BBPath(), countInstructions(), getVar(), head(), makeVarName(), nexts(), sub(), and tail().
|
staticinherited |
This is an empty proplist for convenience.
|
static |
Referenced by simulate().
|
protected |