Otawa  0.10
otawa::Manager Class Reference

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...
 
LoaderfindLoader (elm::CString name)
 Find the loader matching the given name. More...
 
sim::SimulatorfindSimulator (elm::CString name)
 Find the simulator matching the given name. More...
 
WorkSpaceload (const elm::system::Path &path, const PropList &props=PropList::EMPTY)
 Load a file with the given path and the given properties. More...
 
WorkSpaceload (const PropList &props=PropList::EMPTY)
 Load a computation configuration from the given properties. More...
 
WorkSpaceload (xom::Element *elem, const PropList &props=PropList::EMPTY)
 Load the framework from an XML configuration. More...
 
ilp::SystemnewILPSystem (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...
 
LoaderfindFileLoader (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

WorkSpaceloadBin (const elm::system::Path &path, const PropList &props)
 Load a binary file. More...
 
WorkSpaceloadXML (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
 

Detailed Description

The manager class providesfacilities for storing, grouping and retrieving shared resources like loaders and platforms.

Constructor & Destructor Documentation

otawa::Manager::Manager ( void  )

Manager builder.

Install the PPC GLISS loader.

References resetVerbosity().

otawa::Manager::~Manager ( void  )

Delete all used resources.

References elm::genstruct::Vector< T >::length(), and platforms.

Member Function Documentation

String otawa::Manager::buildPaths ( cstring  kind,
string  paths = "" 
)
static

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.

Parameters
pathPath to the looked file.
Returns
Found loader or NULL.

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.

Parameters
nameName of the loader to find.
Returns
Found loader or null.
Note
This function should also perform dynamic loading of shared library.

References loader_plugger.

Referenced by findFileLoader(), and loadBin().

sim::Simulator * otawa::Manager::findSimulator ( elm::CString  name)

Find the simulator matching the given name.

Parameters
nameName of the simulator to load.

References sim_plugger.

Referenced by otawa::Process::simulator().

bool otawa::Manager::isVerbose ( void  )
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.

Parameters
pathPath of the file to load.
propsConfiguration properties.
Returns
The loaded workspace or null.

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:

  • $HOME/.otawa/loader
  • $PWD/.otawa/loader
  • <installation directory>="">/lib/otawa/loader

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.

Parameters
propsConfiguration properties.
Returns
Load workspace.
Exceptions
LoadExceptionError 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.

Parameters
elemTop element of the configuration.
propsConfiguration properties.
Returns
Built workspace.
Exceptions
LoadExceptionError during load.

References bin(), elm::xom::Element::getAttributeValue(), elm::xom::Element::getFirstChildElement(), loadBin(), and resetVerbosity().

WorkSpace * otawa::Manager::loadBin ( const elm::system::Path &  path,
const PropList props 
)
private
WorkSpace * otawa::Manager::loadXML ( const elm::system::Path &  path,
const PropList props 
)
private

Load an XML configuration file.

Parameters
pathPath of the XML file.
propsProperty to install the configuration in.
Returns
Loaded workspace.
Exceptions
LoadExceptionError 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.

Parameters
nameName of the plugin to use or an empty string for the default plugin.
Returns
A new ILP system ready to use or null (plugin not available).

References cerr, ilp_plugger, and otawa::ilp::ILPPlugin::newSystem().

Referenced by otawa::WorkSpace::newILPSystem(), and otawa::ipet::ILPSystemGetter::processWorkSpace().

elm::system::Path otawa::Manager::prefixPath ( void  )
static

Get the prefix path of the OTAWA installation, that is, the installation directory path that allows to retrieve other file resources of OTAWA.

Returns
Prefix path.

References buildPaths(), and elm::sys::Path::parent().

Referenced by otawa::ProcessorPlugin::init(), and loadBin().

void otawa::Manager::resetVerbosity ( void  )
private

References verbose.

Referenced by findFileLoader(), load(), loadBin(), loadXML(), and Manager().

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.

Parameters
Pathto the binary.
Returns
Path to the configuration file if any, false else.

References elm::sys::Path::exists(), and findFileLoader().

void otawa::Manager::setVerbosity ( const PropList props)
private

Friends And Related Function Documentation

friend class WorkSpace
friend

Referenced by loadBin().

Member Data Documentation

const CString otawa::Manager::CACHE_CONFIG_NAME = "cache-config"
static

Name of the XML element containing the cache configuration.

Referenced by otawa::hard::Platform::configure().

const cstring otawa::Manager::COMPILATION_DATE = OTAWA_DATE
static

Compilation date of this OTAWA library.

elm::system::Plugger otawa::Manager::ilp_plugger
private

Referenced by newILPSystem().

elm::system::Plugger otawa::Manager::loader_plugger
private

Referenced by findFileLoader(), findLoader(), and loadBin().

const CString otawa::Manager::MEMORY_NAME = "memory"
static

Name of the XML element containing the memory configuration.

Referenced by otawa::hard::Platform::configure().

const CString otawa::Manager::OTAWA_NAME = "otawa"
static

Name of the top element in an OTAWA configuration file.

const CString otawa::Manager::OTAWA_NS = "http://www.irit.fr/recherches/ARCHI/MARCH"
static

Namespace of otawa elements in an OTAWA configuration file.

Referenced by otawa::hard::Platform::configure(), and loadXML().

genstruct::Vector<hard::Platform *> otawa::Manager::platforms
private

Referenced by ~Manager().

const CString otawa::Manager::PROCESSOR_NAME = "processor"
static

Name of the part describing a processor configuration in an OTAWA configuration file.

Referenced by otawa::hard::Platform::configure().

elm::system::Plugger otawa::Manager::sim_plugger
private

Referenced by findSimulator().

int otawa::Manager::verbose
private
const cstring otawa::Manager::VERSION = OTAWA_VERSION
static

Current version of sources OTAWA (VCS version).


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