Otawa
0.10
|
The manager class providesfacilities for storing, grouping and retrieving shared resources like loaders and platforms. More...
#include <otawa/prog/Manager.h>
Public Member Functions | |
Manager (void) | |
Manager builder. More... | |
~Manager (void) | |
Delete all used resources. More... | |
Loader * | findLoader (elm::CString name) |
Find the loader matching the given name. More... | |
sim::Simulator * | findSimulator (elm::CString name) |
Find the simulator matching the given name. More... | |
WorkSpace * | load (const elm::system::Path &path, const PropList &props=PropList::EMPTY) |
Load a file with the given path and the given properties. More... | |
WorkSpace * | load (const PropList &props=PropList::EMPTY) |
Load a computation configuration from the given properties. More... | |
WorkSpace * | load (xom::Element *elem, const PropList &props=PropList::EMPTY) |
Load the framework from an XML configuration. More... | |
ilp::System * | newILPSystem (String plugin="") |
Make an ILP system from the given plugin or from a named plugin. More... | |
elm::system::Path | retrieveConfig (const elm::system::Path &path) |
Retrieve the file XXX-config.xml matching the path of the given binary. More... | |
Loader * | findFileLoader (const elm::system::Path &path) |
Look for loader of the given path. More... | |
Static Public Member Functions | |
static elm::system::Path | prefixPath (void) |
Get the prefix path of the OTAWA installation, that is, the installation directory path that allows to retrieve other file resources of OTAWA. More... | |
static String | buildPaths (cstring kind, string paths="") |
Static Public Attributes | |
static const cstring | OTAWA_NS = "http://www.irit.fr/recherches/ARCHI/MARCH" |
Namespace of otawa elements in an OTAWA configuration file. More... | |
static const cstring | OTAWA_NAME = "otawa" |
Name of the top element in an OTAWA configuration file. More... | |
static const cstring | PROCESSOR_NAME = "processor" |
Name of the part describing a processor configuration in an OTAWA configuration file. More... | |
static const cstring | CACHE_CONFIG_NAME = "cache-config" |
Name of the XML element containing the cache configuration. More... | |
static const cstring | MEMORY_NAME = "memory" |
Name of the XML element containing the memory configuration. More... | |
static const cstring | COMPILATION_DATE = OTAWA_DATE |
Compilation date of this OTAWA library. More... | |
static const cstring | VERSION = OTAWA_VERSION |
Current version of sources OTAWA (VCS version). More... | |
Private Member Functions | |
WorkSpace * | loadBin (const elm::system::Path &path, const PropList &props) |
Load a binary file. More... | |
WorkSpace * | loadXML (const elm::system::Path &path, const PropList &props) |
Load an XML configuration file. More... | |
bool | isVerbose (void) |
void | setVerbosity (const PropList &props) |
void | resetVerbosity (void) |
Private Attributes | |
genstruct::Vector < hard::Platform * > | platforms |
elm::system::Plugger | ilp_plugger |
elm::system::Plugger | loader_plugger |
elm::system::Plugger | sim_plugger |
int | verbose |
Friends | |
class | WorkSpace |
The manager class providesfacilities for storing, grouping and retrieving shared resources like loaders and platforms.
otawa::Manager::Manager | ( | void | ) |
otawa::Manager::~Manager | ( | void | ) |
Delete all used resources.
References elm::genstruct::Vector< T >::length(), and platforms.
References buf, kind, and elm::StringBuffer::toString().
Referenced by prefixPath().
Loader * otawa::Manager::findFileLoader | ( | const elm::system::Path & | path | ) |
Look for loader of the given path.
path | Path to the looked file. |
References buf, err, findLoader(), isVerbose(), loader_plugger, name, resetVerbosity(), elm::String::toCString(), and elm::StringBuffer::toString().
Referenced by retrieveConfig().
Loader * otawa::Manager::findLoader | ( | elm::CString | name | ) |
Find the loader matching the given name.
name | Name of the loader to find. |
References loader_plugger.
Referenced by findFileLoader(), and loadBin().
sim::Simulator * otawa::Manager::findSimulator | ( | elm::CString | name | ) |
Find the simulator matching the given name.
name | Name of the simulator to load. |
References sim_plugger.
Referenced by otawa::Process::simulator().
|
private |
References verbose.
Referenced by findFileLoader(), loadBin(), and loadXML().
WorkSpace * otawa::Manager::load | ( | const elm::system::Path & | path, |
const PropList & | props = PropList::EMPTY |
||
) |
Load a file with the given path and the given properties.
path | Path of the file to load. |
props | Configuration properties. |
The configuration properties may be :
This call try to link a plugin matching the Instruction Set Architecture of the loaded binary file. This plugin is looked in the following directories:
The two first cases let the user to provide their own plugin for, as an example, to develop a new loader plugin.
References otawa::CONFIG_ELEMENT, loadBin(), loadXML(), and setVerbosity().
Referenced by load(), and otawa::Application::run().
WorkSpace * otawa::Manager::load | ( | const PropList & | props = PropList::EMPTY | ) |
Load a computation configuration from the given properties.
props | Configuration properties. |
LoadException | Error during load. |
References otawa::CONFIG_ELEMENT, otawa::CONFIG_PATH, load(), and resetVerbosity().
WorkSpace * otawa::Manager::load | ( | xom::Element * | elem, |
const PropList & | props = PropList::EMPTY |
||
) |
Load the framework from an XML configuration.
elem | Top element of the configuration. |
props | Configuration properties. |
LoadException | Error during load. |
References bin(), elm::xom::Element::getAttributeValue(), elm::xom::Element::getFirstChildElement(), loadBin(), and resetVerbosity().
|
private |
Load a binary file.
path | Path to the binary file. |
props | Configuration properties. |
LoadException | Error during load. |
References _, otawa::XSLTScript::addParams(), buf, cerr, err, elm::sys::Path::exists(), otawa::XSLTScript::fillProps(), findLoader(), isVerbose(), otawa::Loader::load(), otawa::LOAD_PARAM, otawa::LOADER, otawa::LOADER_NAME, loader_plugger, otawa::Processor::LOG, elm::monitor, name, prefixPath(), resetVerbosity(), otawa::XSLTScript::setConfiguration(), setVerbosity(), elm::String::toCString(), elm::StringBuffer::toString(), otawa::XSLTScript::transform(), and WorkSpace.
|
private |
Load an XML configuration file.
path | Path of the XML file. |
props | Property to install the configuration in. |
LoadException | Error during load. |
References _, otawa::PropList::addProps(), elm::xom::Builder::build(), otawa::CONFIG_ELEMENT, cout, elm::xom::Element::getLocalName(), elm::xom::Element::getNamespaceURI(), elm::xom::Document::getRootElement(), isVerbose(), loadBin(), OTAWA_NS, resetVerbosity(), and setVerbosity().
Referenced by load().
ilp::System * otawa::Manager::newILPSystem | ( | String | plugin = "" | ) |
Make an ILP system from the given plugin or from a named plugin.
name | Name of the plugin to use or an empty string for the default plugin. |
References cerr, ilp_plugger, and otawa::ilp::ILPPlugin::newSystem().
Referenced by otawa::WorkSpace::newILPSystem(), and otawa::ipet::ILPSystemGetter::processWorkSpace().
|
static |
Get the prefix path of the OTAWA installation, that is, the installation directory path that allows to retrieve other file resources of OTAWA.
References buildPaths(), and elm::sys::Path::parent().
Referenced by otawa::ProcessorPlugin::init(), and loadBin().
|
private |
elm::system::Path otawa::Manager::retrieveConfig | ( | const elm::system::Path & | path | ) |
Retrieve the file XXX-config.xml matching the path of the given binary.
XXX is usually the name of the instruction set.
Path | to the binary. |
References elm::sys::Path::exists(), and findFileLoader().
|
private |
References otawa::PropList::hasProp(), verbose, otawa::Processor::VERBOSE, and otawa::VERBOSE_ENV.
|
static |
Name of the XML element containing the cache configuration.
Referenced by otawa::hard::Platform::configure().
|
static |
Compilation date of this OTAWA library.
|
private |
Referenced by newILPSystem().
|
private |
Referenced by findFileLoader(), findLoader(), and loadBin().
|
static |
Name of the XML element containing the memory configuration.
Referenced by otawa::hard::Platform::configure().
|
static |
Name of the top element in an OTAWA configuration file.
|
static |
Namespace of otawa elements in an OTAWA configuration file.
Referenced by otawa::hard::Platform::configure(), and loadXML().
|
private |
Referenced by ~Manager().
|
static |
Name of the part describing a processor configuration in an OTAWA configuration file.
Referenced by otawa::hard::Platform::configure().
|
private |
Referenced by findSimulator().
|
private |
Referenced by isVerbose(), resetVerbosity(), and setVerbosity().
|
static |
Current version of sources OTAWA (VCS version).