summaryrefslogtreecommitdiff
path: root/src/cpu/o3
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/o3')
-rw-r--r--src/cpu/o3/commit_impl.hh1
-rw-r--r--src/cpu/o3/cpu.hh16
-rwxr-xr-xsrc/cpu/o3/thread_context_impl.hh3
3 files changed, 15 insertions, 5 deletions
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index 0d9952df4..f218cc76a 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -505,6 +505,7 @@ DefaultCommit<Impl>::generateTrapEvent(ThreadID tid)
cpu->schedule(trap, curTick() + trapLatency);
trapInFlight[tid] = true;
+ thread[tid]->trapPending = true;
}
template <class Impl>
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh
index 7095e52ec..dd9f5d40f 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -184,9 +184,19 @@ class FullO3CPU : public BaseO3CPU
if (activateThreadEvent[tid].squashed())
reschedule(activateThreadEvent[tid],
nextCycle(curTick() + ticks(delay)));
- else if (!activateThreadEvent[tid].scheduled())
- schedule(activateThreadEvent[tid],
- nextCycle(curTick() + ticks(delay)));
+ else if (!activateThreadEvent[tid].scheduled()) {
+ Tick when = nextCycle(curTick() + ticks(delay));
+
+ // Check if the deallocateEvent is also scheduled, and make
+ // sure they do not happen at same time causing a sleep that
+ // is never woken from.
+ if (deallocateContextEvent[tid].scheduled() &&
+ deallocateContextEvent[tid].when() == when) {
+ when++;
+ }
+
+ schedule(activateThreadEvent[tid], when);
+ }
}
/** Unschedule actiavte thread event, regardless of its current state. */
diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh
index c3b7d2248..4888cf92e 100755
--- a/src/cpu/o3/thread_context_impl.hh
+++ b/src/cpu/o3/thread_context_impl.hh
@@ -351,8 +351,7 @@ O3ThreadContext<Impl>::setMiscRegNoEffect(int misc_reg, const MiscReg &val)
template <class Impl>
void
-O3ThreadContext<Impl>::setMiscReg(int misc_reg,
- const MiscReg &val)
+O3ThreadContext<Impl>::setMiscReg(int misc_reg, const MiscReg &val)
{
cpu->setMiscReg(misc_reg, val, thread->threadId());