# HG changeset patch
# User Korey Sewell <[email protected]>
# Date 1254427253 14400
# Node ID 0760590f19d8517feb0bcc3f8d78f4cb1b57b1cd
# Parent 47663743ca146c41aad078f29c69fc9998f86a27
inorder: set thread status'
set Active/Suspended/Halted status for threads. useful for system when
determining
if/when to exit simulation
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -693,6 +693,8 @@
thread[tid]->lastActivate = curTick;
+ tcBase(tid)->setStatus(ThreadContext::Active);
+
wakeCPU();
}
}
@@ -732,9 +734,11 @@
removePipelineStalls(*thread_it);
- //@TODO: change stage status' to Idle?
+ activeThreads.erase(thread_it);
- activeThreads.erase(thread_it);
+ // Ideally, this should be triggered from the
+ // suspendContext/Thread functions
+ tcBase(tid)->setStatus(ThreadContext::Suspended);
}
assert(!isThreadActive(tid));
@@ -838,6 +842,8 @@
squashThreadInPipeline(tid);
haltedThreads.push_back(tid);
+ tcBase(tid)->setStatus(ThreadContext::Halted);
+
if (threadModel == SwitchOnCacheMiss) {
activateNextReadyContext();
}
@@ -856,6 +862,8 @@
deactivateThread(tid);
suspendedThreads.push_back(tid);
thread[tid]->lastSuspend = curTick;
+
+ tcBase(tid)->setStatus(ThreadContext::Suspended);
}
void
diff --git a/src/cpu/inorder/thread_context.hh
b/src/cpu/inorder/thread_context.hh
--- a/src/cpu/inorder/thread_context.hh
+++ b/src/cpu/inorder/thread_context.hh
@@ -63,7 +63,6 @@
/** Pointer to the thread state that this TC corrseponds to. */
InOrderThreadState *thread;
-
/** Returns a pointer to the ITB. */
/** @TODO: PERF: Should we bind this to a pointer in constructor? */
TheISA::TLB *getITBPtr() { return cpu->getITBPtr(); }
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev