Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/50350 )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: sim: Move System specific code out of MemPools.
......................................................................
sim: Move System specific code out of MemPools.
Move that code into SEWorkload which already has to know about System
objects. The MemPool(s) object(s) now only have to worry about
AddrRanges and AddrRangeLists and don't have to know or care where they
came from.
Change-Id: Ic23aeb959d6f666b655d010c8572c41c60b5aa57
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50350
Tested-by: kokoro <[email protected]>
Maintainer: Gabe Black <[email protected]>
Reviewed-by: Matthew Poremba <[email protected]>
---
M src/sim/mem_pool.cc
M src/sim/mem_pool.hh
M src/sim/se_workload.cc
3 files changed, 29 insertions(+), 14 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 e489110..bd56df8 100644
--- a/src/sim/mem_pool.cc
+++ b/src/sim/mem_pool.cc
@@ -33,11 +33,8 @@
#include "sim/mem_pool.hh"
-#include <cassert>
-
#include "base/addr_range.hh"
#include "base/logging.hh"
-#include "sim/system.hh"
namespace gem5
{
@@ -147,14 +144,8 @@
}
void
-MemPools::populate(const System &sys)
+MemPools::populate(const AddrRangeList &memories)
{
- AddrRangeList memories = sys.getPhysMem().getConfAddrRanges();
- const auto &m5op_range = sys.m5opRange();
-
- if (m5op_range.valid())
- memories -= m5op_range;
-
for (const auto &mem : memories)
pools.emplace_back(pageShift, mem.start(), mem.end());
}
diff --git a/src/sim/mem_pool.hh b/src/sim/mem_pool.hh
index 613d763..a2a00d5 100644
--- a/src/sim/mem_pool.hh
+++ b/src/sim/mem_pool.hh
@@ -36,14 +36,13 @@
#include <vector>
+#include "base/addr_range.hh"
#include "base/types.hh"
#include "sim/serialize.hh"
namespace gem5
{
-class System;
-
/** Class for handling allocation of physical pages in SE mode. */
class MemPool : public Serializable
{
@@ -96,7 +95,7 @@
public:
MemPools(Addr page_shift) : pageShift(page_shift) {}
- void populate(const System &sys);
+ void populate(const AddrRangeList &memories);
/// Allocate npages contiguous unused physical pages.
/// @return Starting address of first page
diff --git a/src/sim/se_workload.cc b/src/sim/se_workload.cc
index 47bdb1c..d3c8570 100644
--- a/src/sim/se_workload.cc
+++ b/src/sim/se_workload.cc
@@ -43,7 +43,14 @@
SEWorkload::setSystem(System *sys)
{
Workload::setSystem(sys);
- memPools.populate(*sys);
+
+ AddrRangeList memories = sys->getPhysMem().getConfAddrRanges();
+ const auto &m5op_range = sys->m5opRange();
+
+ if (m5op_range.valid())
+ memories -= m5op_range;
+
+ memPools.populate(memories);
}
void
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50350
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: Ic23aeb959d6f666b655d010c8572c41c60b5aa57
Gerrit-Change-Number: 50350
Gerrit-PatchSet: 10
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-CC: Jason Lowe-Power <[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