summaryrefslogtreecommitdiff
path: root/src/mem/physical.cc
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-06-04 16:30:50 +0100
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-06-19 14:24:25 +0000
commit353722e76e6f2303a3990b974e27bc055c584958 (patch)
tree6718a24d2798f042b43adb23af7cf8ccdf4a40c5 /src/mem/physical.cc
parent6cb46ba839b2bf535e294fde9179e2aff6095814 (diff)
downloadgem5-353722e76e6f2303a3990b974e27bc055c584958.tar.xz
mem: Use address range to find the right physical address
Previously, we used the start address to determine the right physical memory while servicing memory requests. This change uses the full address range to correctly determine the right physical memory and expose bugs where requests might not fully map to a single physical memory. Change-Id: I183d7552918106000f917a62ceb877511ff0ff71 Reviewed-on: https://gem5-review.googlesource.com/11118 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/physical.cc')
-rw-r--r--src/mem/physical.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index fdc88a8c0..280620430 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -278,8 +278,8 @@ void
PhysicalMemory::access(PacketPtr pkt)
{
assert(pkt->isRequest());
- Addr addr = pkt->getAddr();
- const auto& m = addrMap.contains(addr);
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ const auto& m = addrMap.contains(addr_range);
assert(m != addrMap.end());
m->second->access(pkt);
}
@@ -288,8 +288,8 @@ void
PhysicalMemory::functionalAccess(PacketPtr pkt)
{
assert(pkt->isRequest());
- Addr addr = pkt->getAddr();
- const auto& m = addrMap.contains(addr);
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ const auto& m = addrMap.contains(addr_range);
assert(m != addrMap.end());
m->second->functionalAccess(pkt);
}