summaryrefslogtreecommitdiff
path: root/src/mem/physical.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-11-19 18:23:43 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-11-19 18:23:43 -0500
commit8026ecbb8e9f93894b15ac5422c58ecedfbf9fdf (patch)
treece36c51aec53784f64a8ac36520775d76412f412 /src/mem/physical.hh
parentfed9ee52fc551068b4b256f5e77b3bb924bbac05 (diff)
downloadgem5-8026ecbb8e9f93894b15ac5422c58ecedfbf9fdf.tar.xz
Memory: Cache the physical memory start and size so we don't need a dynamic cast on every access.
--HG-- extra : convert_revision : d6c3e93718991e7b68248242c80d8e6ac637ac51
Diffstat (limited to 'src/mem/physical.hh')
-rw-r--r--src/mem/physical.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mem/physical.hh b/src/mem/physical.hh
index b06cc90f8..c3749bd5b 100644
--- a/src/mem/physical.hh
+++ b/src/mem/physical.hh
@@ -149,10 +149,12 @@ class PhysicalMemory : public MemObject
std::vector<MemoryPort*> ports;
typedef std::vector<MemoryPort*>::iterator PortIterator;
+ uint64_t cachedSize;
+ uint64_t cachedStart;
public:
Addr new_page();
- uint64_t size() { return params()->range.size(); }
- uint64_t start() { return params()->range.start; }
+ uint64_t size() { return cachedSize; }
+ uint64_t start() { return cachedStart; }
public:
typedef PhysicalMemoryParams Params;