changeset fa2370a92498 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=fa2370a92498
description:
inorder: use trapPending flag to manage traps
diffstat:
src/cpu/inorder/cpu.cc | 8 +++++---
src/cpu/inorder/cpu.hh | 2 ++
src/cpu/inorder/resources/graduation_unit.cc | 4 +++-
3 files changed, 10 insertions(+), 4 deletions(-)
diffs (73 lines):
diff -r 0cce97fe6390 -r fa2370a92498 src/cpu/inorder/cpu.cc
--- a/src/cpu/inorder/cpu.cc Sun Jun 19 21:43:41 2011 -0400
+++ b/src/cpu/inorder/cpu.cc Sun Jun 19 21:43:41 2011 -0400
@@ -149,6 +149,7 @@
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 @@
dummyTrapInst[tid]->setTid(tid);
#endif
+ trapPending[tid] = false;
+
}
dummyReqInst = new InOrderDynInst(this, NULL, 0, 0, 0);
@@ -698,8 +701,8 @@
++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 @@
pipes_idle = pipes_idle && pipelineStage[stNum]->idle;
}
- checkForInterrupts();
-
if (pipes_idle)
idleCycles++;
else
@@ -902,6 +903,7 @@
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
{
scheduleCpuEvent(Trap, fault, tid, inst, delay);
+ trapPending[tid] = true;
}
void
diff -r 0cce97fe6390 -r fa2370a92498 src/cpu/inorder/cpu.hh
--- a/src/cpu/inorder/cpu.hh Sun Jun 19 21:43:41 2011 -0400
+++ b/src/cpu/inorder/cpu.hh Sun Jun 19 21:43:41 2011 -0400
@@ -667,6 +667,8 @@
*/
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 -r 0cce97fe6390 -r fa2370a92498
src/cpu/inorder/resources/graduation_unit.cc
--- a/src/cpu/inorder/resources/graduation_unit.cc Sun Jun 19 21:43:41
2011 -0400
+++ b/src/cpu/inorder/resources/graduation_unit.cc Sun Jun 19 21:43:41
2011 -0400
@@ -66,7 +66,9 @@
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);
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev