From abc76f20cb98c90e8dab416dd16dfd4a954013ba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Jul 2007 21:51:38 -0700 Subject: Major changes to how SimObjects are created and initialized. Almost all creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed --- src/mem/physical.hh | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/mem/physical.hh') diff --git a/src/mem/physical.hh b/src/mem/physical.hh index b9af5d334..ee2578bb5 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -34,13 +34,15 @@ #ifndef __PHYSICAL_MEMORY_HH__ #define __PHYSICAL_MEMORY_HH__ +#include +#include + #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 -#include // // Functional model for a contiguous block of physical memory. (i.e. RAM) @@ -148,25 +150,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 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(_params); + } + public: int deviceBlockSize(); void getAddressRanges(AddrRangeList &resp, bool &snoop); -- cgit v1.2.3