bridge.cc (7668:aec271db42c9) bridge.cc (7823:dac01f14f20f)
1
2/*
3 * Copyright (c) 2006 The Regents of The University of Michigan
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

153void
154Bridge::BridgePort::nackRequest(PacketPtr pkt)
155{
156 // Nack the packet
157 pkt->makeTimingResponse();
158 pkt->setNacked();
159
160 //put it on the list to send
1
2/*
3 * Copyright (c) 2006 The Regents of The University of Michigan
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

153void
154Bridge::BridgePort::nackRequest(PacketPtr pkt)
155{
156 // Nack the packet
157 pkt->makeTimingResponse();
158 pkt->setNacked();
159
160 //put it on the list to send
161 Tick readyTime = curTick + nackDelay;
161 Tick readyTime = curTick() + nackDelay;
162 PacketBuffer *buf = new PacketBuffer(pkt, readyTime, true);
163
164 // nothing on the list, add it and we're done
165 if (sendQueue.empty()) {
166 assert(!sendEvent.scheduled());
167 schedule(sendEvent, readyTime);
168 sendQueue.push_back(buf);
169 return;

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

216
217
218 if (pkt->isRequest()) {
219 ++queuedRequests;
220 }
221
222
223
162 PacketBuffer *buf = new PacketBuffer(pkt, readyTime, true);
163
164 // nothing on the list, add it and we're done
165 if (sendQueue.empty()) {
166 assert(!sendEvent.scheduled());
167 schedule(sendEvent, readyTime);
168 sendQueue.push_back(buf);
169 return;

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

216
217
218 if (pkt->isRequest()) {
219 ++queuedRequests;
220 }
221
222
223
224 Tick readyTime = curTick + delay;
224 Tick readyTime = curTick() + delay;
225 PacketBuffer *buf = new PacketBuffer(pkt, readyTime);
226
227 // If we're about to put this packet at the head of the queue, we
228 // need to schedule an event to do the transmit. Otherwise there
229 // should already be an event scheduled for sending the head
230 // packet.
231 if (sendQueue.empty()) {
232 schedule(sendEvent, readyTime);
233 }
234 sendQueue.push_back(buf);
235}
236
237void
238Bridge::BridgePort::trySend()
239{
240 assert(!sendQueue.empty());
241
242 PacketBuffer *buf = sendQueue.front();
243
225 PacketBuffer *buf = new PacketBuffer(pkt, readyTime);
226
227 // If we're about to put this packet at the head of the queue, we
228 // need to schedule an event to do the transmit. Otherwise there
229 // should already be an event scheduled for sending the head
230 // packet.
231 if (sendQueue.empty()) {
232 schedule(sendEvent, readyTime);
233 }
234 sendQueue.push_back(buf);
235}
236
237void
238Bridge::BridgePort::trySend()
239{
240 assert(!sendQueue.empty());
241
242 PacketBuffer *buf = sendQueue.front();
243
244 assert(buf->ready <= curTick);
244 assert(buf->ready <= curTick());
245
246 PacketPtr pkt = buf->pkt;
247
248 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
249 buf->origSrc, pkt->getDest(), pkt->getAddr());
250
251 bool wasReq = pkt->isRequest();
252 bool was_nacked_here = buf->nackedHere;

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

278 --queuedRequests;
279 else if (!was_nacked_here)
280 --outstandingResponses;
281
282 // If there are more packets to send, schedule event to try again.
283 if (!sendQueue.empty()) {
284 buf = sendQueue.front();
285 DPRINTF(BusBridge, "Scheduling next send\n");
245
246 PacketPtr pkt = buf->pkt;
247
248 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
249 buf->origSrc, pkt->getDest(), pkt->getAddr());
250
251 bool wasReq = pkt->isRequest();
252 bool was_nacked_here = buf->nackedHere;

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

278 --queuedRequests;
279 else if (!was_nacked_here)
280 --outstandingResponses;
281
282 // If there are more packets to send, schedule event to try again.
283 if (!sendQueue.empty()) {
284 buf = sendQueue.front();
285 DPRINTF(BusBridge, "Scheduling next send\n");
286 schedule(sendEvent, std::max(buf->ready, curTick + 1));
286 schedule(sendEvent, std::max(buf->ready, curTick() + 1));
287 }
288 } else {
289 DPRINTF(BusBridge, " unsuccessful\n");
290 pkt->senderState = old_sender_state;
291 inRetry = true;
292 }
293
294 DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",
295 sendQueue.size(), queuedRequests, outstandingResponses);
296}
297
298
299void
300Bridge::BridgePort::recvRetry()
301{
302 inRetry = false;
303 Tick nextReady = sendQueue.front()->ready;
287 }
288 } else {
289 DPRINTF(BusBridge, " unsuccessful\n");
290 pkt->senderState = old_sender_state;
291 inRetry = true;
292 }
293
294 DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",
295 sendQueue.size(), queuedRequests, outstandingResponses);
296}
297
298
299void
300Bridge::BridgePort::recvRetry()
301{
302 inRetry = false;
303 Tick nextReady = sendQueue.front()->ready;
304 if (nextReady <= curTick)
304 if (nextReady <= curTick())
305 trySend();
306 else
307 schedule(sendEvent, nextReady);
308}
309
310/** Function called by the port when the bus is receiving a Atomic
311 * transaction.*/
312Tick

--- 49 unchanged lines hidden ---
305 trySend();
306 else
307 schedule(sendEvent, nextReady);
308}
309
310/** Function called by the port when the bus is receiving a Atomic
311 * transaction.*/
312Tick

--- 49 unchanged lines hidden ---