bridge.cc (8949:3fa1ee293096) bridge.cc (8975:7f36d4436074)
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

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

132
133bool
134Bridge::BridgeMasterPort::reqQueueFull()
135{
136 return requestQueue.size() == reqQueueLimit;
137}
138
139bool
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

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

132
133bool
134Bridge::BridgeMasterPort::reqQueueFull()
135{
136 return requestQueue.size() == reqQueueLimit;
137}
138
139bool
140Bridge::BridgeMasterPort::recvTiming(PacketPtr pkt)
140Bridge::BridgeMasterPort::recvTimingResp(PacketPtr pkt)
141{
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());
149
150 DPRINTF(BusBridge, "Request queue size: %d\n", requestQueue.size());
151
152 slavePort.queueForSendTiming(pkt);
153
154 return true;
155}
156
157bool
142 // all checks are done when the request is accepted on the slave
143 // side, so we are guaranteed to have space for the response
144 DPRINTF(BusBridge, "recvTiming: response %s addr 0x%x\n",
145 pkt->cmdString(), pkt->getAddr());
146
147 DPRINTF(BusBridge, "Request queue size: %d\n", requestQueue.size());
148
149 slavePort.queueForSendTiming(pkt);
150
151 return true;
152}
153
154bool
158Bridge::BridgeSlavePort::recvTiming(PacketPtr pkt)
155Bridge::BridgeSlavePort::recvTimingReq(PacketPtr pkt)
159{
156{
160 // should only see requests on the slave side
161 assert(pkt->isRequest());
162
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");

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

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;
320
157 DPRINTF(BusBridge, "recvTiming: request %s addr 0x%x\n",
158 pkt->cmdString(), pkt->getAddr());
159
160 DPRINTF(BusBridge, "Response queue size: %d outresp: %d\n",
161 responseQueue.size(), outstandingResponses);
162
163 if (masterPort.reqQueueFull()) {
164 DPRINTF(BusBridge, "Request queue full, nacking\n");

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

306 // If the send was successful, make sure sender state was set to NULL
307 // otherwise we could get a NACK back of a packet that didn't expect a
308 // response and we would try to use freed memory.
309
310 Packet::SenderState *old_sender_state = pkt->senderState;
311 if (!buf->expectResponse)
312 pkt->senderState = NULL;
313
321 if (sendTiming(pkt)) {
314 if (sendTimingReq(pkt)) {
322 // send successful
323 requestQueue.pop_front();
324 // we no longer own packet, so it's not safe to look at it
325 buf->pkt = NULL;
326
327 if (!buf->expectResponse) {
328 // no response expected... deallocate packet buffer now.
329 DPRINTF(BusBridge, " successful: no response expected\n");

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

360 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
361 buf->origSrc, pkt->getDest(), pkt->getAddr());
362
363 bool was_nacked_here = buf->nackedHere;
364
365 // no need to worry about the sender state since we are not
366 // modifying it
367
315 // send successful
316 requestQueue.pop_front();
317 // we no longer own packet, so it's not safe to look at it
318 buf->pkt = NULL;
319
320 if (!buf->expectResponse) {
321 // no response expected... deallocate packet buffer now.
322 DPRINTF(BusBridge, " successful: no response expected\n");

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

353 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
354 buf->origSrc, pkt->getDest(), pkt->getAddr());
355
356 bool was_nacked_here = buf->nackedHere;
357
358 // no need to worry about the sender state since we are not
359 // modifying it
360
368 if (sendTiming(pkt)) {
361 if (sendTimingResp(pkt)) {
369 DPRINTF(BusBridge, " successful\n");
370 // send successful
371 responseQueue.pop_front();
372 // this is a response... deallocate packet buffer now.
373 delete buf;
374
375 if (!was_nacked_here) {
376 assert(outstandingResponses != 0);

--- 100 unchanged lines hidden ---
362 DPRINTF(BusBridge, " successful\n");
363 // send successful
364 responseQueue.pop_front();
365 // this is a response... deallocate packet buffer now.
366 delete buf;
367
368 if (!was_nacked_here) {
369 assert(outstandingResponses != 0);

--- 100 unchanged lines hidden ---