From: Nilay Vaish Date: Mon, 26 Sep 2011 17:18:32 +0000 (-0500) Subject: LSQ: Moved a couple of lines to enable O3 + Ruby X-Git-Tag: stable_2012_02_02~48 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56bddab18940e766bdfdeb98e0691a994859dcde;p=gem5.git LSQ: Moved a couple of lines to enable O3 + Ruby This patch makes O3 CPU work along with the Ruby memory model. Ruby overwrites the senderState pointer with another pointer. The pointer is restored only when Ruby gets done with the packet. LSQ makes use of senderState just after sendTiming() returns. But the dynamic_cast returns a NULL pointer since Ruby's senderState pointer is from a different class. Storing the senderState pointer before calling sendTiming() does away with the problem. --- diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index 2a37d8b5c..77ce705bc 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -1191,10 +1191,10 @@ LSQUnit::recvRetry() DPRINTF(LSQUnit, "Receiving retry: store blocked\n"); assert(retryPkt != NULL); - if (dcachePort->sendTiming(retryPkt)) { - LSQSenderState *state = - dynamic_cast(retryPkt->senderState); + LSQSenderState *state = + dynamic_cast(retryPkt->senderState); + if (dcachePort->sendTiming(retryPkt)) { // Don't finish the store unless this is the last packet. if (!TheISA::HasUnalignedMemAcc || !state->pktToSend || state->pendingPacket == retryPkt) {