From: Kevin Lim Date: Fri, 9 Jun 2006 16:28:11 +0000 (-0400) Subject: Fix allocating requests twice on retries. X-Git-Tag: m5_2.0_beta1~36^2~92 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02606ebb26dcdd9e370a72b22aaad11d1b14ac60;p=gem5.git Fix allocating requests twice on retries. --HG-- extra : convert_revision : 7b3324ed41e24b69b3e793005ebc07a7d72a3763 --- 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 inline Fault BaseDynInst::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::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);