coherent_xbar.cc (11129:48c02e8b0bbb) coherent_xbar.cc (11130:45a23e44e93d)
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

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

600 // check with the snoop filter where to forward this packet
601 auto sf_res =
602 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]);
603 snoop_response_latency += sf_res.second * clockPeriod();
604 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x"\
605 " SF size: %i lat: %i\n", __func__,
606 slavePorts[slave_port_id]->name(), pkt->cmdString(),
607 pkt->getAddr(), sf_res.first.size(), sf_res.second);
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

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

600 // check with the snoop filter where to forward this packet
601 auto sf_res =
602 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]);
603 snoop_response_latency += sf_res.second * clockPeriod();
604 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x"\
605 " SF size: %i lat: %i\n", __func__,
606 slavePorts[slave_port_id]->name(), pkt->cmdString(),
607 pkt->getAddr(), sf_res.first.size(), sf_res.second);
608
609 // let the snoop filter know about the success of the send
610 // operation, and do it even before sending it onwards to
611 // avoid situations where atomic upward snoops sneak in
612 // between and change the filter state
613 snoopFilter->updateRequest(pkt, *slavePorts[slave_port_id], false);
614
608 snoop_result = forwardAtomic(pkt, slave_port_id, InvalidPortID,
609 sf_res.first);
610 } else {
611 snoop_result = forwardAtomic(pkt, slave_port_id);
612 }
613 snoop_response_cmd = snoop_result.first;
614 snoop_response_latency += snoop_result.second;
615 }
616
615 snoop_result = forwardAtomic(pkt, slave_port_id, InvalidPortID,
616 sf_res.first);
617 } else {
618 snoop_result = forwardAtomic(pkt, slave_port_id);
619 }
620 snoop_response_cmd = snoop_result.first;
621 snoop_response_latency += snoop_result.second;
622 }
623
624 // forwardAtomic snooped into peer caches of the sender, and if
625 // this is a clean evict, but the packet is found in a cache, do
626 // not forward it
627 if (pkt->cmd == MemCmd::CleanEvict && pkt->isBlockCached()) {
628 DPRINTF(CoherentXBar, "recvAtomic: Clean evict 0x%x still cached, "
629 "not forwarding\n", pkt->getAddr());
630 return 0;
631 }
632
617 // even if we had a snoop response, we must continue and also
618 // perform the actual request at the destination
619 PortID master_port_id = findPort(pkt->getAddr());
620
621 // stats updates for the request
622 pktCount[slave_port_id][master_port_id]++;
623 pktSize[slave_port_id][master_port_id] += pkt_size;
624 transDist[pkt_cmd]++;
625
626 // forward the request to the appropriate destination
627 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
628
633 // even if we had a snoop response, we must continue and also
634 // perform the actual request at the destination
635 PortID master_port_id = findPort(pkt->getAddr());
636
637 // stats updates for the request
638 pktCount[slave_port_id][master_port_id]++;
639 pktSize[slave_port_id][master_port_id] += pkt_size;
640 transDist[pkt_cmd]++;
641
642 // forward the request to the appropriate destination
643 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
644
629 // Lower levels have replied, tell the snoop filter
630 if (snoopFilter && !system->bypassCaches() && pkt->isResponse()) {
645 // if lower levels have replied, tell the snoop filter
646 if (!system->bypassCaches() && snoopFilter && pkt->isResponse()) {
631 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
632 }
633
634 // if we got a response from a snooper, restore it here
635 if (snoop_response_cmd != MemCmd::InvalidCmd) {
636 // no one else should have responded
637 assert(!pkt->isResponse());
638 pkt->cmd = snoop_response_cmd;

--- 233 unchanged lines hidden ---
647 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
648 }
649
650 // if we got a response from a snooper, restore it here
651 if (snoop_response_cmd != MemCmd::InvalidCmd) {
652 // no one else should have responded
653 assert(!pkt->isResponse());
654 pkt->cmd = snoop_response_cmd;

--- 233 unchanged lines hidden ---