- short src = pkt->getSrc();
-
- BusPort *src_port = interfaces[src];
-
- // If the bus is busy, or other devices are in line ahead of the current
- // one, put this device on the retry list.
- if (!pkt->isExpressSnoop() &&
- (tickNextIdle > curTick() ||
- (retryList.size() && (!inRetry || src_port != retryList.front()))))
- {
- addToRetryList(src_port);
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x BUSY\n",
- src, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
- return false;
- }
-
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x\n",
- src, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
-
- Tick headerFinishTime = pkt->isExpressSnoop() ? 0 : calcPacketTiming(pkt);
- Tick packetFinishTime = pkt->isExpressSnoop() ? 0 : pkt->finishTime;
-
- short dest = pkt->getDest();
- int dest_port_id;
- Port *dest_port;
-
- if (dest == Packet::Broadcast) {
- dest_port_id = findPort(pkt->getAddr());
- dest_port = interfaces[dest_port_id];
- SnoopIter s_end = snoopPorts.end();
- for (SnoopIter s_iter = snoopPorts.begin(); s_iter != s_end; s_iter++) {
- BusPort *p = *s_iter;
- if (p != dest_port && p != src_port) {
- // cache is not allowed to refuse snoop
- bool success M5_VAR_USED = p->sendTiming(pkt);
- assert(success);
- }
- }
- } else {
- assert(dest < interfaces.size());
- assert(dest != src); // catch infinite loops
- dest_port_id = dest;
- dest_port = interfaces[dest_port_id];
- }
-
- if (dest_port_id == src) {
- // Must be forwarded snoop up from below...
- assert(dest == Packet::Broadcast);
- } else {
- // send to actual target
- if (!dest_port->sendTiming(pkt)) {
- // Packet not successfully sent. Leave or put it on the retry list.
- // illegal to block responses... can lead to deadlock
- assert(!pkt->isResponse());
- // It's also illegal to force a transaction to retry after
- // someone else has committed to respond.
- assert(!pkt->memInhibitAsserted());
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x TGT RETRY\n",
- src, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
- addToRetryList(src_port);
- occupyBus(headerFinishTime);
- return false;
- }
- // send OK, fall through... pkt may have been deleted by
- // target at this point, so it should *not* be referenced
- // again. We'll set it to NULL here just to be safe.
- pkt = NULL;