Deleted Added
sdiff udiff text old ( 12346:9b1144d046ca ) new ( 12351:17eaa27bef22 )
full compact
1/*
2 * Copyright (c) 2011-2017 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

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

35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Ali Saidi
41 * Andreas Hansson
42 * William Wang
43 */
44
45/**
46 * @file
47 * Definition of a crossbar object.
48 */
49
50#include "mem/coherent_xbar.hh"

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

189 // the request
190 const bool is_destination = isDestination(pkt);
191
192 const bool snoop_caches = !system->bypassCaches() &&
193 pkt->cmd != MemCmd::WriteClean;
194 if (snoop_caches) {
195 assert(pkt->snoopDelay == 0);
196
197 // the packet is a memory-mapped request and should be
198 // broadcasted to our snoopers but the source
199 if (snoopFilter) {
200 // check with the snoop filter where to forward this packet
201 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port);
202 // the time required by a packet to be delivered through
203 // the xbar has to be charged also with to lookup latency
204 // of the snoop filter

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

337 snoopTraffic += pkt_size;
338 }
339 }
340
341 if (sink_packet)
342 // queue the packet for deletion
343 pendingDelete.reset(pkt);
344
345 if (respond_directly) {
346 assert(pkt->needsResponse());
347 assert(success);
348
349 pkt->makeResponse();
350
351 if (snoopFilter && !system->bypassCaches()) {
352 // let the snoop filter inspect the response and update its state
353 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
354 }
355
356 Tick response_time = clockEdge() + pkt->headerDelay;
357 pkt->headerDelay = 0;
358
359 slavePorts[slave_port_id]->schedTimingResp(pkt, response_time);
360 }
361
362 return success;
363}
364
365bool
366CoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
367{

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

749 // if we got a response from a snooper, restore it here
750 if (snoop_response_cmd != MemCmd::InvalidCmd) {
751 // no one else should have responded
752 assert(!pkt->isResponse());
753 pkt->cmd = snoop_response_cmd;
754 response_latency = snoop_response_latency;
755 }
756
757 // add the response data
758 if (pkt->isResponse()) {
759 pkt_size = pkt->hasData() ? pkt->getSize() : 0;
760 pkt_cmd = pkt->cmdToIndex();
761
762 // stats updates
763 pktCount[slave_port_id][master_port_id]++;
764 pktSize[slave_port_id][master_port_id] += pkt_size;

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

983 (pkt->cacheResponding() &&
984 (!pkt->needsWritable() || pkt->responderHadWritable()));
985}
986
987bool
988CoherentXBar::forwardPacket(const PacketPtr pkt)
989{
990 // we are forwarding the packet if:
991 // 1) this is a read or a write
992 // 2) this crossbar is above the point of coherency
993 return pkt->isRead() || pkt->isWrite() || !pointOfCoherency;
994}
995
996
997void
998CoherentXBar::regStats()
999{
1000 // register the stats of the base class and our layers

--- 30 unchanged lines hidden ---