summaryrefslogtreecommitdiff
path: root/sim/system.hh
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2004-03-11 18:52:29 -0500
committerLisa Hsu <hsul@eecs.umich.edu>2004-03-11 18:52:29 -0500
commit3bc8cffc75c2e03a6a8fe5f4425940a16405f672 (patch)
tree1d44dba1a7dbd4aef6fad45753b7607928d3414a /sim/system.hh
parent1039028d408d5a374a67d8d3ecc640a0e6559fbb (diff)
parent2c60d7aa9e4b48f30ab8c48436ff2dfec8e390f2 (diff)
downloadgem5-3bc8cffc75c2e03a6a8fe5f4425940a16405f672.tar.xz
merge with m5 head
--HG-- extra : convert_revision : c90339248d1ee74df1c6b90a77ec9ea41f646311
Diffstat (limited to 'sim/system.hh')
-rw-r--r--sim/system.hh54
1 files changed, 26 insertions, 28 deletions
diff --git a/sim/system.hh b/sim/system.hh
index e5d990e86..7b011aa8f 100644
--- a/sim/system.hh
+++ b/sim/system.hh
@@ -32,14 +32,11 @@
#include <string>
#include <vector>
-#include "sim/sim_object.hh"
-#include "cpu/pc_event.hh"
#include "base/loader/symtab.hh"
-
-#ifdef FS_MEASURE
#include "base/statistics.hh"
+#include "cpu/pc_event.hh"
+#include "sim/sim_object.hh"
#include "sim/sw_context.hh"
-#endif
class MemoryController;
class PhysicalMemory;
@@ -51,11 +48,33 @@ class ExecContext;
class System : public SimObject
{
-#ifdef FS_MEASURE
+ // lisa's binning stuff
protected:
std::map<const std::string, Statistics::MainBin *> fnBins;
std::map<const Addr, SWContext *> swCtxMap;
-#endif //FS_MEASURE
+
+ public:
+ Statistics::Scalar<Counter> fnCalls;
+ Statistics::MainBin *Kernel;
+ Statistics::MainBin *User;
+
+ Statistics::MainBin * getBin(const std::string &name);
+ virtual bool findCaller(std::string, std::string) const = 0;
+
+ SWContext *findContext(Addr pcb);
+ bool addContext(Addr pcb, SWContext *ctx) {
+ return (swCtxMap.insert(make_pair(pcb, ctx))).second;
+ }
+ void remContext(Addr pcb) {
+ swCtxMap.erase(pcb);
+ return;
+ }
+
+ virtual void dumpState(ExecContext *xc) const = 0;
+
+ virtual void serialize(std::ostream &os);
+ virtual void unserialize(Checkpoint *cp, const std::string &section);
+ //
public:
const uint64_t init_param;
@@ -71,11 +90,6 @@ class System : public SimObject
virtual int registerExecContext(ExecContext *xc);
virtual void replaceExecContext(int xcIndex, ExecContext *xc);
-#ifdef FS_MEASURE
- Statistics::Scalar<Counter, Statistics::MainBin> fnCalls;
- Statistics::MainBin *nonPath;
-#endif //FS_MEASURE
-
public:
System(const std::string _name, const uint64_t _init_param,
MemoryController *, PhysicalMemory *, const bool);
@@ -86,22 +100,6 @@ class System : public SimObject
virtual Addr getKernelEntry() const = 0;
virtual bool breakpoint() = 0;
-#ifdef FS_MEASURE
- Statistics::MainBin * getBin(const std::string &name);
- virtual bool findCaller(std::string, std::string) const = 0;
-
- SWContext *findContext(Addr pcb);
- bool addContext(Addr pcb, SWContext *ctx) {
- return (swCtxMap.insert(make_pair(pcb, ctx))).second;
- }
- void remContext(Addr pcb) {
- swCtxMap.erase(pcb);
- return;
- }
-
- virtual void dumpState(ExecContext *xc) const = 0;
-#endif //FS_MEASURE
-
public:
////////////////////////////////////////////
//