Replace curTick global variable with accessor functions.

This step makes it easy to replace the accessor functions
(which still access a global variable) with ones that access
per-thread curTick values.
This commit is contained in:
Steve Reinhardt
2011-01-07 21:50:29 -08:00
parent c22be9f2f0
commit 6f1187943c
129 changed files with 515 additions and 509 deletions

View File

@@ -127,7 +127,7 @@ def simulate(*args, **kwargs):
# Export curTick to user script.
def curTick():
return internal.core.cvar.curTick
return internal.core.curTick()
# Python exit handlers happen in reverse order. We want to dump stats last.
atexit.register(internal.stats.dump)

View File

@@ -73,8 +73,7 @@ const bool flag_TRACING_ON;
void setClockFrequency(Tick ticksPerSecond);
%immutable curTick;
Tick curTick;
Tick curTick();
class Checkpoint;

View File

@@ -37,6 +37,7 @@
#include "base/statistics.hh"
#include "base/stats/mysql.hh"
#include "base/stats/text.hh"
#include "sim/core.hh"
#include "sim/stat_control.hh"
%}
@@ -51,7 +52,7 @@ void initMySQL(std::string host, std::string database, std::string user,
std::string sample);
void schedStatEvent(bool dump, bool reset,
Tick when = curTick, Tick repeat = 0);
Tick when = curTick(), Tick repeat = 0);
void enable();
void prepare();