summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-06-09 12:28:11 -0400
committerKevin Lim <ktlim@umich.edu>2006-06-09 12:28:11 -0400
commit02606ebb26dcdd9e370a72b22aaad11d1b14ac60 (patch)
tree8fd34ce775c8cb6ad6763f0220c7b76150263bbd /src/cpu
parente6a6204b177c91aff8e0865999a8ecc3dcb49e56 (diff)
downloadgem5-02606ebb26dcdd9e370a72b22aaad11d1b14ac60.tar.xz
Fix allocating requests twice on retries.
--HG-- extra : convert_revision : 7b3324ed41e24b69b3e793005ebc07a7d72a3763
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/base_dyn_inst.hh18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh
index 263a24521..948ee058a 100644
--- a/src/cpu/base_dyn_inst.hh
+++ b/src/cpu/base_dyn_inst.hh
@@ -654,16 +654,16 @@ template<class T>
inline Fault
BaseDynInst<Impl>::read(Addr addr, T &data, unsigned flags)
{
- if (executed) {
- panic("Not supposed to re-execute with split mem ops!");
- fault = cpu->read(req, data, lqIdx);
- return fault;
+ // Sometimes reads will get retried, so they may come through here
+ // twice.
+ if (!req) {
+ req = new Request();
+ req->setVirt(asid, addr, sizeof(T), flags, this->PC);
+ req->setThreadContext(thread->readCpuId(), threadNumber);
+ } else {
+ assert(addr == req->getVaddr());
}
- req = new Request();
- req->setVirt(asid, addr, sizeof(T), flags, this->PC);
- req->setThreadContext(thread->readCpuId(), threadNumber);
-
if ((req->getVaddr() & (TheISA::VMPageSize - 1)) + req->getSize() >
TheISA::VMPageSize) {
return TheISA::genAlignmentFault();
@@ -715,6 +715,8 @@ BaseDynInst<Impl>::write(T data, Addr addr, unsigned flags, uint64_t *res)
traceData->setData(data);
}
+ assert(req == NULL);
+
req = new Request();
req->setVirt(asid, addr, sizeof(T), flags, this->PC);
req->setThreadContext(thread->readCpuId(), threadNumber);