summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-02-17 02:48:56 -0500
committerNathan Binkert <binkertn@umich.edu>2005-02-17 02:48:56 -0500
commita24016c731a69c47e694458f7f564ef1630d34c1 (patch)
tree8c03f1fb82dc9c5c0c7a100d00d4e42b48b151a1 /sim
parent2e4bb0fc0ca51d08b64f364305661b883e429170 (diff)
downloadgem5-a24016c731a69c47e694458f7f564ef1630d34c1.tar.xz
Several tweaks to make binning work in any simulation
configuration so that we can always have binning on. base/statistics.cc: If we're binning, and there is no bin active at the time we check all stats stuff, create a bin. base/statistics.hh: FS_MEASURE doesn't exist anymore base/stats/text.cc: don't print out bin names if there is only one bin sim/process.cc: don't zero stats. It happens automatically. Don't activate the context at the time it is registered, instead activate the first context in a startup callback. sim/process.hh: Add startup callback to initialize the first exec context --HG-- extra : convert_revision : bcb23cdb184b0abf7cecd79902f8a59b50f71fe4
Diffstat (limited to 'sim')
-rw-r--r--sim/process.cc23
-rw-r--r--sim/process.hh2
2 files changed, 16 insertions, 9 deletions
diff --git a/sim/process.cc b/sim/process.cc
index c725d3b1c..4d860c51d 100644
--- a/sim/process.cc
+++ b/sim/process.cc
@@ -88,8 +88,6 @@ Process::Process(const string &name,
fd_map[i] = -1;
}
- num_syscalls = 0;
-
// other parameters will be initialized when the program is loaded
}
@@ -145,21 +143,28 @@ Process::registerExecContext(ExecContext *xc)
execContexts.push_back(xc);
if (myIndex == 0) {
- // first exec context for this process... initialize & enable
-
// copy process's initial regs struct
xc->regs = *init_regs;
-
- // mark this context as active.
- // activate with zero delay so that we start ticking right
- // away on cycle 0
- xc->activate(0);
}
// return CPU number to caller and increment available CPU count
return myIndex;
}
+void
+Process::startup()
+{
+ if (execContexts.empty())
+ return;
+
+ // first exec context for this process... initialize & enable
+ ExecContext *xc = execContexts[0];
+
+ // mark this context as active.
+ // activate with zero delay so that we start ticking right
+ // away on cycle 0
+ xc->activate(0);
+}
void
Process::replaceExecContext(ExecContext *xc, int xcIndex)
diff --git a/sim/process.hh b/sim/process.hh
index bb4829875..817ab656c 100644
--- a/sim/process.hh
+++ b/sim/process.hh
@@ -108,6 +108,8 @@ class Process : public SimObject
int stdout_fd,
int stderr_fd);
+ // post initialization startup
+ virtual void startup();
protected:
FunctionalMemory *memory;