summaryrefslogtreecommitdiff
path: root/src/mem/physical.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2007-07-26 23:15:49 -0700
committerNathan Binkert <nate@binkert.org>2007-07-26 23:15:49 -0700
commitf0fef8f850b0c5aa73337ca11b26169163b2b2e1 (patch)
treed49d3492618ee85717554cddbe62cba1b5e7fb9c /src/mem/physical.hh
parent6b73ff43ff58502c80050c7aeff5a08a4ce61f87 (diff)
parentcda354b07035f73a3b220f89014721300d36a815 (diff)
downloadgem5-f0fef8f850b0c5aa73337ca11b26169163b2b2e1.tar.xz
Merge python and x86 changes with cache branch
--HG-- extra : convert_revision : e06a950964286604274fba81dcca362d75847233
Diffstat (limited to 'src/mem/physical.hh')
-rw-r--r--src/mem/physical.hh31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/mem/physical.hh b/src/mem/physical.hh
index 8b13d32c1..b06cc90f8 100644
--- a/src/mem/physical.hh
+++ b/src/mem/physical.hh
@@ -34,13 +34,15 @@
#ifndef __PHYSICAL_MEMORY_HH__
#define __PHYSICAL_MEMORY_HH__
+#include <map>
+#include <string>
+
#include "base/range.hh"
#include "mem/mem_object.hh"
#include "mem/packet.hh"
#include "mem/tport.hh"
+#include "params/PhysicalMemory.hh"
#include "sim/eventq.hh"
-#include <map>
-#include <string>
//
// Functional model for a contiguous block of physical memory. (i.e. RAM)
@@ -149,25 +151,20 @@ class PhysicalMemory : public MemObject
public:
Addr new_page();
- uint64_t size() { return params()->addrRange.size(); }
- uint64_t start() { return params()->addrRange.start; }
-
- struct Params
- {
- std::string name;
- Range<Addr> addrRange;
- Tick latency;
- bool zero;
- };
-
- protected:
- Params *_params;
+ uint64_t size() { return params()->range.size(); }
+ uint64_t start() { return params()->range.start; }
public:
- const Params *params() const { return _params; }
- PhysicalMemory(Params *p);
+ typedef PhysicalMemoryParams Params;
+ PhysicalMemory(const Params *p);
virtual ~PhysicalMemory();
+ const Params *
+ params() const
+ {
+ return dynamic_cast<const Params *>(_params);
+ }
+
public:
int deviceBlockSize();
void getAddressRanges(AddrRangeList &resp, bool &snoop);