diff options
author | Nathan Binkert <binkertn@umich.edu> | 2007-03-02 22:24:00 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2007-03-02 22:24:00 -0800 |
commit | ffe6bebb05c30b0f1d7cde5ad5b94a2551938630 (patch) | |
tree | f74e494de8f3ae1ac176d2c60c0fa77e470dbde2 /src/python/swig/event.i | |
parent | 4e8d2d1593475008b926829e6944a59963166079 (diff) | |
download | gem5-ffe6bebb05c30b0f1d7cde5ad5b94a2551938630.tar.xz |
Factor code out of main.cc and main.i into a bunch of files
so things are organized in a more sensible manner. Take apart
finalInit and expose the individual functions which are now
called from python. Make checkpointing a bit easier to use.
--HG--
extra : convert_revision : f470ddabbb47103e7b4734ef753c40089f2dcd9d
Diffstat (limited to 'src/python/swig/event.i')
-rw-r--r-- | src/python/swig/event.i | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/python/swig/event.i b/src/python/swig/event.i index 554c9fa0e..51d7d89f0 100644 --- a/src/python/swig/event.i +++ b/src/python/swig/event.i @@ -33,19 +33,48 @@ %{ #include "python/swig/pyevent.hh" -inline void -create(PyObject *object, Tick when) -{ - new PythonEvent(object, when); -} +#include "sim/sim_events.hh" +#include "sim/sim_exit.hh" +#include "sim/simulate.hh" %} %include "stdint.i" +%include "std_string.i" %include "sim/host.hh" -%inline %{ -extern void create(PyObject *object, Tick when); -%} +void create(PyObject *object, Tick when); + +class Event; +class CountedDrainEvent : public Event { + public: + void setCount(int _count); +}; + +CountedDrainEvent *createCountedDrain(); +void cleanupCountedDrain(Event *drain_event); + +%immutable curTick; +Tick curTick; + +// minimal definition of SimExitEvent interface to wrap +class SimLoopExitEvent { + public: + std::string getCause(); + int getCode(); + SimLoopExitEvent(EventQueue *q, Tick _when, Tick _repeat, + const std::string &_cause, int c = 0); +}; + +%exception simulate { + $action + if (!result) { + return NULL; + } +} +SimLoopExitEvent *simulate(Tick num_cycles = MaxTick); +void exitSimLoop(const std::string &message, int exit_code); + +Tick curTick; %wrapper %{ // fix up module name to reflect the fact that it's inside the m5 package |