summaryrefslogtreecommitdiff
path: root/src/mem/coherent_xbar.cc
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-06-04 16:20:47 +0100
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-06-19 14:24:25 +0000
commit6cb46ba839b2bf535e294fde9179e2aff6095814 (patch)
tree16cf3f355db2d378b0213406c84de968d51f01fc /src/mem/coherent_xbar.cc
parente27448fd0e21dbf4ef77a8bbb33a4053e31cb67d (diff)
downloadgem5-6cb46ba839b2bf535e294fde9179e2aff6095814.tar.xz
mem: Use address range to find the destination port in the xbar
Previously the xbar used the start address to lookup the port map and determine the right destination of an incoming packet. This change uses the full address range to correctly determine the right master. Change-Id: I5118712c43ae65aba64e71bf030bca5c99770bdd Reviewed-on: https://gem5-review.googlesource.com/11117 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/coherent_xbar.cc')
-rw-r--r--src/mem/coherent_xbar.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mem/coherent_xbar.cc b/src/mem/coherent_xbar.cc
index 872ee5c0d..d46f3893f 100644
--- a/src/mem/coherent_xbar.cc
+++ b/src/mem/coherent_xbar.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 ARM Limited
+ * Copyright (c) 2011-2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -151,8 +151,9 @@ CoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
// and the cache responding flag should always be the same
assert(is_express_snoop == cache_responding);
- // determine the destination based on the address
- PortID master_port_id = findPort(pkt->getAddr());
+ // determine the destination based on the destination address range
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
// test if the crossbar should be considered occupied for the current
// port, and exclude express snoops from the check
@@ -551,7 +552,9 @@ CoherentXBar::recvTimingSnoopReq(PacketPtr pkt, PortID master_port_id)
// device responsible for the address range something is
// wrong, hence there is nothing further to do as the packet
// would be going back to where it came from
- assert(master_port_id == findPort(pkt->getAddr()));
+ AddrRange addr_range M5_VAR_USED =
+ RangeSize(pkt->getAddr(), pkt->getSize());
+ assert(findPort(addr_range) == master_port_id);
}
bool
@@ -781,7 +784,8 @@ CoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
// even if we had a snoop response, we must continue and also
// perform the actual request at the destination
- PortID master_port_id = findPort(pkt->getAddr());
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
if (sink_packet) {
DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__,
@@ -1005,7 +1009,7 @@ CoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
}
}
- PortID dest_id = findPort(pkt->getAddr());
+ PortID dest_id = findPort(RangeSize(pkt->getAddr(), pkt->getSize()));
masterPorts[dest_id]->sendFunctional(pkt);
}