io_device.cc (4475:fb185cc1c845) io_device.cc (4739:9f8edf47aeca)
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;

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

98{ }
99
100bool
101DmaPort::recvTiming(PacketPtr pkt)
102{
103
104
105 if (pkt->result == Packet::Nacked) {
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;

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

98{ }
99
100bool
101DmaPort::recvTiming(PacketPtr pkt)
102{
103
104
105 if (pkt->result == Packet::Nacked) {
106 DPRINTF(DMA, "Received nacked Pkt %#x with State: %#x Addr: %#x\n",
107 pkt, pkt->senderState, pkt->getAddr());
106 DPRINTF(DMA, "Received nacked %s addr %#x\n",
107 pkt->cmdString(), pkt->getAddr());
108
109 if (backoffTime < device->minBackoffDelay)
110 backoffTime = device->minBackoffDelay;
111 else if (backoffTime < device->maxBackoffDelay)
112 backoffTime <<= 1;
113
114 backoffEvent.reschedule(curTick + backoffTime, true);
115
116 DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime);
117
118 pkt->reinitNacked();
119 queueDma(pkt, true);
120 } else if (pkt->senderState) {
121 DmaReqState *state;
122 backoffTime >>= 2;
123
108
109 if (backoffTime < device->minBackoffDelay)
110 backoffTime = device->minBackoffDelay;
111 else if (backoffTime < device->maxBackoffDelay)
112 backoffTime <<= 1;
113
114 backoffEvent.reschedule(curTick + backoffTime, true);
115
116 DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime);
117
118 pkt->reinitNacked();
119 queueDma(pkt, true);
120 } else if (pkt->senderState) {
121 DmaReqState *state;
122 backoffTime >>= 2;
123
124 DPRINTF(DMA, "Received response Pkt %#x with State: %#x Addr: %#x size: %#x\n",
125 pkt, pkt->senderState, pkt->getAddr(), pkt->req->getSize());
124 DPRINTF(DMA, "Received response %s addr %#x size %#x\n",
125 pkt->cmdString(), pkt->getAddr(), pkt->req->getSize());
126 state = dynamic_cast<DmaReqState*>(pkt->senderState);
127 pendingCount--;
128
129 assert(pendingCount >= 0);
130 assert(state);
131
132 state->numBytes += pkt->req->getSize();
133 assert(state->totBytes >= state->numBytes);

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

179
180void
181DmaPort::recvRetry()
182{
183 assert(transmitList.size());
184 PacketPtr pkt = transmitList.front();
185 bool result = true;
186 do {
126 state = dynamic_cast<DmaReqState*>(pkt->senderState);
127 pendingCount--;
128
129 assert(pendingCount >= 0);
130 assert(state);
131
132 state->numBytes += pkt->req->getSize();
133 assert(state->totBytes >= state->numBytes);

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

179
180void
181DmaPort::recvRetry()
182{
183 assert(transmitList.size());
184 PacketPtr pkt = transmitList.front();
185 bool result = true;
186 do {
187 DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n",
188 pkt, pkt->senderState);
187 DPRINTF(DMA, "Retry on %s addr %#x\n",
188 pkt->cmdString(), pkt->getAddr());
189 result = sendTiming(pkt);
190 if (result) {
191 DPRINTF(DMA, "-- Done\n");
192 transmitList.pop_front();
193 inRetry = false;
194 } else {
195 inRetry = true;
196 DPRINTF(DMA, "-- Failed, queued\n");

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

264
265 System::MemoryMode state = sys->getMemoryMode();
266 if (state == System::Timing) {
267 if (backoffEvent.scheduled() || inRetry) {
268 DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n");
269 return;
270 }
271
189 result = sendTiming(pkt);
190 if (result) {
191 DPRINTF(DMA, "-- Done\n");
192 transmitList.pop_front();
193 inRetry = false;
194 } else {
195 inRetry = true;
196 DPRINTF(DMA, "-- Failed, queued\n");

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

264
265 System::MemoryMode state = sys->getMemoryMode();
266 if (state == System::Timing) {
267 if (backoffEvent.scheduled() || inRetry) {
268 DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n");
269 return;
270 }
271
272 DPRINTF(DMA, "Attempting to send Packet %#x with addr: %#x\n",
273 pkt, pkt->getAddr());
272 DPRINTF(DMA, "Attempting to send %s addr %#x\n",
273 pkt->cmdString(), pkt->getAddr());
274
275 bool result;
276 do {
277 result = sendTiming(pkt);
278 if (result) {
279 transmitList.pop_front();
280 DPRINTF(DMA, "-- Done\n");
281 } else {

--- 53 unchanged lines hidden ---
274
275 bool result;
276 do {
277 result = sendTiming(pkt);
278 if (result) {
279 transmitList.pop_front();
280 DPRINTF(DMA, "-- Done\n");
281 } else {

--- 53 unchanged lines hidden ---