summaryrefslogtreecommitdiff
path: root/src/cpu/o3/iew_impl.hh
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-09-03 07:42:39 -0400
committerMitch Hayenga <mitch.hayenga@arm.com>2014-09-03 07:42:39 -0400
commit4f13f676aa71efaaae2fcd2587cf032a1d70f774 (patch)
tree1a8dec232d4bd77df2e773e824510959c643d091 /src/cpu/o3/iew_impl.hh
parent283935a6f0a17afe4574cc3c50c043515c866dfa (diff)
downloadgem5-4f13f676aa71efaaae2fcd2587cf032a1d70f774.tar.xz
cpu: Fix cache blocked load behavior in o3 cpu
This patch fixes the load blocked/replay mechanism in the o3 cpu. Rather than flushing the entire pipeline, this patch replays loads once the cache becomes unblocked. Additionally, deferred memory instructions (loads which had conflicting stores), when replayed would not respect the number of functional units (only respected issue width). This patch also corrects that. Improvements over 20% have been observed on a microbenchmark designed to exercise this behavior.
Diffstat (limited to 'src/cpu/o3/iew_impl.hh')
-rw-r--r--src/cpu/o3/iew_impl.hh57
1 files changed, 14 insertions, 43 deletions
diff --git a/src/cpu/o3/iew_impl.hh b/src/cpu/o3/iew_impl.hh
index 0a4e147c4..448be3a74 100644
--- a/src/cpu/o3/iew_impl.hh
+++ b/src/cpu/o3/iew_impl.hh
@@ -530,29 +530,6 @@ DefaultIEW<Impl>::squashDueToMemOrder(DynInstPtr &inst, ThreadID tid)
template<class Impl>
void
-DefaultIEW<Impl>::squashDueToMemBlocked(DynInstPtr &inst, ThreadID tid)
-{
- DPRINTF(IEW, "[tid:%i]: Memory blocked, squashing load and younger insts, "
- "PC: %s [sn:%i].\n", tid, inst->pcState(), inst->seqNum);
- if (!toCommit->squash[tid] ||
- inst->seqNum < toCommit->squashedSeqNum[tid]) {
- toCommit->squash[tid] = true;
-
- toCommit->squashedSeqNum[tid] = inst->seqNum;
- toCommit->pc[tid] = inst->pcState();
- toCommit->mispredictInst[tid] = NULL;
-
- // Must include the broadcasted SN in the squash.
- toCommit->includeSquashInst[tid] = true;
-
- ldstQueue.setLoadBlockedHandled(tid);
-
- wroteToTimeBuffer = true;
- }
-}
-
-template<class Impl>
-void
DefaultIEW<Impl>::block(ThreadID tid)
{
DPRINTF(IEW, "[tid:%u]: Blocking.\n", tid);
@@ -610,6 +587,20 @@ DefaultIEW<Impl>::replayMemInst(DynInstPtr &inst)
template<class Impl>
void
+DefaultIEW<Impl>::blockMemInst(DynInstPtr& inst)
+{
+ instQueue.blockMemInst(inst);
+}
+
+template<class Impl>
+void
+DefaultIEW<Impl>::cacheUnblocked()
+{
+ instQueue.cacheUnblocked();
+}
+
+template<class Impl>
+void
DefaultIEW<Impl>::instToCommit(DynInstPtr &inst)
{
// This function should not be called after writebackInsts in a
@@ -1376,15 +1367,6 @@ DefaultIEW<Impl>::executeInsts()
squashDueToMemOrder(violator, tid);
++memOrderViolationEvents;
- } else if (ldstQueue.loadBlocked(tid) &&
- !ldstQueue.isLoadBlockedHandled(tid)) {
- fetchRedirect[tid] = true;
-
- DPRINTF(IEW, "Load operation couldn't execute because the "
- "memory system is blocked. PC: %s [sn:%lli]\n",
- inst->pcState(), inst->seqNum);
-
- squashDueToMemBlocked(inst, tid);
}
} else {
// Reset any state associated with redirects that will not
@@ -1403,17 +1385,6 @@ DefaultIEW<Impl>::executeInsts()
++memOrderViolationEvents;
}
- if (ldstQueue.loadBlocked(tid) &&
- !ldstQueue.isLoadBlockedHandled(tid)) {
- DPRINTF(IEW, "Load operation couldn't execute because the "
- "memory system is blocked. PC: %s [sn:%lli]\n",
- inst->pcState(), inst->seqNum);
- DPRINTF(IEW, "Blocked load will not be handled because "
- "already squashing\n");
-
- ldstQueue.setLoadBlockedHandled(tid);
- }
-
}
}