noncoherent_xbar.cc (10719:b4fc9ad648aa) noncoherent_xbar.cc (10888:85a001f2193b)
1/*
2 * Copyright (c) 2011-2015 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

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

77 masterPorts.push_back(bp);
78 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
79 defaultPortID)));
80 }
81
82 // create the slave ports, once again starting at zero
83 for (int i = 0; i < p->port_slave_connection_count; ++i) {
84 std::string portName = csprintf("%s.slave[%d]", name(), i);
1/*
2 * Copyright (c) 2011-2015 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

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

77 masterPorts.push_back(bp);
78 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
79 defaultPortID)));
80 }
81
82 // create the slave ports, once again starting at zero
83 for (int i = 0; i < p->port_slave_connection_count; ++i) {
84 std::string portName = csprintf("%s.slave[%d]", name(), i);
85 SlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
85 QueuedSlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
86 slavePorts.push_back(bp);
87 respLayers.push_back(new RespLayer(*bp, *this,
88 csprintf(".respLayer%d", i)));
89 }
90
91 clearPortCache();
92}
93

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

213 Tick xbar_delay = responseLatency * clockPeriod();
214
215 // set the packet header and payload delay
216 calcPacketTiming(pkt, xbar_delay);
217
218 // determine how long to be crossbar layer is busy
219 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
220
86 slavePorts.push_back(bp);
87 respLayers.push_back(new RespLayer(*bp, *this,
88 csprintf(".respLayer%d", i)));
89 }
90
91 clearPortCache();
92}
93

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

213 Tick xbar_delay = responseLatency * clockPeriod();
214
215 // set the packet header and payload delay
216 calcPacketTiming(pkt, xbar_delay);
217
218 // determine how long to be crossbar layer is busy
219 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
220
221 // send the packet through the destination slave port
222 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
221 // send the packet through the destination slave port, and pay for
222 // any outstanding latency
223 Tick latency = pkt->headerDelay;
224 pkt->headerDelay = 0;
225 slavePorts[slave_port_id]->schedTimingResp(pkt, curTick() + latency);
223
226
224 // currently it is illegal to block responses... can lead to
225 // deadlock
226 assert(success);
227
228 // remove the request from the routing table
229 routeTo.erase(route_lookup);
230
231 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
232
233 // stats updates
234 pktCount[slave_port_id][master_port_id]++;
235 pktSize[slave_port_id][master_port_id] += pkt_size;

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

290 if (!pkt->isPrint()) {
291 // don't do DPRINTFs on PrintReq as it clutters up the output
292 DPRINTF(NoncoherentXBar,
293 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
294 slavePorts[slave_port_id]->name(), pkt->getAddr(),
295 pkt->cmdString());
296 }
297
227 // remove the request from the routing table
228 routeTo.erase(route_lookup);
229
230 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
231
232 // stats updates
233 pktCount[slave_port_id][master_port_id]++;
234 pktSize[slave_port_id][master_port_id] += pkt_size;

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

289 if (!pkt->isPrint()) {
290 // don't do DPRINTFs on PrintReq as it clutters up the output
291 DPRINTF(NoncoherentXBar,
292 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
293 slavePorts[slave_port_id]->name(), pkt->getAddr(),
294 pkt->cmdString());
295 }
296
297 // since our slave ports are queued ports we need to check them as well
298 for (const auto& p : slavePorts) {
299 // if we find a response that has the data, then the
300 // downstream caches/memories may be out of date, so simply stop
301 // here
302 if (p->checkFunctional(pkt)) {
303 if (pkt->needsResponse())
304 pkt->makeResponse();
305 return;
306 }
307 }
308
298 // determine the destination port
299 PortID dest_id = findPort(pkt->getAddr());
300
301 // forward the request to the appropriate destination
302 masterPorts[dest_id]->sendFunctional(pkt);
303}
304
305unsigned int

--- 27 unchanged lines hidden ---
309 // determine the destination port
310 PortID dest_id = findPort(pkt->getAddr());
311
312 // forward the request to the appropriate destination
313 masterPorts[dest_id]->sendFunctional(pkt);
314}
315
316unsigned int

--- 27 unchanged lines hidden ---