Otawa  0.10
State.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * State class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2006-08, 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_SIM_STATE_H
23 #define OTAWA_SIM_STATE_H
24 
25 #include <otawa/base.h>
26 #include <otawa/sim/Driver.h>
27 #include <otawa/prop/PropList.h>
28 
29 namespace otawa {
30 
31 // External classes
32 class Inst;
33 class Process;
34 
35 namespace sim {
36 
37 // State class
38 class State: public PropList {
39 protected:
40  virtual ~State(void);
41 public:
42  virtual State *clone(void) = 0;
43  virtual void run(Driver& driver) = 0;
44  virtual void stop(void) = 0;
45  virtual void flush(void) = 0;
46  virtual int cycle(void) = 0;
47  virtual void reset(void) = 0;
48  virtual Process *process(void) = 0;
49 };
50 
51 } } // otawa::sim
52 
53 #endif /* OTAWA_SIM_STATE_H */
virtual void run(Driver &driver)=0
Run the simulator with the given driver.
virtual ~State(void)
Definition: sim_State.cpp:39
virtual void flush(void)=0
Run the simulator, preventing the instruction fetch, until the pipeline is empty. ...
virtual void reset(void)=0
Reset the cycle counter.
This class is used to drive a simulator.
Definition: Driver.h:23
A process is the realization of a program on a platform.
Definition: Process.h:136
virtual Process * process(void)=0
Get the process where the simulator is running in.
virtual State * clone(void)=0
Build a copy of the current simulation state.
virtual int cycle(void)=0
Return the number of running cycles.
This a list of properties.
Definition: PropList.h:63
This class represents a running simulator.
Definition: State.h:38
virtual void stop(void)=0
Stop the simulator at the end of the current cycle.