/*
- * 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 <string>
#include <vector>
-#include "sim/sim_object.hh"
-#include "cpu/pc_event.hh"
#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;
class System : public SimObject
{
+ // lisa's binning stuff
+ private:
+ std::map<const std::string, Stats::MainBin *> fnBins;
+ std::map<const Addr, SWContext *> swCtxMap;
+
+ protected:
+ std::vector<FnEvent *> fnEvents;
+
+ public:
+ Stats::Scalar<> fnCalls;
+ Stats::MainBin *Kernel;
+ Stats::MainBin *User;
+
+ Stats::MainBin * getBin(const std::string &name);
+ bool findCaller(std::string, std::string) const;
+
+ 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;
+ }
+ void dumpState(ExecContext *xc) const;
+
+ virtual void serialize(std::ostream &os);
+ virtual void unserialize(Checkpoint *cp, const std::string §ion);
+
+
+ private:
+ std::multimap<const std::string, std::string> callerMap;
+ void populateMap(std::string caller, std::string callee);
+//
+
public:
- const int init_param;
+ const uint64_t init_param;
MemoryController *memCtrl;
PhysicalMemory *physmem;
+ Platform *platform;
+ bool bin;
+ std::vector<string> binned_fns;
PCEventQueue pcEventQueue;
- std::vector<ExecContext *> xcvec;
- void registerExecContext(ExecContext *xc);
+ std::vector<ExecContext *> execContexts;
+
+ virtual int registerExecContext(ExecContext *xc);
+ virtual void replaceExecContext(int xcIndex, ExecContext *xc);
public:
- System(const std::string _name, const int _init_param,
- MemoryController *, PhysicalMemory *);
+ System(const std::string _name, const uint64_t _init_param,
+ MemoryController *, PhysicalMemory *, const bool,
+ const std::vector<string> &binned_fns);
~System();
- virtual void init(ExecContext *xc) = 0;
-
virtual Addr getKernelStart() const = 0;
virtual Addr getKernelEnd() const = 0;
virtual Addr getKernelEntry() const = 0;
virtual bool breakpoint() = 0;
-
public:
////////////////////////////////////////////
//