summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:41 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:41 -0400
commit8c0def8d0347e9a7b84f21895c5cbd94eba9a09a (patch)
tree4b3e65bde6e55cdf9c1512c247cb52ce8a9adb08 /src
parent5ef0b7a9db3c6ec4ca191c2e9381719e1e694873 (diff)
downloadgem5-8c0def8d0347e9a7b84f21895c5cbd94eba9a09a.tar.xz
inorder: use trapPending flag to manage traps
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/cpu.cc8
-rw-r--r--src/cpu/inorder/cpu.hh2
-rw-r--r--src/cpu/inorder/resources/graduation_unit.cc4
3 files changed, 10 insertions, 4 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index 365b2f18a..158489f86 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -149,6 +149,7 @@ InOrderCPU::CPUEvent::process()
DPRINTF(InOrderCPU, "Trapping CPU\n");
cpu->trap(fault, tid, inst);
cpu->resPool->trap(fault, tid, inst);
+ cpu->trapPending[tid] = false;
break;
#if !FULL_SYSTEM
@@ -359,6 +360,8 @@ InOrderCPU::InOrderCPU(Params *params)
dummyTrapInst[tid]->setTid(tid);
#endif
+ trapPending[tid] = false;
+
}
dummyReqInst = new InOrderDynInst(this, NULL, 0, 0, 0);
@@ -698,8 +701,8 @@ InOrderCPU::tick()
++numCycles;
+ checkForInterrupts();
bool pipes_idle = true;
-
//Tick each of the stages
for (int stNum=NumStages - 1; stNum >= 0 ; stNum--) {
pipelineStage[stNum]->tick();
@@ -707,8 +710,6 @@ InOrderCPU::tick()
pipes_idle = pipes_idle && pipelineStage[stNum]->idle;
}
- checkForInterrupts();
-
if (pipes_idle)
idleCycles++;
else
@@ -902,6 +903,7 @@ void
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
{
scheduleCpuEvent(Trap, fault, tid, inst, delay);
+ trapPending[tid] = true;
}
void
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh
index a1e92f302..a5616f8b1 100644
--- a/src/cpu/inorder/cpu.hh
+++ b/src/cpu/inorder/cpu.hh
@@ -667,6 +667,8 @@ class InOrderCPU : public BaseCPU
*/
std::queue<ListIt> removeList;
+ bool trapPending[ThePipeline::MaxThreads];
+
/** List of all the cpu event requests that will be removed at the end of
* the current cycle.
*/
diff --git a/src/cpu/inorder/resources/graduation_unit.cc b/src/cpu/inorder/resources/graduation_unit.cc
index ebcf40c6a..c69e55512 100644
--- a/src/cpu/inorder/resources/graduation_unit.cc
+++ b/src/cpu/inorder/resources/graduation_unit.cc
@@ -66,7 +66,9 @@ GraduationUnit::execute(int slot_num)
return;
}
- if (lastFaultTick[tid] == cur_tick) {
+ //@todo: use trap Pending
+ if (cpu->trapPending[tid]) {
+ //if (lastFaultTick[tid] == cur_tick) {
DPRINTF(InOrderGraduation, "Unable to graduate [sn:%i]. "
"Only 1 fault can be handled per tick.\n");
grad_req->done(false);