Deleted Added
sdiff udiff text old ( 4454:8125c4b9e306 ) new ( 4458:d43aab911e6e )
full compact
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

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

107 return queuedRequests >= reqQueueLimit;
108}
109
110/** Function called by the port when the bus is receiving a Timing
111 * transaction.*/
112bool
113Bridge::BridgePort::recvTiming(PacketPtr pkt)
114{
115 if (!(pkt->flags & SNOOP_COMMIT))
116 return true;
117
118
119 DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n",
120 pkt->getSrc(), pkt->getDest(), pkt->getAddr());
121
122 DPRINTF(BusBridge, "Local queue size: %d outreq: %d outresp: %d\n",
123 sendQueue.size(), queuedRequests, outstandingResponses);
124 DPRINTF(BusBridge, "Remove queue size: %d outreq: %d outresp: %d\n",
125 otherPort->sendQueue.size(), otherPort->queuedRequests,
126 otherPort->outstandingResponses);

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

242 sendQueue.push_back(buf);
243}
244
245void
246Bridge::BridgePort::trySend()
247{
248 assert(!sendQueue.empty());
249
250 PacketBuffer *buf = sendQueue.front();
251
252 assert(buf->ready <= curTick);
253
254 PacketPtr pkt = buf->pkt;
255
256 pkt->flags &= ~SNOOP_COMMIT; //CLear it if it was set
257
258 // Ugly! @todo When multilevel coherence works this will be removed
259 if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite &&
260 pkt->result != Packet::Nacked) {
261 PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq,
262 Packet::Broadcast);
263 funcPkt->dataStatic(pkt->getPtr<uint8_t>());
264 sendFunctional(funcPkt);
265 pkt->cmd = MemCmd::WriteReq;
266 delete funcPkt;
267 }
268
269 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
270 buf->origSrc, pkt->getDest(), pkt->getAddr());
271
272 bool wasReq = pkt->isRequest();
273 bool wasNacked = pkt->result == Packet::Nacked;
274

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

297 // If there are more packets to send, schedule event to try again.
298 if (!sendQueue.empty()) {
299 buf = sendQueue.front();
300 DPRINTF(BusBridge, "Scheduling next send\n");
301 sendEvent.schedule(std::max(buf->ready, curTick + 1));
302 }
303 } else {
304 DPRINTF(BusBridge, " unsuccessful\n");
305 inRetry = true;
306 }
307 DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",
308 sendQueue.size(), queuedRequests, outstandingResponses);
309}
310
311
312void

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

320 sendEvent.schedule(nextReady);
321}
322
323/** Function called by the port when the bus is receiving a Atomic
324 * transaction.*/
325Tick
326Bridge::BridgePort::recvAtomic(PacketPtr pkt)
327{
328 // fix partial atomic writes... similar to the timing code that does the
329 // same... will be removed once our code gets this right
330 if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite) {
331
332 PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq,
333 Packet::Broadcast);
334 funcPkt->dataStatic(pkt->getPtr<uint8_t>());
335 otherPort->sendFunctional(funcPkt);
336 delete funcPkt;
337 pkt->cmd = MemCmd::WriteReq;
338 }
339 return delay + otherPort->sendAtomic(pkt);
340}
341
342/** Function called by the port when the bus is receiving a Functional
343 * transaction.*/
344void
345Bridge::BridgePort::recvFunctional(PacketPtr pkt)
346{
347 std::list<PacketBuffer*>::iterator i;

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

413 p->write_ack = write_ack;
414 p->fix_partial_write_a = fix_partial_write_a;
415 p->fix_partial_write_b = fix_partial_write_b;
416 return new Bridge(p);
417}
418
419REGISTER_SIM_OBJECT("Bridge", Bridge)
420
421