diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
commit | 6f1187943cf78c2fd0334bd7e4372ae79a587fa4 (patch) | |
tree | 8d0eac2e2f4d55d48245266d3930ad4e7f92030f /src/base/statistics.hh | |
parent | c22be9f2f016872b05d65c82055ddc936b4aa075 (diff) | |
download | gem5-6f1187943cf78c2fd0334bd7e4372ae79a587fa4.tar.xz |
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.
Diffstat (limited to 'src/base/statistics.hh')
-rw-r--r-- | src/base/statistics.hh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 3bb74282a..9c10164a9 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -72,7 +72,7 @@ class Callback; /** The current simulated tick. */ -extern Tick curTick; +extern Tick curTick(); /* A namespace for all of the Statistics */ namespace Stats { @@ -530,8 +530,8 @@ class AvgStor void set(Counter val) { - total += current * (curTick - last); - last = curTick; + total += current * (curTick() - last); + last = curTick(); current = val; } @@ -560,8 +560,8 @@ class AvgStor Result result() const { - assert(last == curTick); - return (Result)(total + current) / (Result)(curTick - lastReset + 1); + assert(last == curTick()); + return (Result)(total + current) / (Result)(curTick() - lastReset + 1); } /** @@ -575,8 +575,8 @@ class AvgStor void prepare(Info *info) { - total += current * (curTick - last); - last = curTick; + total += current * (curTick() - last); + last = curTick(); } /** @@ -586,8 +586,8 @@ class AvgStor reset(Info *info) { total = 0.0; - last = curTick; - lastReset = curTick; + last = curTick(); + lastReset = curTick(); } }; @@ -1576,7 +1576,7 @@ class AvgSampleStor data.type = params->type; data.sum = sum; data.squares = squares; - data.samples = curTick; + data.samples = curTick(); } /** |