io_device.cc (8674:a9476951e3a2) io_device.cc (8708:7ccbdea0fa12)
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;

--- 122 unchanged lines hidden (view full) ---

131 DPRINTF(DMA, "Received nacked %s addr %#x\n",
132 pkt->cmdString(), pkt->getAddr());
133
134 if (backoffTime < minBackoffDelay)
135 backoffTime = minBackoffDelay;
136 else if (backoffTime < maxBackoffDelay)
137 backoffTime <<= 1;
138
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;

--- 122 unchanged lines hidden (view full) ---

131 DPRINTF(DMA, "Received nacked %s addr %#x\n",
132 pkt->cmdString(), pkt->getAddr());
133
134 if (backoffTime < minBackoffDelay)
135 backoffTime = minBackoffDelay;
136 else if (backoffTime < maxBackoffDelay)
137 backoffTime <<= 1;
138
139 reschedule(backoffEvent, curTick() + backoffTime, true);
139 device->reschedule(backoffEvent, curTick() + backoffTime, true);
140
141 DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime);
142
143 pkt->reinitNacked();
144 queueDma(pkt, true);
145 } else if (pkt->isRequest() && recvSnoops) {
146 return true;
147 } else if (pkt->senderState) {

--- 11 unchanged lines hidden (view full) ---

159 // We shouldn't ever get a block in ownership state
160 assert(!(pkt->memInhibitAsserted() && !pkt->sharedAsserted()));
161
162 state->numBytes += pkt->req->getSize();
163 assert(state->totBytes >= state->numBytes);
164 if (state->totBytes == state->numBytes) {
165 if (state->completionEvent) {
166 if (state->delay)
140
141 DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime);
142
143 pkt->reinitNacked();
144 queueDma(pkt, true);
145 } else if (pkt->isRequest() && recvSnoops) {
146 return true;
147 } else if (pkt->senderState) {

--- 11 unchanged lines hidden (view full) ---

159 // We shouldn't ever get a block in ownership state
160 assert(!(pkt->memInhibitAsserted() && !pkt->sharedAsserted()));
161
162 state->numBytes += pkt->req->getSize();
163 assert(state->totBytes >= state->numBytes);
164 if (state->totBytes == state->numBytes) {
165 if (state->completionEvent) {
166 if (state->delay)
167 schedule(state->completionEvent, curTick() + state->delay);
167 device->schedule(state->completionEvent,
168 curTick() + state->delay);
168 else
169 state->completionEvent->process();
170 }
171 delete state;
172 }
173 delete pkt->req;
174 delete pkt;
175

--- 53 unchanged lines hidden (view full) ---

229 inRetry = true;
230 DPRINTF(DMA, "-- Failed, queued\n");
231 }
232 } while (!backoffTime && result && transmitList.size());
233
234 if (transmitList.size() && backoffTime && !inRetry) {
235 DPRINTF(DMA, "Scheduling backoff for %d\n", curTick()+backoffTime);
236 if (!backoffEvent.scheduled())
169 else
170 state->completionEvent->process();
171 }
172 delete state;
173 }
174 delete pkt->req;
175 delete pkt;
176

--- 53 unchanged lines hidden (view full) ---

230 inRetry = true;
231 DPRINTF(DMA, "-- Failed, queued\n");
232 }
233 } while (!backoffTime && result && transmitList.size());
234
235 if (transmitList.size() && backoffTime && !inRetry) {
236 DPRINTF(DMA, "Scheduling backoff for %d\n", curTick()+backoffTime);
237 if (!backoffEvent.scheduled())
237 schedule(backoffEvent, backoffTime + curTick());
238 device->schedule(backoffEvent, backoffTime + curTick());
238 }
239 DPRINTF(DMA, "TransmitList: %d, backoffTime: %d inRetry: %d es: %d\n",
240 transmitList.size(), backoffTime, inRetry,
241 backoffEvent.scheduled());
242}
243
244
245void

--- 69 unchanged lines hidden (view full) ---

315 DPRINTF(DMA, "-- Failed: queued\n");
316 }
317 } while (result && !backoffTime && transmitList.size());
318
319 if (transmitList.size() && backoffTime && !inRetry &&
320 !backoffEvent.scheduled()) {
321 DPRINTF(DMA, "-- Scheduling backoff timer for %d\n",
322 backoffTime+curTick());
239 }
240 DPRINTF(DMA, "TransmitList: %d, backoffTime: %d inRetry: %d es: %d\n",
241 transmitList.size(), backoffTime, inRetry,
242 backoffEvent.scheduled());
243}
244
245
246void

--- 69 unchanged lines hidden (view full) ---

316 DPRINTF(DMA, "-- Failed: queued\n");
317 }
318 } while (result && !backoffTime && transmitList.size());
319
320 if (transmitList.size() && backoffTime && !inRetry &&
321 !backoffEvent.scheduled()) {
322 DPRINTF(DMA, "-- Scheduling backoff timer for %d\n",
323 backoffTime+curTick());
323 schedule(backoffEvent, backoffTime + curTick());
324 device->schedule(backoffEvent, backoffTime + curTick());
324 }
325 } else if (state == Enums::atomic) {
326 transmitList.pop_front();
327
328 Tick lat;
329 DPRINTF(DMA, "--Sending DMA for addr: %#x size: %d\n",
330 pkt->req->getPaddr(), pkt->req->getSize());
331 lat = sendAtomic(pkt);

--- 5 unchanged lines hidden (view full) ---

337 DPRINTF(DMA, "--Received response for DMA for addr: %#x size: %d nb: %d, tot: %d sched %d\n",
338 pkt->req->getPaddr(), pkt->req->getSize(), state->numBytes,
339 state->totBytes,
340 state->completionEvent ? state->completionEvent->scheduled() : 0 );
341
342 if (state->totBytes == state->numBytes) {
343 if (state->completionEvent) {
344 assert(!state->completionEvent->scheduled());
325 }
326 } else if (state == Enums::atomic) {
327 transmitList.pop_front();
328
329 Tick lat;
330 DPRINTF(DMA, "--Sending DMA for addr: %#x size: %d\n",
331 pkt->req->getPaddr(), pkt->req->getSize());
332 lat = sendAtomic(pkt);

--- 5 unchanged lines hidden (view full) ---

338 DPRINTF(DMA, "--Received response for DMA for addr: %#x size: %d nb: %d, tot: %d sched %d\n",
339 pkt->req->getPaddr(), pkt->req->getSize(), state->numBytes,
340 state->totBytes,
341 state->completionEvent ? state->completionEvent->scheduled() : 0 );
342
343 if (state->totBytes == state->numBytes) {
344 if (state->completionEvent) {
345 assert(!state->completionEvent->scheduled());
345 schedule(state->completionEvent, curTick() + lat + state->delay);
346 device->schedule(state->completionEvent,
347 curTick() + lat + state->delay);
346 }
347 delete state;
348 delete pkt->req;
349 }
350 pendingCount--;
351 assert(pendingCount >= 0);
352 delete pkt;
353

--- 30 unchanged lines hidden ---
348 }
349 delete state;
350 delete pkt->req;
351 }
352 pendingCount--;
353 assert(pendingCount >= 0);
354 delete pkt;
355

--- 30 unchanged lines hidden ---