diff options
author | Nathan Binkert <binkertn@umich.edu> | 2003-10-20 23:08:27 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2003-10-20 23:08:27 -0400 |
commit | 02bacb2dfdfcb3161f8fbada4bf3108566989fcd (patch) | |
tree | f3db2a424695f8634fdc70e51e35c21a0721f306 /test | |
parent | df488c0e70eb827d895c12aba85d5de168505b02 (diff) | |
download | gem5-02bacb2dfdfcb3161f8fbada4bf3108566989fcd.tar.xz |
Implement reset for stats.
base/statistics.cc:
base/statistics.hh:
Implement a reset for for the statistics package.
This will cause all stats to be set to their default value.
Only the currently enabled bin will be reset.
test/Makefile:
Make tests work again now that we're naming include dirs
explicitly
test/stattest.cc:
test reset
--HG--
extra : convert_revision : 8d21cedf6ee91ed0a2412042ea5cb12f79b90eb3
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 26 | ||||
-rw-r--r-- | test/stattest.cc | 12 |
2 files changed, 24 insertions, 14 deletions
diff --git a/test/Makefile b/test/Makefile index 8c36f9806..c95f8cb8d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -4,15 +4,15 @@ CC= gcc CXX= g++ CURDIR?= $(shell /bin/pwd) -SRCDIR?= . +SRCDIR?= .. TARGET?= alpha -TEST_SRCDIR?= $(SRCDIR) -ARCH_SRCDIR?= $(SRCDIR)/../arch/$(TARGET) -BASE_SRCDIR?= $(SRCDIR)/../base -SIM_SRCDIR?= $(SRCDIR)/../sim -CACHE_SRCDIR?= $(SRCDIR)/../sim/cache -OLD_SRCDIR= $(SRCDIR)/../old +TEST_SRCDIR?= $(SRCDIR)/test +ARCH_SRCDIR?= $(SRCDIR)/arch/$(TARGET) +BASE_SRCDIR?= $(SRCDIR)/base +SIM_SRCDIR?= $(SRCDIR)/sim +CACHE_SRCDIR?= $(SRCDIR)/sim/cache +OLD_SRCDIR= $(SRCDIR)/old vpath % $(TEST_SRCDIR) vpath % $(BASE_SRCDIR) @@ -20,13 +20,14 @@ vpath % $(SIM_SRCDIR) vpath % $(CACHE_SRCDIR) vpath % $(OLD_SRCDIR) -INCLDIRS= -I$(ARCH_SRCDIR) -I$(BASE_SRCDIR) -I$(SIM_SRCDIR) \ - -I$(CACHE_SRCDIR) -I$(OLD_SRCDIR) -CCFLAGS= -g -O0 -MMD -I. $(INCLDIRS) -I- -DTRACING_ON=0 +CCFLAGS= -g -O0 -MMD -I. -I$(SRCDIR) -I- -DTRACING_ON=0 default: @echo "You must specify a target" +targetarch: + ln -s ../arch/$(TARGET) targetarch + bitvectest: bitvectest.o $(CXX) $(LFLAGS) -o $@ $^ @@ -51,7 +52,8 @@ offtest: offtest.o rangetest: rangetest.o str.o $(CXX) $(LFLAGS) -o $@ $^ -stattest: statistics.o stattest.o cprintf.o misc.o omisc.o str.o +stattest: cprintf.o hostinfo.o misc.o sim_stats.o sim_time.o \ + statistics.o stattest.o str.o $(CXX) $(LFLAGS) -o $@ $^ strnumtest: strnumtest.o str.o @@ -63,7 +65,7 @@ symtest: misc.o symtest.o symtab.o str.o tokentest: tokentest.o str.o $(CXX) $(LFLAGS) -o $@ $^ -tracetest: tracetest.o trace.o trace_flags.o cprintf.o str.o misc.o omisc.o +tracetest: tracetest.o trace.o trace_flags.o cprintf.o str.o misc.o $(CXX) $(LFLAGS) -o $@ $^ clean: diff --git a/test/stattest.cc b/test/stattest.cc index a009c16d8..38a15900d 100644 --- a/test/stattest.cc +++ b/test/stattest.cc @@ -32,15 +32,16 @@ #include <unistd.h> #include "base/cprintf.hh" -#include "sim/host.hh" #include "base/misc.hh" #include "base/statistics.hh" +#include "sim/host.hh" +#include "sim/sim_stats.hh" using namespace std; using namespace Statistics; Tick curTick = 0; -//Tick ticksPerSecond = ULL(2000000000); +Tick ticksPerSecond = ULL(2000000000); Scalar<> s1; Scalar<> s2; @@ -493,10 +494,17 @@ main(int argc, char *argv[]) s12.sample(100); MainBin::activate(bin1); + cout << "dump 1" << endl; dump(cout); cout << endl << endl; MainBin::activate(bin2); + cout << "dump 2" << endl; + dump(cout); + cout << endl << endl; + + cout << "dump 3" << endl; + reset(); dump(cout); cout << endl << endl; |