Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/50350 )
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
---
M src/sim/mem_pool.cc
M src/sim/mem_pool.hh
M src/sim/se_workload.cc
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/sim/mem_pool.cc b/src/sim/mem_pool.cc
index 9bf2739..3f3cb18 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
{
@@ -131,14 +128,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 7cc3571..c1db399 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
{
@@ -91,7 +90,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: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s