summaryrefslogtreecommitdiff
path: root/src/cpu/o3/decode_impl.hh
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-09-03 07:42:34 -0400
committerMitch Hayenga <mitch.hayenga@arm.com>2014-09-03 07:42:34 -0400
commit1716749c8cec6f9c9f10a0aeaff981be759bb4e5 (patch)
tree0e789e02e642227ae170a18782daf05666f7316a /src/cpu/o3/decode_impl.hh
parent976f27487b57e968a326752fcf74747427733df6 (diff)
downloadgem5-1716749c8cec6f9c9f10a0aeaff981be759bb4e5.tar.xz
cpu: Fix o3 front-end pipeline interlock behavior
The o3 pipeline interlock/stall logic is incorrect. o3 unnecessicarily stalled fetch and decode due to later stages in the pipeline. In general, a stage should usually only consider if it is stalled by the adjacent, downstream stage. Forcing stalls due to later stages creates and results in bubbles in the pipeline. Additionally, o3 stalled the entire frontend (fetch, decode, rename) on a branch mispredict while the ROB is being serially walked to update the RAT (robSquashing). Only should have stalled at rename.
Diffstat (limited to 'src/cpu/o3/decode_impl.hh')
-rw-r--r--src/cpu/o3/decode_impl.hh55
1 files changed, 15 insertions, 40 deletions
diff --git a/src/cpu/o3/decode_impl.hh b/src/cpu/o3/decode_impl.hh
index c66f488a5..93d04a8f7 100644
--- a/src/cpu/o3/decode_impl.hh
+++ b/src/cpu/o3/decode_impl.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012, 2014 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -95,8 +95,6 @@ DefaultDecode<Impl>::resetStage()
decodeStatus[tid] = Idle;
stalls[tid].rename = false;
- stalls[tid].iew = false;
- stalls[tid].commit = false;
}
}
@@ -206,6 +204,17 @@ DefaultDecode<Impl>::drainSanityCheck() const
}
}
+template <class Impl>
+bool
+DefaultDecode<Impl>::isDrained() const
+{
+ for (ThreadID tid = 0; tid < numThreads; ++tid) {
+ if (!insts[tid].empty() || !skidBuffer[tid].empty())
+ return false;
+ }
+ return true;
+}
+
template<class Impl>
bool
DefaultDecode<Impl>::checkStall(ThreadID tid) const
@@ -215,12 +224,6 @@ DefaultDecode<Impl>::checkStall(ThreadID tid) const
if (stalls[tid].rename) {
DPRINTF(Decode,"[tid:%i]: Stall fom Rename stage detected.\n", tid);
ret_val = true;
- } else if (stalls[tid].iew) {
- DPRINTF(Decode,"[tid:%i]: Stall fom IEW stage detected.\n", tid);
- ret_val = true;
- } else if (stalls[tid].commit) {
- DPRINTF(Decode,"[tid:%i]: Stall fom Commit stage detected.\n", tid);
- ret_val = true;
}
return ret_val;
@@ -395,10 +398,10 @@ DefaultDecode<Impl>::skidInsert(ThreadID tid)
assert(tid == inst->threadNumber);
- DPRINTF(Decode,"Inserting [sn:%lli] PC: %s into decode skidBuffer %i\n",
- inst->seqNum, inst->pcState(), inst->threadNumber);
-
skidBuffer[tid].push(inst);
+
+ DPRINTF(Decode,"Inserting [tid:%d][sn:%lli] PC: %s into decode skidBuffer %i\n",
+ inst->threadNumber, inst->seqNum, inst->pcState(), skidBuffer[tid].size());
}
// @todo: Eventually need to enforce this by not letting a thread
@@ -483,24 +486,6 @@ DefaultDecode<Impl>::readStallSignals(ThreadID tid)
assert(stalls[tid].rename);
stalls[tid].rename = false;
}
-
- if (fromIEW->iewBlock[tid]) {
- stalls[tid].iew = true;
- }
-
- if (fromIEW->iewUnblock[tid]) {
- assert(stalls[tid].iew);
- stalls[tid].iew = false;
- }
-
- if (fromCommit->commitBlock[tid]) {
- stalls[tid].commit = true;
- }
-
- if (fromCommit->commitUnblock[tid]) {
- assert(stalls[tid].commit);
- stalls[tid].commit = false;
- }
}
template <class Impl>
@@ -529,16 +514,6 @@ DefaultDecode<Impl>::checkSignalsAndUpdate(ThreadID tid)
return true;
}
- // Check ROB squash signals from commit.
- if (fromCommit->commitInfo[tid].robSquashing) {
- DPRINTF(Decode, "[tid:%u]: ROB is still squashing.\n", tid);
-
- // Continue to squash.
- decodeStatus[tid] = Squashing;
-
- return true;
- }
-
if (checkStall(tid)) {
return block(tid);
}