coherent_xbar.cc (12778:ca8c50112a66) coherent_xbar.cc (12780:14937f6495b4)
1/*
1/*
2 * Copyright (c) 2011-2017 ARM Limited
2 * Copyright (c) 2011-2018 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

146
147 // remember if the packet is an express snoop
148 bool is_express_snoop = pkt->isExpressSnoop();
149 bool cache_responding = pkt->cacheResponding();
150 // for normal requests, going downstream, the express snoop flag
151 // and the cache responding flag should always be the same
152 assert(is_express_snoop == cache_responding);
153
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

146
147 // remember if the packet is an express snoop
148 bool is_express_snoop = pkt->isExpressSnoop();
149 bool cache_responding = pkt->cacheResponding();
150 // for normal requests, going downstream, the express snoop flag
151 // and the cache responding flag should always be the same
152 assert(is_express_snoop == cache_responding);
153
154 // determine the destination based on the address
155 PortID master_port_id = findPort(pkt->getAddr());
154 // determine the destination based on the destination address range
155 AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
156 PortID master_port_id = findPort(addr_range);
156
157 // test if the crossbar should be considered occupied for the current
158 // port, and exclude express snoops from the check
159 if (!is_express_snoop && !reqLayers[master_port_id]->tryTiming(src_port)) {
160 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__,
161 src_port->name(), pkt->print());
162 return false;
163 }

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

546 routeTo[pkt->req] = master_port_id;
547 }
548
549 // a snoop request came from a connected slave device (one of
550 // our master ports), and if it is not coming from the slave
551 // device responsible for the address range something is
552 // wrong, hence there is nothing further to do as the packet
553 // would be going back to where it came from
157
158 // test if the crossbar should be considered occupied for the current
159 // port, and exclude express snoops from the check
160 if (!is_express_snoop && !reqLayers[master_port_id]->tryTiming(src_port)) {
161 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__,
162 src_port->name(), pkt->print());
163 return false;
164 }

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

547 routeTo[pkt->req] = master_port_id;
548 }
549
550 // a snoop request came from a connected slave device (one of
551 // our master ports), and if it is not coming from the slave
552 // device responsible for the address range something is
553 // wrong, hence there is nothing further to do as the packet
554 // would be going back to where it came from
554 assert(master_port_id == findPort(pkt->getAddr()));
555 AddrRange addr_range M5_VAR_USED =
556 RangeSize(pkt->getAddr(), pkt->getSize());
557 assert(findPort(addr_range) == master_port_id);
555}
556
557bool
558CoherentXBar::recvTimingSnoopResp(PacketPtr pkt, PortID slave_port_id)
559{
560 // determine the source port based on the id
561 SlavePort* src_port = slavePorts[slave_port_id];
562

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

776
777 // set up a sensible default value
778 Tick response_latency = 0;
779
780 const bool sink_packet = sinkPacket(pkt);
781
782 // even if we had a snoop response, we must continue and also
783 // perform the actual request at the destination
558}
559
560bool
561CoherentXBar::recvTimingSnoopResp(PacketPtr pkt, PortID slave_port_id)
562{
563 // determine the source port based on the id
564 SlavePort* src_port = slavePorts[slave_port_id];
565

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

779
780 // set up a sensible default value
781 Tick response_latency = 0;
782
783 const bool sink_packet = sinkPacket(pkt);
784
785 // even if we had a snoop response, we must continue and also
786 // perform the actual request at the destination
784 PortID master_port_id = findPort(pkt->getAddr());
787 AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
788 PortID master_port_id = findPort(addr_range);
785
786 if (sink_packet) {
787 DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__,
788 pkt->print());
789 } else {
790 if (forwardPacket(pkt)) {
791 // make sure that the write request (e.g., WriteClean)
792 // will stop at the memory below if this crossbar is its

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

1000 // here
1001 if (p->checkFunctional(pkt)) {
1002 if (pkt->needsResponse())
1003 pkt->makeResponse();
1004 return;
1005 }
1006 }
1007
789
790 if (sink_packet) {
791 DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__,
792 pkt->print());
793 } else {
794 if (forwardPacket(pkt)) {
795 // make sure that the write request (e.g., WriteClean)
796 // will stop at the memory below if this crossbar is its

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

1004 // here
1005 if (p->checkFunctional(pkt)) {
1006 if (pkt->needsResponse())
1007 pkt->makeResponse();
1008 return;
1009 }
1010 }
1011
1008 PortID dest_id = findPort(pkt->getAddr());
1012 PortID dest_id = findPort(RangeSize(pkt->getAddr(), pkt->getSize()));
1009
1010 masterPorts[dest_id]->sendFunctional(pkt);
1011 }
1012}
1013
1014void
1015CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id)
1016{

--- 113 unchanged lines hidden ---
1013
1014 masterPorts[dest_id]->sendFunctional(pkt);
1015 }
1016}
1017
1018void
1019CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id)
1020{

--- 113 unchanged lines hidden ---