changeset a7ce656e32a0 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=a7ce656e32a0
description:
eventq: Add some debugging code to the eventq.
diffstat:
1 file changed, 1 insertion(+)
src/sim/eventq.hh | 1 +
diffs (62 lines):
diff -r 7434b2271b0c -r a7ce656e32a0 src/sim/eventq.cc
--- a/src/sim/eventq.cc Mon Dec 08 07:16:40 2008 -0800
+++ b/src/sim/eventq.cc Mon Dec 08 07:17:48 2008 -0800
@@ -59,6 +59,7 @@
Event::~Event()
{
+ assert(!scheduled());
}
const std::string
diff -r 7434b2271b0c -r a7ce656e32a0 src/sim/eventq.hh
--- a/src/sim/eventq.hh Mon Dec 08 07:16:40 2008 -0800
+++ b/src/sim/eventq.hh Mon Dec 08 07:17:48 2008 -0800
@@ -77,6 +77,9 @@
static const FlagsType AutoSerialize = 0x0008;
static const FlagsType IsExitEvent = 0x0010;
static const FlagsType IsMainQueue = 0x0020;
+#ifdef EVENTQ_DEBUG
+ static const FlagsType Initialized = 0xf000;
+#endif
private:
// The event queue is now a linked list of linked lists. The
@@ -245,6 +248,7 @@
queue = NULL;
#endif
#ifdef EVENTQ_DEBUG
+ flags.set(Initialized);
whenCreated = curTick;
whenScheduled = 0;
#endif
@@ -469,6 +473,9 @@
{
assert(when >= curTick);
assert(!event->scheduled());
+#ifdef EVENTQ_DEBUG
+ assert((event->flags & Event::Initialized) == Event::Initialized);
+#endif
event->setWhen(when, this);
insert(event);
@@ -486,6 +493,9 @@
EventQueue::deschedule(Event *event)
{
assert(event->scheduled());
+#ifdef EVENTQ_DEBUG
+ assert((event->flags & Event::Initialized) == Event::Initialized);
+#endif
remove(event);
@@ -504,6 +514,9 @@
{
assert(when >= curTick);
assert(always || event->scheduled());
+#ifdef EVENTQ_DEBUG
+ assert((event->flags & Event::Initialized) == Event::Initialized);
+#endif
if (event->scheduled())
remove(event);
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev