summaryrefslogtreecommitdiff
path: root/cpu/o3/iew_impl.hh
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-05-04 11:36:20 -0400
committerKevin Lim <ktlim@umich.edu>2006-05-04 11:36:20 -0400
commitf3358e5f7b6452f14a6df5106129ef0cb2ed8b65 (patch)
tree284685f873ef56b9c9ae95131129c51193d3185f /cpu/o3/iew_impl.hh
parent4601230d35de7bbda5906d04a28e2387f0e5177b (diff)
downloadgem5-f3358e5f7b6452f14a6df5106129ef0cb2ed8b65.tar.xz
O3 CPU now handles being used with the sampler.
cpu/o3/2bit_local_pred.cc: cpu/o3/2bit_local_pred.hh: cpu/o3/bpred_unit.hh: cpu/o3/bpred_unit_impl.hh: cpu/o3/btb.cc: cpu/o3/btb.hh: cpu/o3/commit.hh: cpu/o3/commit_impl.hh: cpu/o3/cpu.cc: cpu/o3/cpu.hh: cpu/o3/decode.hh: cpu/o3/decode_impl.hh: cpu/o3/fetch.hh: cpu/o3/fetch_impl.hh: cpu/o3/fu_pool.cc: cpu/o3/fu_pool.hh: cpu/o3/iew.hh: cpu/o3/iew_impl.hh: cpu/o3/inst_queue.hh: cpu/o3/inst_queue_impl.hh: cpu/o3/lsq.hh: cpu/o3/lsq_impl.hh: cpu/o3/lsq_unit.hh: cpu/o3/lsq_unit_impl.hh: cpu/o3/mem_dep_unit.hh: cpu/o3/mem_dep_unit_impl.hh: cpu/o3/ras.cc: cpu/o3/ras.hh: cpu/o3/rename.hh: cpu/o3/rename_impl.hh: cpu/o3/rob.hh: cpu/o3/rob_impl.hh: cpu/o3/sat_counter.cc: cpu/o3/sat_counter.hh: cpu/o3/thread_state.hh: Handle switching out and taking over. Needs to be able to reset all state. cpu/o3/alpha_cpu_impl.hh: Handle taking over from another XC. --HG-- extra : convert_revision : b936e826f0f8a18319bfa940ff35097b4192b449
Diffstat (limited to 'cpu/o3/iew_impl.hh')
-rw-r--r--cpu/o3/iew_impl.hh56
1 files changed, 52 insertions, 4 deletions
diff --git a/cpu/o3/iew_impl.hh b/cpu/o3/iew_impl.hh
index 2ae2e1361..42d83ee72 100644
--- a/cpu/o3/iew_impl.hh
+++ b/cpu/o3/iew_impl.hh
@@ -55,13 +55,13 @@ DefaultIEW<Impl>::LdWritebackEvent::process()
//iewStage->ldstQueue.removeMSHR(inst->threadNumber,inst->seqNum);
- iewStage->wakeCPU();
-
- if (inst->isSquashed()) {
+ if (inst->isSquashed() || iewStage->isSwitchedOut()) {
inst = NULL;
return;
}
+ iewStage->wakeCPU();
+
if (!inst->isExecuted()) {
inst->setExecuted();
@@ -101,7 +101,8 @@ DefaultIEW<Impl>::DefaultIEW(Params *params)
issueReadWidth(params->issueWidth),
issueWidth(params->issueWidth),
executeWidth(params->executeWidth),
- numThreads(params->numberOfThreads)
+ numThreads(params->numberOfThreads),
+ switchedOut(false)
{
DPRINTF(IEW, "executeIntWidth: %i.\n", params->executeIntWidth);
_status = Active;
@@ -436,6 +437,53 @@ DefaultIEW<Impl>::setPageTable(PageTable *pt_ptr)
}
#endif
+template <class Impl>
+void
+DefaultIEW<Impl>::switchOut()
+{
+ switchedOut = true;
+ instQueue.switchOut();
+ ldstQueue.switchOut();
+ fuPool->switchOut();
+
+ for (int i = 0; i < numThreads; i++) {
+ while (!insts[i].empty())
+ insts[i].pop();
+ while (!skidBuffer[i].empty())
+ skidBuffer[i].pop();
+ }
+}
+
+template <class Impl>
+void
+DefaultIEW<Impl>::takeOverFrom()
+{
+ _status = Active;
+ exeStatus = Running;
+ wbStatus = Idle;
+ switchedOut = false;
+
+ instQueue.takeOverFrom();
+ ldstQueue.takeOverFrom();
+ fuPool->takeOverFrom();
+
+ initStage();
+ cpu->activityThisCycle();
+
+ for (int i=0; i < numThreads; i++) {
+ dispatchStatus[i] = Running;
+ stalls[i].commit = false;
+ fetchRedirect[i] = false;
+ }
+
+ updateLSQNextCycle = false;
+
+ // @todo: Fix hardcoded number
+ for (int i = 0; i < 6; ++i) {
+ issueToExecQueue.advance();
+ }
+}
+
template<class Impl>
void
DefaultIEW<Impl>::squash(unsigned tid)