bridge.cc (8948:e95ee70f876c) | bridge.cc (8949:3fa1ee293096) |
---|---|
1/* 2 * Copyright (c) 2011-2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 130 unchanged lines hidden (view full) --- 139bool 140Bridge::BridgeMasterPort::recvTiming(PacketPtr pkt) 141{ 142 // should only see responses on the master side 143 assert(pkt->isResponse()); 144 145 // all checks are done when the request is accepted on the slave 146 // side, so we are guaranteed to have space for the response | 1/* 2 * Copyright (c) 2011-2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 130 unchanged lines hidden (view full) --- 139bool 140Bridge::BridgeMasterPort::recvTiming(PacketPtr pkt) 141{ 142 // should only see responses on the master side 143 assert(pkt->isResponse()); 144 145 // all checks are done when the request is accepted on the slave 146 // side, so we are guaranteed to have space for the response |
147 DPRINTF(BusBridge, "recvTiming: response %s addr 0x%x\n", 148 pkt->cmdString(), pkt->getAddr()); |
|
147 | 149 |
148 DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n", 149 pkt->getSrc(), pkt->getDest(), pkt->getAddr()); 150 | |
151 DPRINTF(BusBridge, "Request queue size: %d\n", requestQueue.size()); 152 153 slavePort.queueForSendTiming(pkt); 154 155 return true; 156} 157 158bool 159Bridge::BridgeSlavePort::recvTiming(PacketPtr pkt) 160{ 161 // should only see requests on the slave side 162 assert(pkt->isRequest()); 163 | 150 DPRINTF(BusBridge, "Request queue size: %d\n", requestQueue.size()); 151 152 slavePort.queueForSendTiming(pkt); 153 154 return true; 155} 156 157bool 158Bridge::BridgeSlavePort::recvTiming(PacketPtr pkt) 159{ 160 // should only see requests on the slave side 161 assert(pkt->isRequest()); 162 |
164 DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n", 165 pkt->getSrc(), pkt->getDest(), pkt->getAddr()); | |
166 | 163 |
164 DPRINTF(BusBridge, "recvTiming: request %s addr 0x%x\n", 165 pkt->cmdString(), pkt->getAddr()); 166 |
|
167 DPRINTF(BusBridge, "Response queue size: %d outresp: %d\n", 168 responseQueue.size(), outstandingResponses); 169 170 if (masterPort.reqQueueFull()) { 171 DPRINTF(BusBridge, "Request queue full, nacking\n"); 172 nackRequest(pkt); 173 return true; 174 } --- 97 unchanged lines hidden (view full) --- 272 // corresponding PacketBuffer should be stored in the packet's 273 // senderState field. 274 PacketBuffer *buf = dynamic_cast<PacketBuffer*>(pkt->senderState); 275 assert(buf != NULL); 276 // set up new packet dest & senderState based on values saved 277 // from original request 278 buf->fixResponse(pkt); 279 | 167 DPRINTF(BusBridge, "Response queue size: %d outresp: %d\n", 168 responseQueue.size(), outstandingResponses); 169 170 if (masterPort.reqQueueFull()) { 171 DPRINTF(BusBridge, "Request queue full, nacking\n"); 172 nackRequest(pkt); 173 return true; 174 } --- 97 unchanged lines hidden (view full) --- 272 // corresponding PacketBuffer should be stored in the packet's 273 // senderState field. 274 PacketBuffer *buf = dynamic_cast<PacketBuffer*>(pkt->senderState); 275 assert(buf != NULL); 276 // set up new packet dest & senderState based on values saved 277 // from original request 278 buf->fixResponse(pkt); 279 |
280 // the bridge assumes that at least one bus has set the 281 // destination field of the packet 282 assert(pkt->isDestValid()); |
|
280 DPRINTF(BusBridge, "response, new dest %d\n", pkt->getDest()); 281 delete buf; 282 283 Tick readyTime = curTick() + delay; 284 buf = new PacketBuffer(pkt, readyTime); 285 286 // If we're about to put this packet at the head of the queue, we 287 // need to schedule an event to do the transmit. Otherwise there --- 11 unchanged lines hidden (view full) --- 299 assert(!requestQueue.empty()); 300 301 PacketBuffer *buf = requestQueue.front(); 302 303 assert(buf->ready <= curTick()); 304 305 PacketPtr pkt = buf->pkt; 306 | 283 DPRINTF(BusBridge, "response, new dest %d\n", pkt->getDest()); 284 delete buf; 285 286 Tick readyTime = curTick() + delay; 287 buf = new PacketBuffer(pkt, readyTime); 288 289 // If we're about to put this packet at the head of the queue, we 290 // need to schedule an event to do the transmit. Otherwise there --- 11 unchanged lines hidden (view full) --- 302 assert(!requestQueue.empty()); 303 304 PacketBuffer *buf = requestQueue.front(); 305 306 assert(buf->ready <= curTick()); 307 308 PacketPtr pkt = buf->pkt; 309 |
307 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n", 308 buf->origSrc, pkt->getDest(), pkt->getAddr()); | 310 DPRINTF(BusBridge, "trySend: origSrc %d addr 0x%x\n", 311 buf->origSrc, pkt->getAddr()); |
309 310 // If the send was successful, make sure sender state was set to NULL 311 // otherwise we could get a NACK back of a packet that didn't expect a 312 // response and we would try to use freed memory. 313 314 Packet::SenderState *old_sender_state = pkt->senderState; 315 if (!buf->expectResponse) 316 pkt->senderState = NULL; --- 157 unchanged lines hidden --- | 312 313 // If the send was successful, make sure sender state was set to NULL 314 // otherwise we could get a NACK back of a packet that didn't expect a 315 // response and we would try to use freed memory. 316 317 Packet::SenderState *old_sender_state = pkt->senderState; 318 if (!buf->expectResponse) 319 pkt->senderState = NULL; --- 157 unchanged lines hidden --- |