From 02606ebb26dcdd9e370a72b22aaad11d1b14ac60 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Fri, 9 Jun 2006 12:28:11 -0400 Subject: [PATCH] Fix allocating requests twice on retries. --HG-- extra : convert_revision : 7b3324ed41e24b69b3e793005ebc07a7d72a3763 --- src/cpu/base_dyn_inst.hh | 18 ++++++++++-------- 1 file 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 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); -- 2.30.2