1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 87 unchanged lines hidden (view full) --- 96 pendingCount(0), actionInProgress(0), drainEvent(NULL), 97 backoffTime(0), inRetry(false), backoffEvent(this) 98{ } 99 100bool 101DmaPort::recvTiming(PacketPtr pkt) 102{ 103 if (pkt->wasNacked()) { |
104 DPRINTF(DMA, "Received nacked %s addr %#x\n", 105 pkt->cmdString(), pkt->getAddr()); |
106 107 if (backoffTime < device->minBackoffDelay) 108 backoffTime = device->minBackoffDelay; 109 else if (backoffTime < device->maxBackoffDelay) 110 backoffTime <<= 1; 111 112 backoffEvent.reschedule(curTick + backoffTime, true); 113 114 DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime); 115 116 pkt->reinitNacked(); 117 queueDma(pkt, true); 118 } else if (pkt->senderState) { 119 DmaReqState *state; 120 backoffTime >>= 2; 121 |
122 DPRINTF(DMA, "Received response %s addr %#x size %#x\n", 123 pkt->cmdString(), pkt->getAddr(), pkt->req->getSize()); |
124 state = dynamic_cast<DmaReqState*>(pkt->senderState); 125 pendingCount--; 126 127 assert(pendingCount >= 0); 128 assert(state); 129 130 state->numBytes += pkt->req->getSize(); 131 assert(state->totBytes >= state->numBytes); --- 45 unchanged lines hidden (view full) --- 177 178void 179DmaPort::recvRetry() 180{ 181 assert(transmitList.size()); 182 PacketPtr pkt = transmitList.front(); 183 bool result = true; 184 do { |
185 DPRINTF(DMA, "Retry on %s addr %#x\n", 186 pkt->cmdString(), pkt->getAddr()); |
187 result = sendTiming(pkt); 188 if (result) { 189 DPRINTF(DMA, "-- Done\n"); 190 transmitList.pop_front(); 191 inRetry = false; 192 } else { 193 inRetry = true; 194 DPRINTF(DMA, "-- Failed, queued\n"); --- 67 unchanged lines hidden (view full) --- 262 263 System::MemoryMode state = sys->getMemoryMode(); 264 if (state == System::Timing) { 265 if (backoffEvent.scheduled() || inRetry) { 266 DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n"); 267 return; 268 } 269 |
270 DPRINTF(DMA, "Attempting to send %s addr %#x\n", 271 pkt->cmdString(), pkt->getAddr()); |
272 273 bool result; 274 do { 275 result = sendTiming(pkt); 276 if (result) { 277 transmitList.pop_front(); 278 DPRINTF(DMA, "-- Done\n"); 279 } else { --- 53 unchanged lines hidden --- |