diff options
Diffstat (limited to 'sim/eventq.hh')
-rw-r--r-- | sim/eventq.hh | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/sim/eventq.hh b/sim/eventq.hh index 11bfe3a4e..ddf4c3198 100644 --- a/sim/eventq.hh +++ b/sim/eventq.hh @@ -104,22 +104,7 @@ class Event : public Serializeable, public FastAlloc * @param queue that the event gets scheduled on */ Event(EventQueue *q, int p = 0) - : Serializeable(defaultName), queue(q), next(NULL), - _priority(p), _flags(None), -#if TRACING_ON - when_created(curTick), when_scheduled(0), -#endif - annotated_value(0) - { - } - - /* - * Event constructor - * @param queue that the event gets scheduled on - */ - Event(EventQueue *q, std::string _name, int p = 0) - : Serializeable(_name), queue(q), next(NULL), - _priority(p), _flags(None), + : queue(q), next(NULL), _priority(p), _flags(None), #if TRACING_ON when_created(curTick), when_scheduled(0), #endif @@ -129,6 +114,10 @@ class Event : public Serializeable, public FastAlloc ~Event() {} + virtual std::string name() const { + return csprintf("%s_%x", defaultName, (uintptr_t)this); + } + /// Determine if the current event is scheduled bool scheduled() const { return getFlags(Scheduled); } @@ -219,12 +208,12 @@ DelayFunction(Tick when, T *object) */ class EventQueue : public Serializeable { + protected: + std::string objName; + private: Event *head; - // only used to hold value between nameChildren() and serialize() - int numAutoSerializeEvents; - void insert(Event *event); void remove(Event *event); @@ -232,9 +221,11 @@ class EventQueue : public Serializeable // constructor EventQueue(const std::string &n) - : Serializeable(n), head(NULL), numAutoSerializeEvents(-1) + : objName(n), head(NULL) {} + virtual std::string name() const { return objName; } + // schedule the given event on this queue void schedule(Event *ev); void deschedule(Event *ev); @@ -266,7 +257,6 @@ class EventQueue : public Serializeable Tick nextEventTime() { return empty() ? curTick : head->when(); } - virtual void nameChildren(); virtual void serialize(std::ostream &os); virtual void unserialize(Checkpoint *cp, const std::string §ion); }; |