summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-12-09 13:05:43 -0500
committerNathan Binkert <binkertn@umich.edu>2003-12-09 13:05:43 -0500
commit368de4109f9decca72faac1a6eb0909da712f43f (patch)
treeb7d842968d27019f6e304834662833676f8f2354 /test
parentf8b78a81b952ed1953276290b48cbd053b084fcf (diff)
downloadgem5-368de4109f9decca72faac1a6eb0909da712f43f.tar.xz
Sweeping change in the stats package....again...
base/statistics.cc: - Merge the m5 display and simplescalar compatible display functions. - Use functors for the stats printing instead of functions. This gets rid of the very long argument lists and improves clarity. - Fix a bug in binning that caused an invalid allocation to occur. base/statistics.hh: - Instead of using a compile time variable to choose whether to print in ss compat mode, we use a runtime variable. This is how we'll choose python output. - There are no more virtual functions in the statistics themselves. All virtual functions have been moved into a secondary helper class. Every stat has an associated helper class that knows how to access certain variables in that stat. There is a hash_map from the stat to it's helper class data. This was done because the helper data is only used during setup, stats reset, and printing. All of which happen rarely, and you want to avoid any performance hit that you can. - To provide the name(), desc(), etc functions to classes so that the user can set various parameters to the stats class, a single class containing all of those functions was created. An odd trick was done to actually make this class derive from the stat class because a base class with no data actually does end up taking up space. - The detail namespace was removed for now. I'll put it back when the package is not in so much flux. - Standard deviation, and mean were added to all distribution stats. - There are several bugfixes and changes that aren't mentioned test/Makefile: Don't test sim_stats foo. test/stattest.cc: Don't test sim_stats foo. Fix bin usage so that it corresponds to the current usage. --HG-- extra : convert_revision : ce8d9a8d485a84d55799f253d851e83650684170
Diffstat (limited to 'test')
-rw-r--r--test/Makefile3
-rw-r--r--test/stattest.cc13
2 files changed, 7 insertions, 9 deletions
diff --git a/test/Makefile b/test/Makefile
index 1502bca3d..29d252df4 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -52,8 +52,7 @@ offtest: offtest.o
rangetest: rangetest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
-stattest: cprintf.o hostinfo.o misc.o sim_stats.o sim_time.o \
- statistics.o stattest.o str.o
+stattest: cprintf.o hostinfo.o misc.o sim_time.o statistics.o stattest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
strnumtest: strnumtest.o str.o
diff --git a/test/stattest.cc b/test/stattest.cc
index 38a15900d..dea5295cc 100644
--- a/test/stattest.cc
+++ b/test/stattest.cc
@@ -35,7 +35,6 @@
#include "base/misc.hh"
#include "base/statistics.hh"
#include "sim/host.hh"
-#include "sim/sim_stats.hh"
using namespace std;
using namespace Statistics;
@@ -67,8 +66,8 @@ Formula f4;
Formula f5;
Formula f6;
-MainBin bin1;
-MainBin bin2;
+MainBin bin1("bin1");
+MainBin bin2("bin2");
double
testfunc()
@@ -256,7 +255,7 @@ main(int argc, char *argv[])
check();
- MainBin::activate(bin1);
+ bin1.activate();
f1 = s1 + s2;
f2 = (-s1) / (-s2) * -s3 + ULL(100) + s4;
@@ -452,7 +451,7 @@ main(int argc, char *argv[])
s6.sample(8);
s6.sample(9);
- MainBin::activate(bin2);
+ bin2.activate();
s6.sample(10);
s6.sample(10);
s6.sample(10);
@@ -493,12 +492,12 @@ main(int argc, char *argv[])
s12.sample(100);
- MainBin::activate(bin1);
+ bin1.activate();
cout << "dump 1" << endl;
dump(cout);
cout << endl << endl;
- MainBin::activate(bin2);
+ bin2.activate();
cout << "dump 2" << endl;
dump(cout);
cout << endl << endl;