Otawa  0.10
Simulator.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2006, IRIT-UPS <casse@irit.fr>.
4  *
5  * otawa/sim/Simulator.h -- Simulator class interface.
6  */
7 #ifndef OTAWA_SIM_SIMULATOR_H
8 #define OTAWA_SIM_SIMULATOR_H
9 
10 #include <otawa/hard/Platform.h>
11 #include <elm/system/Plugin.h>
12 #include <otawa/properties.h>
13 
14 namespace otawa {
15 
16 // External class
17 class WorkSpace;
18 
19 namespace sim {
20 class State;
21 
22 // Definitions
23 #define OTAWA_SIMULATOR_HOOK sim_plugin
24 #define OTAWA_SIMULATOR_NAME "sim_plugin"
25 #define OTAWA_SIMULATOR_VERSION Version(1, 0, 0)
26 
27 
28 // Simulator configuration
29 extern Identifier<bool> IS_FUNCTIONAL;
30 extern Identifier<bool> IS_STRUCTURAL;
31 extern Identifier<bool> USE_MEMORY;
32 extern Identifier<bool> USE_CONTROL;
33 
34 
35 // Simulator class
36 class Simulator: public elm::system::Plugin {
37 public:
39  const elm::Version& version,
40  const elm::Version& plugger_version);
41  virtual State *instantiate(WorkSpace *fw,
42  const PropList& props = PropList::EMPTY) = 0;
43 };
44 
45 // Exception
47  elm::String header(const Simulator& sim, const elm::CString message);
48 public:
49  Exception(const Simulator& sim, const string& message);
50 };
51 
52 } } // otawa::sim
53 
54 #endif /* OTAWA_SIM_SIMULATOR_H */
elm::String header(const Simulator &sim, const elm::CString message)
Build the message with plug-in information.
Definition: sim_Simulator.cpp:95
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
Exception generated by a simulator.
Definition: Simulator.h:46
virtual State * instantiate(WorkSpace *fw, const PropList &props=PropList::EMPTY)=0
This method instantiate a new simulator using the given framework.
Base class of Otawa exceptions.
Definition: base.h:168
Identifier< bool > USE_MEMORY
Activate or unactivate the memory management.
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
Identifier< bool > USE_CONTROL
Activate or unactivate the control management.
cstring name
Definition: odisasm.cpp:107
Exception(void)
Build an empty exception.
Definition: base.cpp:36
This a list of properties.
Definition: PropList.h:63
virtual String message(void)
This class represents a running simulator.
Definition: State.h:38
Identifier< bool > IS_FUNCTIONAL
If supported by the simulator, enable or disable the functional part.
Identifier< bool > IS_STRUCTURAL
If supported by the simulator, enable or disable the structural part.
Simulator(elm::CString name, const elm::Version &version, const elm::Version &plugger_version)
Build a new simulator plugin.
Definition: sim_Simulator.cpp:57