bridge.cc (8232:b28d06a175be) bridge.cc (8708:7ccbdea0fa12)
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

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

160
161 //put it on the list to send
162 Tick readyTime = curTick() + nackDelay;
163 PacketBuffer *buf = new PacketBuffer(pkt, readyTime, true);
164
165 // nothing on the list, add it and we're done
166 if (sendQueue.empty()) {
167 assert(!sendEvent.scheduled());
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

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

160
161 //put it on the list to send
162 Tick readyTime = curTick() + nackDelay;
163 PacketBuffer *buf = new PacketBuffer(pkt, readyTime, true);
164
165 // nothing on the list, add it and we're done
166 if (sendQueue.empty()) {
167 assert(!sendEvent.scheduled());
168 schedule(sendEvent, readyTime);
168 bridge->schedule(sendEvent, readyTime);
169 sendQueue.push_back(buf);
170 return;
171 }
172
173 assert(sendEvent.scheduled() || inRetry);
174
175 // does it go at the end?
176 if (readyTime >= sendQueue.back()->ready) {

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

182 std::list<PacketBuffer*>::iterator i = sendQueue.begin();
183 std::list<PacketBuffer*>::iterator end = sendQueue.end();
184 std::list<PacketBuffer*>::iterator begin = sendQueue.begin();
185 bool done = false;
186
187 while (i != end && !done) {
188 if (readyTime < (*i)->ready) {
189 if (i == begin)
169 sendQueue.push_back(buf);
170 return;
171 }
172
173 assert(sendEvent.scheduled() || inRetry);
174
175 // does it go at the end?
176 if (readyTime >= sendQueue.back()->ready) {

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

182 std::list<PacketBuffer*>::iterator i = sendQueue.begin();
183 std::list<PacketBuffer*>::iterator end = sendQueue.end();
184 std::list<PacketBuffer*>::iterator begin = sendQueue.begin();
185 bool done = false;
186
187 while (i != end && !done) {
188 if (readyTime < (*i)->ready) {
189 if (i == begin)
190 reschedule(sendEvent, readyTime);
190 bridge->reschedule(sendEvent, readyTime);
191 sendQueue.insert(i,buf);
192 done = true;
193 }
194 i++;
195 }
196 assert(done);
197}
198

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

225 Tick readyTime = curTick() + delay;
226 PacketBuffer *buf = new PacketBuffer(pkt, readyTime);
227
228 // If we're about to put this packet at the head of the queue, we
229 // need to schedule an event to do the transmit. Otherwise there
230 // should already be an event scheduled for sending the head
231 // packet.
232 if (sendQueue.empty()) {
191 sendQueue.insert(i,buf);
192 done = true;
193 }
194 i++;
195 }
196 assert(done);
197}
198

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

225 Tick readyTime = curTick() + delay;
226 PacketBuffer *buf = new PacketBuffer(pkt, readyTime);
227
228 // If we're about to put this packet at the head of the queue, we
229 // need to schedule an event to do the transmit. Otherwise there
230 // should already be an event scheduled for sending the head
231 // packet.
232 if (sendQueue.empty()) {
233 schedule(sendEvent, readyTime);
233 bridge->schedule(sendEvent, readyTime);
234 }
235 sendQueue.push_back(buf);
236}
237
238void
239Bridge::BridgePort::trySend()
240{
241 assert(!sendQueue.empty());

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

279 --queuedRequests;
280 else if (!was_nacked_here)
281 --outstandingResponses;
282
283 // If there are more packets to send, schedule event to try again.
284 if (!sendQueue.empty()) {
285 buf = sendQueue.front();
286 DPRINTF(BusBridge, "Scheduling next send\n");
234 }
235 sendQueue.push_back(buf);
236}
237
238void
239Bridge::BridgePort::trySend()
240{
241 assert(!sendQueue.empty());

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

279 --queuedRequests;
280 else if (!was_nacked_here)
281 --outstandingResponses;
282
283 // If there are more packets to send, schedule event to try again.
284 if (!sendQueue.empty()) {
285 buf = sendQueue.front();
286 DPRINTF(BusBridge, "Scheduling next send\n");
287 schedule(sendEvent, std::max(buf->ready, curTick() + 1));
287 bridge->schedule(sendEvent, std::max(buf->ready, curTick() + 1));
288 }
289 } else {
290 DPRINTF(BusBridge, " unsuccessful\n");
291 pkt->senderState = old_sender_state;
292 inRetry = true;
293 }
294
295 DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",

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

300void
301Bridge::BridgePort::recvRetry()
302{
303 inRetry = false;
304 Tick nextReady = sendQueue.front()->ready;
305 if (nextReady <= curTick())
306 trySend();
307 else
288 }
289 } else {
290 DPRINTF(BusBridge, " unsuccessful\n");
291 pkt->senderState = old_sender_state;
292 inRetry = true;
293 }
294
295 DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",

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

300void
301Bridge::BridgePort::recvRetry()
302{
303 inRetry = false;
304 Tick nextReady = sendQueue.front()->ready;
305 if (nextReady <= curTick())
306 trySend();
307 else
308 schedule(sendEvent, nextReady);
308 bridge->schedule(sendEvent, nextReady);
309}
310
311/** Function called by the port when the bus is receiving a Atomic
312 * transaction.*/
313Tick
314Bridge::BridgePort::recvAtomic(PacketPtr pkt)
315{
316 return delay + otherPort->sendAtomic(pkt);

--- 46 unchanged lines hidden ---
309}
310
311/** Function called by the port when the bus is receiving a Atomic
312 * transaction.*/
313Tick
314Bridge::BridgePort::recvAtomic(PacketPtr pkt)
315{
316 return delay + otherPort->sendAtomic(pkt);

--- 46 unchanged lines hidden ---