Update statistics to use cycles properly instead of ticks
[gem5.git] / src / mem / mem_object.hh
index ac547619d27897f3e3e717d4d73117a40c4e685c..33b56dfd4094c9637b262fe96c1c8bf3a9abfb44 100644 (file)
 
 /**
  * @file
- * Base Memory Object decleration.
+ * Base Memory Object declaration.
  */
 
 #ifndef __MEM_MEM_OBJECT_HH__
 #define __MEM_MEM_OBJECT_HH__
 
-#include "sim/sim_object.hh"
 #include "mem/port.hh"
+#include "params/MemObject.hh"
+#include "sim/sim_object.hh"
 
 /**
  * The base MemoryObject class, allows for an accesor function to a
 class MemObject : public SimObject
 {
   public:
-    MemObject(const std::string &name);
+    typedef MemObjectParams Params;
+    MemObject(const Params *params);
+
+    const Params *
+    params() const
+    {
+        return dynamic_cast<const Params *>(_params);
+    }
+
+  protected:
+    // static: support for old-style constructors (call manually)
+    static Params *makeParams(const std::string &name);
 
   public:
     /** Additional function to return the Port of a memory object. */
-    virtual Port *getPort(const std::string &if_name) = 0;
+    virtual Port *getPort(const std::string &if_name, int idx = -1) = 0;
+
+    /** Tell object that this port is about to disappear, so it should remove it
+     * from any structures that it's keeping it in. */
+    virtual void deletePortRefs(Port *p) ;
 };
 
 #endif //__MEM_MEM_OBJECT_HH__