Otawa  0.10
Manager.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Manager class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2003-09, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_MANAGER_H
23 #define OTAWA_MANAGER_H
24 
25 #include <elm/system/Path.h>
26 #include <elm/genstruct/Vector.h>
27 #include <elm/util/MessageException.h>
28 #include <elm/xom.h>
29 #include <elm/system/Plugger.h>
30 #include <otawa/properties.h>
31 #include <otawa/base.h>
32 
33 namespace otawa {
34 
35 using namespace elm;
36 
37 // Classes
38 class File;
39 class Loader;
40 class Manager;
41 class WorkSpace;
42 namespace hard {
43  class CacheConfiguration;
44  class Memory;
45  class Platform;
46  class Processor;
47 }
48 namespace ilp { class System; }
49 namespace sim { class Simulator; }
50 
51 // LoadException class
53 public:
54  LoadException(const elm::String& message);
55 };
56 
57 // Manager class
58 class Manager {
59  friend class WorkSpace;
60 public:
61  static const cstring
62  OTAWA_NS,
63  OTAWA_NAME,
64  PROCESSOR_NAME,
65  CACHE_CONFIG_NAME,
66  MEMORY_NAME,
67  COMPILATION_DATE,
68  VERSION;
69  static elm::system::Path prefixPath(void);
70  static String buildPaths(cstring kind, string paths = "");
71 
72  Manager(void);
73  ~Manager(void);
74  Loader *findLoader(elm::CString name);
75  sim::Simulator *findSimulator(elm::CString name);
76  WorkSpace *load(const elm::system::Path& path,
77  const PropList& props = PropList::EMPTY);
78  WorkSpace *load(const PropList& props = PropList::EMPTY);
79  WorkSpace *load(xom::Element *elem, const PropList& props = PropList::EMPTY);
80  ilp::System *newILPSystem(String plugin = "");
81  elm::system::Path retrieveConfig(const elm::system::Path& path);
82  Loader *findFileLoader(const elm::system::Path& path);
83 
84 private:
85  WorkSpace *loadBin(const elm::system::Path& path, const PropList& props);
86  WorkSpace *loadXML(const elm::system::Path& path, const PropList& props);
87 
89  elm::system::Plugger ilp_plugger;
90  elm::system::Plugger loader_plugger;
91  elm::system::Plugger sim_plugger;
92  bool isVerbose(void);
93  void setVerbosity(const PropList& props);
94  void resetVerbosity(void);
95  int verbose;
96 };
97 
98 // Configuration Properties
105 extern Identifier<int> ARGC;
114 
117 
121 
125 
129 
131 
132 } // otawa
133 
134 #endif // OTAWA_MANAGER_H
genstruct::Vector< hard::Platform * > platforms
Definition: Manager.h:88
Identifier< elm::xom::Element * > CACHE_CONFIG_ELEMENT
Gives an XML element containing the cache configuration.
Identifier< elm::CString > SIMULATOR_NAME
Name of the simulator to use.
int verbose
Definition: Manager.h:95
Identifier< bool > NO_SYSTEM
This property shows that the system does not need to by simulated when the binary image is built...
Identifier< Loader * > LOADER
Identifier of the property indicating the loader to use.
Identifier< hard::Memory * > MEMORY_OBJECT
Passed to manager::load() to set the memory configuration.
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
This class represents a plugin to use facilities provided by a simulator.
Definition: Simulator.h:36
Identifier< string > TASK_ENTRY
This property, passed to the load configuration, gives the name of the entry function of the current ...
static const cstring VERSION
Current version of sources OTAWA (VCS version).
Definition: Manager.h:62
Identifier< hard::Platform * > PLATFORM
Identifier of the property indicating a platform (Platform *) to use.
Identifier< hard::CacheConfiguration * > CACHE_CONFIG
This property is used to pass the cache configuration directly to the platform.
Identifier< sim::Simulator * > SIMULATOR
This property defines the used the used simulator when a simulator is needed to perform simulation...
The manager class providesfacilities for storing, grouping and retrieving shared resources like loade...
Definition: Manager.h:58
Inst::kind_t kind
Definition: odisasm.cpp:106
Identifier< int > ARGC
Argument count as passed to the program (int).
Identifier< int > PIPELINE_DEPTH
This property is a hint to have an estimation of the pipeline depth.
Identifier< elm::system::Path > CACHE_CONFIG_PATH
Gives the path of file containing the cache configuration.
Identifier< string > NO_RETURN_FUNCTION
this property may be used to pass information about the non-returning behaviour of some functions...
elm::system::Plugger ilp_plugger
Definition: Manager.h:89
Identifier< elm::xom::Element * > MEMORY_ELEMENT
Passed to manager::load() to give the XML element describing the memory configuration.
Identifier< char ** > ENVP
Argument values as passed to the program (char **).
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
inst load(int d, int a, int t)
Definition: inst.h:153
Identifier< elm::system::Path > CONFIG_PATH
Path to the XML configuration file used in this computation.
Identifier< elm::CString > PLATFORM_NAME
Identifier of the property indicating the name (CString) of the platform to use.
elm::system::Plugger loader_plugger
Definition: Manager.h:90
Identifier< elm::system::Path > PROCESSOR_PATH
Path to the XML configuration file of the processor.
This interface is implemented by all objects that may build and provide a process.
Definition: Loader.h:31
Identifier< hard::Processor * > PROCESSOR
Gives the processor to use in the current computation.
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
Identifier< elm::xom::Element * > CONFIG_ELEMENT
XML element containing the configuration of the current computation.
cstring name
Definition: odisasm.cpp:107
Exception thrown when a loader encounters an error during load.
Definition: Manager.h:52
Identifier< bool > NO_STACK
This property shows that no stack need to be allocated.
This a list of properties.
Definition: PropList.h:63
Identifier< char ** > ARGV
Argument values as passed to the program (char **).
Identifier< string > LOAD_PARAM
Identifier used for Manager::load() configuration.
Identifier< elm::CString > LOADER_NAME
Identifier of the property indicating a name (CString) of the loader to use.
Identifier< Address > TASK_ADDRESS
This property, passed to the load configuration, select the task entry by its address.
An ILP system is a colletion of ILP constraint that may maximize or minimize some object function...
Definition: System.h:42
Identifier< elm::system::Path > MEMORY_PATH
Passed to Manager::load() to give the path of the file describing the memory.
elm::system::Plugger sim_plugger
Definition: Manager.h:91
Identifier< elm::xom::Element * > PROCESSOR_ELEMENT
XML element containing the configuration of the processor.