bridge.cc (4626:ed8aacb19c03) | bridge.cc (4739:9f8edf47aeca) |
---|---|
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{ | 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 |
|
115 DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n", 116 pkt->getSrc(), pkt->getDest(), pkt->getAddr()); 117 118 DPRINTF(BusBridge, "Local queue size: %d outreq: %d outresp: %d\n", 119 sendQueue.size(), queuedRequests, outstandingResponses); 120 DPRINTF(BusBridge, "Remove queue size: %d outreq: %d outresp: %d\n", 121 otherPort->sendQueue.size(), otherPort->queuedRequests, 122 otherPort->outstandingResponses); --- 81 unchanged lines hidden (view full) --- 204 // from original request 205 buf->fixResponse(pkt); 206 207 // Check if this packet was expecting a response and it's a nacked 208 // packet, in which case we will never being seeing it 209 if (buf->expectResponse && pkt->result == Packet::Nacked) 210 --outstandingResponses; 211 | 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); --- 81 unchanged lines hidden (view full) --- 208 // from original request 209 buf->fixResponse(pkt); 210 211 // Check if this packet was expecting a response and it's a nacked 212 // packet, in which case we will never being seeing it 213 if (buf->expectResponse && pkt->result == Packet::Nacked) 214 --outstandingResponses; 215 |
212 213 DPRINTF(BusBridge, "restoring sender state: %#X, from packet buffer: %#X\n", 214 pkt->senderState, buf); 215 DPRINTF(BusBridge, " is response, new dest %d\n", pkt->getDest()); | 216 DPRINTF(BusBridge, "response, new dest %d\n", pkt->getDest()); |
216 delete buf; 217 } 218 219 220 if (pkt->isRequest() && pkt->result != Packet::Nacked) { 221 ++queuedRequests; 222 } 223 224 225 226 Tick readyTime = curTick + delay; 227 PacketBuffer *buf = new PacketBuffer(pkt, readyTime); | 217 delete buf; 218 } 219 220 221 if (pkt->isRequest() && pkt->result != Packet::Nacked) { 222 ++queuedRequests; 223 } 224 225 226 227 Tick readyTime = curTick + delay; 228 PacketBuffer *buf = new PacketBuffer(pkt, readyTime); |
228 DPRINTF(BusBridge, "old sender state: %#X, new sender state: %#X\n", 229 buf->origSenderState, buf); | |
230 231 // If we're about to put this packet at the head of the queue, we 232 // need to schedule an event to do the transmit. Otherwise there 233 // should already be an event scheduled for sending the head 234 // packet. 235 if (sendQueue.empty()) { 236 sendEvent.schedule(readyTime); 237 } --- 6 unchanged lines hidden (view full) --- 244 assert(!sendQueue.empty()); 245 246 PacketBuffer *buf = sendQueue.front(); 247 248 assert(buf->ready <= curTick); 249 250 PacketPtr pkt = buf->pkt; 251 | 229 230 // If we're about to put this packet at the head of the queue, we 231 // need to schedule an event to do the transmit. Otherwise there 232 // should already be an event scheduled for sending the head 233 // packet. 234 if (sendQueue.empty()) { 235 sendEvent.schedule(readyTime); 236 } --- 6 unchanged lines hidden (view full) --- 243 assert(!sendQueue.empty()); 244 245 PacketBuffer *buf = sendQueue.front(); 246 247 assert(buf->ready <= curTick); 248 249 PacketPtr pkt = buf->pkt; 250 |
251 pkt->flags &= ~SNOOP_COMMIT; //CLear it if it was set 252 |
|
252 // Ugly! @todo When multilevel coherence works this will be removed 253 if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite && 254 pkt->result != Packet::Nacked) { 255 PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq, 256 Packet::Broadcast); 257 funcPkt->dataStatic(pkt->getPtr<uint8_t>()); 258 sendFunctional(funcPkt); 259 pkt->cmd = MemCmd::WriteReq; --- 74 unchanged lines hidden (view full) --- 334} 335 336/** Function called by the port when the bus is receiving a Functional 337 * transaction.*/ 338void 339Bridge::BridgePort::recvFunctional(PacketPtr pkt) 340{ 341 std::list<PacketBuffer*>::iterator i; | 253 // Ugly! @todo When multilevel coherence works this will be removed 254 if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite && 255 pkt->result != Packet::Nacked) { 256 PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq, 257 Packet::Broadcast); 258 funcPkt->dataStatic(pkt->getPtr<uint8_t>()); 259 sendFunctional(funcPkt); 260 pkt->cmd = MemCmd::WriteReq; --- 74 unchanged lines hidden (view full) --- 335} 336 337/** Function called by the port when the bus is receiving a Functional 338 * transaction.*/ 339void 340Bridge::BridgePort::recvFunctional(PacketPtr pkt) 341{ 342 std::list<PacketBuffer*>::iterator i; |
343 bool pktContinue = true; |
|
342 343 for (i = sendQueue.begin(); i != sendQueue.end(); ++i) { | 344 345 for (i = sendQueue.begin(); i != sendQueue.end(); ++i) { |
344 if (pkt->checkFunctional((*i)->pkt)) 345 return; | 346 if (pkt->intersect((*i)->pkt)) { 347 pktContinue &= fixPacket(pkt, (*i)->pkt); 348 } |
346 } 347 | 349 } 350 |
348 // fall through if pkt still not satisfied 349 otherPort->sendFunctional(pkt); | 351 if (pktContinue) { 352 otherPort->sendFunctional(pkt); 353 } |
350} 351 352/** Function called by the port when the bus is receiving a status change.*/ 353void 354Bridge::BridgePort::recvStatusChange(Port::Status status) 355{ 356 otherPort->sendStatusChange(status); 357} --- 55 unchanged lines hidden --- | 354} 355 356/** Function called by the port when the bus is receiving a status change.*/ 357void 358Bridge::BridgePort::recvStatusChange(Port::Status status) 359{ 360 otherPort->sendStatusChange(status); 361} --- 55 unchanged lines hidden --- |