From 353722e76e6f2303a3990b974e27bc055c584958 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Mon, 4 Jun 2018 16:30:50 +0100 Subject: [PATCH] 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 Maintainer: Nikos Nikoleris --- src/mem/physical.cc | 8 ++++---- 1 file 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); } -- 2.30.2