diff options
author | Korey Sewell <ksewell@umich.edu> | 2010-01-31 18:28:12 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2010-01-31 18:28:12 -0500 |
commit | b4e0ef78379dd5bab0ee6ec824bca3f51dd484c6 (patch) | |
tree | cffa5e792f60039a4a2289fadb2d057d5084478d /src/cpu/inorder/cpu.cc | |
parent | 5e0b8337ed9c8aa975cd44df5565c2c3dde0c267 (diff) | |
download | gem5-b4e0ef78379dd5bab0ee6ec824bca3f51dd484c6.tar.xz |
inorder: set thread status'
set Active/Suspended/Halted status for threads. useful for system when determining
if/when to exit simulation
Diffstat (limited to 'src/cpu/inorder/cpu.cc')
-rw-r--r-- | src/cpu/inorder/cpu.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc index 5db86b258..d8fea79d9 100644 --- a/src/cpu/inorder/cpu.cc +++ b/src/cpu/inorder/cpu.cc @@ -711,6 +711,8 @@ InOrderCPU::activateThread(ThreadID tid) thread[tid]->lastActivate = curTick; + tcBase(tid)->setStatus(ThreadContext::Active); + wakeCPU(); } } @@ -750,9 +752,11 @@ InOrderCPU::deactivateThread(ThreadID tid) removePipelineStalls(*thread_it); - //@TODO: change stage status' to Idle? - activeThreads.erase(thread_it); + + // Ideally, this should be triggered from the + // suspendContext/Thread functions + tcBase(tid)->setStatus(ThreadContext::Suspended); } assert(!isThreadActive(tid)); @@ -854,6 +858,8 @@ InOrderCPU::haltThread(ThreadID tid) squashThreadInPipeline(tid); haltedThreads.push_back(tid); + tcBase(tid)->setStatus(ThreadContext::Halted); + if (threadModel == SwitchOnCacheMiss) { activateNextReadyContext(); } @@ -872,6 +878,8 @@ InOrderCPU::suspendThread(ThreadID tid) deactivateThread(tid); suspendedThreads.push_back(tid); thread[tid]->lastSuspend = curTick; + + tcBase(tid)->setStatus(ThreadContext::Suspended); } void |