Nikos Nikoleris has uploaded this change for review. ( https://gem5-review.googlesource.com/11118

Change subject: mem: Use address range to find the right physical address
......................................................................

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
---
M src/mem/physical.cc
1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index fdc88a8..2806204 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -278,8 +278,8 @@
 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 @@
 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);
 }

--
To view, visit https://gem5-review.googlesource.com/11118
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I183d7552918106000f917a62ceb877511ff0ff71
Gerrit-Change-Number: 11118
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to