diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 06:24:01 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 06:24:01 +0000 |
commit | 68ad1533096ab736c534cb29364a1a93e1010306 (patch) | |
tree | 1499c0085d1e4de76b37827e6d691f91364bc396 /src/python/swig/event.i | |
parent | 23dc5099a4bca9e38a286d867c4eccd7db3c09c1 (diff) | |
parent | ffe6bebb05c30b0f1d7cde5ad5b94a2551938630 (diff) | |
download | gem5-68ad1533096ab736c534cb29364a1a93e1010306.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem-sparc32
--HG--
extra : convert_revision : bbd0def502e423e64e2c4f6415a4b043b60c7f90
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 |