summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:43 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:43 -0400
commitdf973abef3a70074971375cfe52c46f53528c00e (patch)
tree7c10603edb5c66631288cb0f9fa334df4cf3d8a9 /src/sim
parent37908d62a4b45962a6e6f5993027b6b9bafa296d (diff)
downloadgem5-df973abef3a70074971375cfe52c46f53528c00e.tar.xz
mem: Dynamically determine page bytes in memory components
This patch takes a step towards an ISA-agnostic memory system by enabling the components to establish the page size after instantiation. The swap operation in the memory is now also allowing any granularity to avoid depending on the IntReg of the ISA.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/system.cc2
-rw-r--r--src/sim/system.hh14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index c0b9486f4..61c6decf7 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -45,14 +45,12 @@
* Rick Strong
*/
-#include "arch/isa_traits.hh"
#include "arch/remote_gdb.hh"
#include "arch/utility.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
#include "base/str.hh"
#include "base/trace.hh"
-#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
#include "debug/Loader.hh"
#include "debug/WorkItems.hh"
diff --git a/src/sim/system.hh b/src/sim/system.hh
index 5b68373a6..d82978018 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012, 2014 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -51,9 +51,11 @@
#include <utility>
#include <vector>
+#include "arch/isa_traits.hh"
#include "base/loader/symtab.hh"
#include "base/misc.hh"
#include "base/statistics.hh"
+#include "config/the_isa.hh"
#include "cpu/pc_event.hh"
#include "enums/MemoryMode.hh"
#include "kern/system_events.hh"
@@ -269,6 +271,16 @@ class System : public MemObject
*/
bool isMemAddr(Addr addr) const;
+ /**
+ * Get the page bytes for the ISA.
+ */
+ Addr getPageBytes() const { return TheISA::PageBytes; }
+
+ /**
+ * Get the number of bits worth of in-page adress for the ISA.
+ */
+ Addr getPageShift() const { return TheISA::PageShift; }
+
protected:
PhysicalMemory physmem;