coherent_xbar.cc (10656:bd376adfb7d4) coherent_xbar.cc (10694:1a6785e37d81)
1/*
2 * Copyright (c) 2011-2014 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

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

163 pkt->getAddr());
164
165 // store size and command as they might be modified when
166 // forwarding the packet
167 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
168 unsigned int pkt_cmd = pkt->cmdToIndex();
169
170 calcPacketTiming(pkt);
1/*
2 * Copyright (c) 2011-2014 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

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

163 pkt->getAddr());
164
165 // store size and command as they might be modified when
166 // forwarding the packet
167 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
168 unsigned int pkt_cmd = pkt->cmdToIndex();
169
170 calcPacketTiming(pkt);
171 Tick packetFinishTime = pkt->lastWordDelay + curTick();
171 Tick packetFinishTime = curTick() + pkt->payloadDelay;
172
173 // uncacheable requests need never be snooped
174 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
175 // the packet is a memory-mapped request and should be
176 // broadcasted to our snoopers but the source
177 if (snoopFilter) {
178 // check with the snoop filter where to forward this packet
179 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port);

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

217 // check if we were successful in sending the packet onwards
218 if (!success) {
219 // express snoops and inhibited packets should never be forced
220 // to retry
221 assert(!is_express_snoop);
222 assert(!pkt->memInhibitAsserted());
223
224 // undo the calculation so we can check for 0 again
172
173 // uncacheable requests need never be snooped
174 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
175 // the packet is a memory-mapped request and should be
176 // broadcasted to our snoopers but the source
177 if (snoopFilter) {
178 // check with the snoop filter where to forward this packet
179 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port);

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

217 // check if we were successful in sending the packet onwards
218 if (!success) {
219 // express snoops and inhibited packets should never be forced
220 // to retry
221 assert(!is_express_snoop);
222 assert(!pkt->memInhibitAsserted());
223
224 // undo the calculation so we can check for 0 again
225 pkt->firstWordDelay = pkt->lastWordDelay = 0;
225 pkt->headerDelay = pkt->payloadDelay = 0;
226
227 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
228 src_port->name(), pkt->cmdString(), pkt->getAddr());
229
230 // update the layer state and schedule an idle event
231 reqLayers[master_port_id]->failedTiming(src_port,
232 clockEdge(headerCycles));
233 } else {

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

296 src_port->name(), pkt->cmdString(), pkt->getAddr());
297
298 // store size and command as they might be modified when
299 // forwarding the packet
300 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
301 unsigned int pkt_cmd = pkt->cmdToIndex();
302
303 calcPacketTiming(pkt);
226
227 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
228 src_port->name(), pkt->cmdString(), pkt->getAddr());
229
230 // update the layer state and schedule an idle event
231 reqLayers[master_port_id]->failedTiming(src_port,
232 clockEdge(headerCycles));
233 } else {

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

296 src_port->name(), pkt->cmdString(), pkt->getAddr());
297
298 // store size and command as they might be modified when
299 // forwarding the packet
300 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
301 unsigned int pkt_cmd = pkt->cmdToIndex();
302
303 calcPacketTiming(pkt);
304 Tick packetFinishTime = pkt->lastWordDelay + curTick();
304 Tick packetFinishTime = curTick() + pkt->payloadDelay;
305
306 if (snoopFilter && !pkt->req->isUncacheable() && !system->bypassCaches()) {
307 // let the snoop filter inspect the response and update its state
308 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
309 }
310
311 // send the packet through the destination slave port
312 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);

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

422 // forwarding the packet
423 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
424 unsigned int pkt_cmd = pkt->cmdToIndex();
425
426 // responses are never express snoops
427 assert(!pkt->isExpressSnoop());
428
429 calcPacketTiming(pkt);
305
306 if (snoopFilter && !pkt->req->isUncacheable() && !system->bypassCaches()) {
307 // let the snoop filter inspect the response and update its state
308 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
309 }
310
311 // send the packet through the destination slave port
312 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);

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

422 // forwarding the packet
423 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
424 unsigned int pkt_cmd = pkt->cmdToIndex();
425
426 // responses are never express snoops
427 assert(!pkt->isExpressSnoop());
428
429 calcPacketTiming(pkt);
430 Tick packetFinishTime = pkt->lastWordDelay + curTick();
430 Tick packetFinishTime = curTick() + pkt->payloadDelay;
431
432 // forward it either as a snoop response or a normal response
433 if (forwardAsSnoop) {
434 // this is a snoop response to a snoop request we forwarded,
435 // e.g. coming from the L1 and going to the L2, and it should
436 // be forwarded as a snoop response
437
438 if (snoopFilter) {

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

603 pkt_cmd = pkt->cmdToIndex();
604
605 // stats updates
606 pktCount[slave_port_id][master_port_id]++;
607 pktSize[slave_port_id][master_port_id] += pkt_size;
608 transDist[pkt_cmd]++;
609 }
610
431
432 // forward it either as a snoop response or a normal response
433 if (forwardAsSnoop) {
434 // this is a snoop response to a snoop request we forwarded,
435 // e.g. coming from the L1 and going to the L2, and it should
436 // be forwarded as a snoop response
437
438 if (snoopFilter) {

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

603 pkt_cmd = pkt->cmdToIndex();
604
605 // stats updates
606 pktCount[slave_port_id][master_port_id]++;
607 pktSize[slave_port_id][master_port_id] += pkt_size;
608 transDist[pkt_cmd]++;
609 }
610
611 // @todo: Not setting first-word time
612 pkt->lastWordDelay = response_latency;
611 // @todo: Not setting header time
612 pkt->payloadDelay = response_latency;
613 return response_latency;
614}
615
616Tick
617CoherentXBar::recvAtomicSnoop(PacketPtr pkt, PortID master_port_id)
618{
619 DPRINTF(CoherentXBar, "recvAtomicSnoop: packet src %s addr 0x%x cmd %s\n",
620 masterPorts[master_port_id]->name(), pkt->getAddr(),

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

643 if (snoop_response_cmd != MemCmd::InvalidCmd)
644 pkt->cmd = snoop_response_cmd;
645
646 // add the response snoop data
647 if (pkt->isResponse()) {
648 snoops++;
649 }
650
613 return response_latency;
614}
615
616Tick
617CoherentXBar::recvAtomicSnoop(PacketPtr pkt, PortID master_port_id)
618{
619 DPRINTF(CoherentXBar, "recvAtomicSnoop: packet src %s addr 0x%x cmd %s\n",
620 masterPorts[master_port_id]->name(), pkt->getAddr(),

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

643 if (snoop_response_cmd != MemCmd::InvalidCmd)
644 pkt->cmd = snoop_response_cmd;
645
646 // add the response snoop data
647 if (pkt->isResponse()) {
648 snoops++;
649 }
650
651 // @todo: Not setting first-word time
652 pkt->lastWordDelay = snoop_response_latency;
651 // @todo: Not setting header time
652 pkt->payloadDelay = snoop_response_latency;
653 return snoop_response_latency;
654}
655
656std::pair<MemCmd, Tick>
657CoherentXBar::forwardAtomic(PacketPtr pkt, PortID exclude_slave_port_id,
658 PortID source_master_port_id,
659 const std::vector<SlavePort*>& dests)
660{

--- 172 unchanged lines hidden ---
653 return snoop_response_latency;
654}
655
656std::pair<MemCmd, Tick>
657CoherentXBar::forwardAtomic(PacketPtr pkt, PortID exclude_slave_port_id,
658 PortID source_master_port_id,
659 const std::vector<SlavePort*>& dests)
660{

--- 172 unchanged lines hidden ---