Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/50338 )


3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one. Change subject: sim: Exclude the m5opRange from the system mempools by construction.
......................................................................

sim: Exclude the m5opRange from the system mempools by construction.

Don't look for the m5opRange in the memory pools when allocating memory
so that it can be skipped, just exclude it from the memory pools
entirely when they are set up. This removes a dependence between the
memory pools and the system class.

Change-Id: I0d88c1bc2f889f32b234073cff8988319fb36ea5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50338
Reviewed-by: Matthew Poremba <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/sim/mem_pool.cc
M src/sim/system.cc
2 files changed, 9 insertions(+), 11 deletions(-)

Approvals:
  Matthew Poremba: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/sim/mem_pool.cc b/src/sim/mem_pool.cc
index 8e2dc86..2614ad5 100644
--- a/src/sim/mem_pool.cc
+++ b/src/sim/mem_pool.cc
@@ -103,17 +103,9 @@
 {
     Addr return_addr = freePageAddr();
     freePageNum += npages;
-    Addr next_return_addr = freePageAddr();

-    if (sys->m5opRange().valid() &&
-        next_return_addr >= sys->m5opRange().start()) {
-        warn("Reached m5ops MMIO region\n");
-        return_addr = sys->m5opRange().end();
-        freePageNum = (return_addr >> sys->getPageShift()) + npages;
-    }
-
-    fatal_if((freePages() <= 0), "Out of memory, "
-             "please increase size of physical memory.");
+    fatal_if(freePages() <= 0,
+            "Out of memory, please increase size of physical memory.");

     return return_addr;
 }
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 0cb5805..299ba66 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -233,7 +233,13 @@
         assert(!memories.empty());
         for (const auto &mem : memories) {
             assert(!mem.interleaved());
-            memPools.emplace_back(this, mem.start(), mem.end());
+            if (_m5opRange.valid()) {
+                // Make sure the m5op range is not included.
+                for (const auto &range: mem.exclude({_m5opRange}))
+ memPools.emplace_back(this, range.start(), range.end());
+            } else {
+                memPools.emplace_back(this, mem.start(), mem.end());
+            }
         }

         /*

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

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I0d88c1bc2f889f32b234073cff8988319fb36ea5
Gerrit-Change-Number: 50338
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Alex Dutu <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to