pull from head before pushing linux tree
[gem5.git] / sim / system.hh
index 050d1dd112d0d8a8a6f37ada946ed4a64b87da25..baf82a5b5a858d38dce41288730c7617ce48ab16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2002-2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include "base/loader/symtab.hh"
 #include "base/statistics.hh"
 #include "cpu/pc_event.hh"
+#include "kern/system_events.hh"
 #include "sim/sim_object.hh"
 #include "sim/sw_context.hh"
 
 class MemoryController;
 class PhysicalMemory;
+class Platform;
 class RemoteGDB;
 class GDBListener;
 
@@ -48,17 +50,20 @@ class ExecContext;
 class System : public SimObject
 {
     // lisa's binning stuff
-  protected:
-    std::map<const std::string, Statistics::MainBin *> fnBins;
+  private:
+    std::map<const std::string, Stats::MainBin *> fnBins;
     std::map<const Addr, SWContext *> swCtxMap;
 
+  protected:
+    std::vector<FnEvent *> fnEvents;
+
   public:
-    Statistics::Scalar<> fnCalls;
-    Statistics::MainBin *Kernel;
-    Statistics::MainBin *User;
+    Stats::Scalar<> fnCalls;
+    Stats::MainBin *Kernel;
+    Stats::MainBin *User;
 
-    Statistics::MainBin * getBin(const std::string &name);
-    virtual bool findCaller(std::string, std::string) const = 0;
+    Stats::MainBin * getBin(const std::string &name);
+    bool findCaller(std::string, std::string) const;
 
     SWContext *findContext(Addr pcb);
     bool addContext(Addr pcb, SWContext *ctx) {
@@ -68,18 +73,24 @@ class System : public SimObject
         swCtxMap.erase(pcb);
         return;
     }
-
-    virtual void dumpState(ExecContext *xc) const = 0;
+    void dumpState(ExecContext *xc) const;
 
     virtual void serialize(std::ostream &os);
     virtual void unserialize(Checkpoint *cp, const std::string &section);
-    //
+
+
+  private:
+    std::multimap<const std::string, std::string> callerMap;
+    void populateMap(std::string caller, std::string callee);
+//
 
   public:
     const uint64_t init_param;
     MemoryController *memCtrl;
     PhysicalMemory *physmem;
+    Platform *platform;
     bool bin;
+    std::vector<string> binned_fns;
 
     PCEventQueue pcEventQueue;
 
@@ -90,7 +101,8 @@ class System : public SimObject
 
   public:
     System(const std::string _name, const uint64_t _init_param,
-           MemoryController *, PhysicalMemory *, const bool);
+           MemoryController *, PhysicalMemory *, const bool,
+           const std::vector<string> &binned_fns);
     ~System();
 
     virtual Addr getKernelStart() const = 0;