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/pyevent.hh | |
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/pyevent.hh')
-rw-r--r-- | src/python/swig/pyevent.hh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/python/swig/pyevent.hh b/src/python/swig/pyevent.hh index 16af85a84..65e80e9e4 100644 --- a/src/python/swig/pyevent.hh +++ b/src/python/swig/pyevent.hh @@ -32,6 +32,7 @@ #define __PYTHON_SWIG_PYEVENT_HH__ #include "sim/eventq.hh" +#include "sim/sim_events.hh" class PythonEvent : public Event { @@ -45,4 +46,29 @@ class PythonEvent : public Event virtual void process(); }; +inline void +create(PyObject *object, Tick when) +{ + new PythonEvent(object, when); +} + +inline Event * +createCountedDrain() +{ + return new CountedDrainEvent(); +} + +inline void +cleanupCountedDrain(Event *counted_drain) +{ + CountedDrainEvent *event = + dynamic_cast<CountedDrainEvent *>(counted_drain); + if (event == NULL) { + fatal("Called cleanupCountedDrain() on an event that was not " + "a CountedDrainEvent."); + } + assert(event->getCount() == 0); + delete event; +} + #endif // __PYTHON_SWIG_PYEVENT_HH__ |