projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Time: Add a mechanism to prevent M5 from running faster than real time.
[gem5.git]
/
src
/
sim
/
eventq.hh
diff --git
a/src/sim/eventq.hh
b/src/sim/eventq.hh
index 7c814d87246c34096aeeb978f53251c6b90581ed..e28c43bb774b8630bb68d470f0dbbe6dc13d7300 100644
(file)
--- a/
src/sim/eventq.hh
+++ b/
src/sim/eventq.hh
@@
-136,7
+136,7
@@
class Event : public Serializable, public FastAlloc
queue = q;
#endif
#ifdef EVENTQ_DEBUG
queue = q;
#endif
#ifdef EVENTQ_DEBUG
- whenScheduled = curTick;
+ whenScheduled = curTick
()
;
#endif
}
#endif
}
@@
-254,7
+254,7
@@
class Event : public Serializable, public FastAlloc
queue = NULL;
#endif
#ifdef EVENTQ_DEBUG
queue = NULL;
#endif
#ifdef EVENTQ_DEBUG
- whenCreated = curTick;
+ whenCreated = curTick
()
;
whenScheduled = 0;
#endif
}
whenScheduled = 0;
#endif
}
@@
-370,10
+370,11
@@
class EventQueue : public Serializable
void insert(Event *event);
void remove(Event *event);
void insert(Event *event);
void remove(Event *event);
+ EventQueue(const EventQueue &);
+ const EventQueue &operator=(const EventQueue &);
+
public:
public:
- EventQueue(const std::string &n)
- : objName(n), head(NULL)
- {}
+ EventQueue(const std::string &n);
virtual const std::string name() const { return objName; }
virtual const std::string name() const { return objName; }
@@
-404,15
+405,15
@@
class EventQueue : public Serializable
}
}
}
}
- // default: process all events up to 'now' (curTick)
- void serviceEvents() { serviceEvents(curTick); }
+ // default: process all events up to 'now' (curTick
()
)
+ void serviceEvents() { serviceEvents(curTick
()
); }
// return true if no events are queued
bool empty() const { return head == NULL; }
void dump() const;
// return true if no events are queued
bool empty() const { return head == NULL; }
void dump() const;
- Tick nextEventTime() { return empty() ? curTick : head->when(); }
+ Tick nextEventTime() { return empty() ? curTick
()
: head->when(); }
bool debugVerify() const;
bool debugVerify() const;
@@
-440,6
+441,11
@@
class EventManager
return eventq;
}
return eventq;
}
+ operator EventQueue *() const
+ {
+ return eventq;
+ }
+
void
schedule(Event &event, Tick when)
{
void
schedule(Event &event, Tick when)
{
@@
-480,7
+486,7
@@
class EventManager
inline void
EventQueue::schedule(Event *event, Tick when)
{
inline void
EventQueue::schedule(Event *event, Tick when)
{
- assert((UTick)when >= (UTick)curTick);
+ assert((UTick)when >= (UTick)curTick
()
);
assert(!event->scheduled());
assert(event->initialized());
assert(!event->scheduled());
assert(event->initialized());
@@
-517,7
+523,7
@@
EventQueue::deschedule(Event *event)
inline void
EventQueue::reschedule(Event *event, Tick when, bool always)
{
inline void
EventQueue::reschedule(Event *event, Tick when, bool always)
{
- assert(when >= curTick);
+ assert(when >= curTick
()
);
assert(always || event->scheduled());
assert(event->initialized());
assert(always || event->scheduled());
assert(event->initialized());
@@
-571,6
+577,13
@@
class EventWrapper : public Event
setFlags(AutoDelete);
}
setFlags(AutoDelete);
}
+ EventWrapper(T &obj, bool del = false, Priority p = Default_Pri)
+ : Event(p), object(&obj)
+ {
+ if (del)
+ setFlags(AutoDelete);
+ }
+
void process() { (object->*F)(); }
const std::string
void process() { (object->*F)(); }
const std::string