summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Hallnor <ehallnor@umich.edu>2004-10-17 00:07:28 -0400
committerErik Hallnor <ehallnor@umich.edu>2004-10-17 00:07:28 -0400
commitfcbfd5a99d05b4e555fcd36b823a37c1c7f94353 (patch)
treeefef17e6d975d64711a2dc83e67f65856e6ca41e
parente6f46d7df7172614f4adfdcc6098aadc6d8a1754 (diff)
parent867a9b84d9d633bed17a8880f84864840b923dfd (diff)
downloadgem5-fcbfd5a99d05b4e555fcd36b823a37c1c7f94353.tar.xz
Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/m5
into zizzer.eecs.umich.edu:/z/ehallnor/work/m5 --HG-- extra : convert_revision : fa4e85d5f5c783985357eb5205fcf8957f214d1e
-rw-r--r--cpu/simple_cpu/simple_cpu.cc9
-rw-r--r--cpu/trace/opt_cpu.cc19
-rw-r--r--cpu/trace/trace_cpu.cc23
-rw-r--r--kern/kernel_stats.cc8
-rw-r--r--kern/system_events.cc1
5 files changed, 50 insertions, 10 deletions
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index 0b45d2b9d..d25f80c6d 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -400,6 +400,15 @@ SimpleCPU::copy(Addr dest)
xc->mem->read(memReq, data);
memReq->paddr = dest_addr;
xc->mem->write(memReq, data);
+ if (dcacheInterface) {
+ memReq->cmd = Copy;
+ memReq->completionEvent = NULL;
+ memReq->paddr = xc->copySrcPhysAddr;
+ memReq->dest = dest_addr;
+ memReq->size = 64;
+ memReq->time = curTick;
+ dcacheInterface->access(memReq);
+ }
}
return fault;
}
diff --git a/cpu/trace/opt_cpu.cc b/cpu/trace/opt_cpu.cc
index 291525c1d..df4197e26 100644
--- a/cpu/trace/opt_cpu.cc
+++ b/cpu/trace/opt_cpu.cc
@@ -52,7 +52,13 @@ OptCPU::OptCPU(const string &name,
numBlks(cache_size/block_size), assoc(_assoc), numSets(numBlks/assoc),
setMask(numSets - 1)
{
- int log_block_size = (int)(log((double) block_size)/log(2.0));
+ int log_block_size = 0;
+ int tmp_block_size = block_size;
+ while (tmp_block_size > 1) {
+ ++log_block_size;
+ tmp_block_size = tmp_block_size >> 1;
+ }
+ assert(1<<log_block_size == block_size);
MemReqPtr req;
trace->getNextReq(req);
refInfo.resize(numSets);
@@ -124,7 +130,7 @@ OptCPU::processSet(int set)
for (int start = assoc/2; start >= 0; --start) {
heapify(set,start);
}
- verifyHeap(set,0);
+ //verifyHeap(set,0);
for (; i < refInfo[set].size(); ++i) {
RefIndex cache_index = lookupValue(refInfo[set][i].addr);
@@ -134,8 +140,11 @@ OptCPU::processSet(int set)
// replace from cacheHeap[0]
// mark replaced block as absent
setValue(refInfo[set][cacheHeap[0]].addr, -1);
+ setValue(refInfo[set][i].addr, 0);
cacheHeap[0] = i;
heapify(set, 0);
+ // Make sure its in the cache
+ assert(lookupValue(refInfo[set][i].addr) != -1);
} else {
// hit
hits++;
@@ -143,9 +152,11 @@ OptCPU::processSet(int set)
refInfo[set][i].addr);
assert(refInfo[set][cacheHeap[cache_index]].nextRefTime == i);
assert(heapLeft(cache_index) >= assoc);
+
+ cacheHeap[cache_index] = i;
+ processRankIncrease(set, cache_index);
+ assert(lookupValue(refInfo[set][i].addr) != -1);
}
- cacheHeap[cache_index] = i;
- processRankIncrease(set, cache_index);
}
}
void
diff --git a/cpu/trace/trace_cpu.cc b/cpu/trace/trace_cpu.cc
index e19509fec..b69793a4b 100644
--- a/cpu/trace/trace_cpu.cc
+++ b/cpu/trace/trace_cpu.cc
@@ -75,9 +75,14 @@ TraceCPU::tick()
icacheInterface->squash(nextReq->asid);
} else {
++instReqs;
- nextReq->completionEvent =
- new TraceCompleteEvent(nextReq, this);
- icacheInterface->access(nextReq);
+ if (icacheInterface->doEvents()) {
+ nextReq->completionEvent =
+ new TraceCompleteEvent(nextReq, this);
+ icacheInterface->access(nextReq);
+ } else {
+ icacheInterface->access(nextReq);
+ completeRequest(nextReq);
+ }
}
} else {
if (dcacheInterface->isBlocked())
@@ -85,9 +90,15 @@ TraceCPU::tick()
++dataReqs;
nextReq->time = curTick;
- nextReq->completionEvent =
- new TraceCompleteEvent(nextReq, this);
- dcacheInterface->access(nextReq);
+ if (dcacheInterface->doEvents()) {
+ nextReq->completionEvent =
+ new TraceCompleteEvent(nextReq, this);
+ dcacheInterface->access(nextReq);
+ } else {
+ dcacheInterface->access(nextReq);
+ completeRequest(nextReq);
+ }
+
}
nextCycle = dataTrace->getNextReq(nextReq);
}
diff --git a/kern/kernel_stats.cc b/kern/kernel_stats.cc
index c08ee08f7..7fd0f31ae 100644
--- a/kern/kernel_stats.cc
+++ b/kern/kernel_stats.cc
@@ -294,6 +294,10 @@ Statistics::serialize(ostream &os)
{
int exemode = themode;
SERIALIZE_SCALAR(exemode);
+ SERIALIZE_SCALAR(idleProcess);
+ SERIALIZE_SCALAR(iplLast);
+ SERIALIZE_SCALAR(iplLastTick);
+ SERIALIZE_SCALAR(lastModeTick);
}
void
@@ -301,6 +305,10 @@ Statistics::unserialize(Checkpoint *cp, const string &section)
{
int exemode;
UNSERIALIZE_SCALAR(exemode);
+ UNSERIALIZE_SCALAR(idleProcess);
+ UNSERIALIZE_SCALAR(iplLast);
+ UNSERIALIZE_SCALAR(iplLastTick);
+ UNSERIALIZE_SCALAR(lastModeTick);
themode = (cpu_mode)exemode;
}
diff --git a/kern/system_events.cc b/kern/system_events.cc
index b6526d193..9acf2f65a 100644
--- a/kern/system_events.cc
+++ b/kern/system_events.cc
@@ -70,6 +70,7 @@ void
IdleStartEvent::process(ExecContext *xc)
{
xc->kernelStats->setIdleProcess(xc->regs.ipr[AlphaISA::IPR_PALtemp23]);
+ remove();
}
void