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:
@@ -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)
|
||||
|
||||
@@ -73,8 +73,7 @@ const bool flag_TRACING_ON;
|
||||
|
||||
void setClockFrequency(Tick ticksPerSecond);
|
||||
|
||||
%immutable curTick;
|
||||
Tick curTick;
|
||||
Tick curTick();
|
||||
|
||||
class Checkpoint;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user