diff options
author | Erik Hallnor <ehallnor@umich.edu> | 2003-12-21 22:47:33 -0500 |
---|---|---|
committer | Erik Hallnor <ehallnor@umich.edu> | 2003-12-21 22:47:33 -0500 |
commit | ecd3ecb4f55b64b55fb91722f913131f018a4996 (patch) | |
tree | 63c8119c8faefeb7cf33ea8ce11c69d4e9a85512 | |
parent | e249a54e4cf861144101b73715bce650febfcfe8 (diff) | |
parent | 918c5d27abf559ffeebbe1e72d07f7edc47a75ca (diff) | |
download | gem5-ecd3ecb4f55b64b55fb91722f913131f018a4996.tar.xz |
Merge ehallnor@zizzer:/bk/m5 into zazzer.eecs.umich.edu:/z/ehallnor/m5
--HG--
extra : convert_revision : 8f6f24d9c4ea5e3c12174fc0338cb441c45c8591
-rw-r--r-- | base/cprintf.cc | 16 | ||||
-rw-r--r-- | base/statistics.cc | 2 | ||||
-rw-r--r-- | base/statistics.hh | 28 | ||||
-rw-r--r-- | cpu/exetrace.cc | 1 | ||||
-rw-r--r-- | test/Makefile | 2 | ||||
-rw-r--r-- | test/stattest.cc | 7 |
6 files changed, 26 insertions, 30 deletions
diff --git a/base/cprintf.cc b/base/cprintf.cc index 945ad5b38..af3b26a57 100644 --- a/base/cprintf.cc +++ b/base/cprintf.cc @@ -238,22 +238,6 @@ ArgList::dump(const string &format) } break; } - - ios::iostate state = stream->rdstate(); - if (state) { -#if 0 - cout << "stream->rdstate() == " << state << endl; - if (state & ios::badbit) - cout << "stream is bad!\n"; - if (state & ios::eofbit) - cout << "stream at eof!\n"; - if (state & ios::failbit) - cout << "stream failed!\n"; - if (state & ios::goodbit) - cout << "stream is good!!\n"; -#endif - stream->clear(); - } } while (!objects.empty()) { diff --git a/base/statistics.cc b/base/statistics.cc index 726ea3c60..81b8856ca 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -344,7 +344,7 @@ StatData::less(StatData *stat1, StatData *stat2) } bool -StatData::check() const +StatData::baseCheck() const { if (!init) { #ifdef STAT_DEBUG diff --git a/base/statistics.hh b/base/statistics.hh index ed3278e4a..3fc019edc 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -184,7 +184,8 @@ struct StatData * use * @return true for success */ - virtual bool check() const; + virtual bool check() const = 0; + bool baseCheck() const; /** * Checks if the first stat's name is alphabetically less than the second. @@ -215,6 +216,7 @@ class ScalarData : public ScalarDataBase ScalarData(T &stat) : s(stat) {} virtual bool binned() const { return s.binned(); } + virtual bool check() const { return s.check(); } virtual result_t val() const { return s.val(); } virtual result_t total() const { return s.total(); } virtual void reset() { s.reset(); } @@ -254,6 +256,7 @@ class VectorData : public VectorDataBase VectorData(T &stat) : s(stat) {} virtual bool binned() const { return s.binned(); } + virtual bool check() const { return s.check(); } virtual bool zero() const { return s.zero(); } virtual void reset() { s.reset(); } @@ -309,6 +312,7 @@ class DistData : public DistDataBase DistData(T &stat) : s(stat) {} virtual bool binned() const { return s.binned(); } + virtual bool check() const { return s.check(); } virtual void reset() { s.reset(); } virtual bool zero() const { return s.zero(); } virtual void update() { return s.update(this); } @@ -348,6 +352,7 @@ class VectorDistData : public VectorDistDataBase VectorDistData(T &stat) : s(stat) {} virtual bool binned() const { return T::bin_t::binned; } + virtual bool check() const { return s.check(); } virtual void reset() { s.reset(); } virtual size_t size() const { return s.size(); } virtual bool zero() const { return s.zero(); } @@ -388,12 +393,13 @@ class Vector2dData : public Vector2dDataBase Vector2dData(T &stat) : s(stat) {} virtual bool binned() const { return T::bin_t::binned; } + virtual bool check() const { return s.check(); } virtual void reset() { s.reset(); } virtual bool zero() const { return s.zero(); } virtual void update() { Vector2dDataBase::update(); - return s.update(this); + s.update(this); } }; @@ -854,6 +860,8 @@ class ScalarBase : public DataAccess */ bool binned() const { return bin_t::binned; } + bool check() const { return bin.initialized(); } + /** * Reset stat value to default */ @@ -963,7 +971,7 @@ class VectorBase : public DataAccess return false; } - bool check() const { return true; } + bool check() const { return bin.initialized(); } void reset() { bin.reset(); } public: @@ -1167,8 +1175,6 @@ class Vector2dBase : public DataAccess void update(Vector2dDataBase *data) { - data->x = x; - data->y = y; int size = this->size(); data->vec.resize(size); for (int i = 0; i < size; ++i) @@ -1188,7 +1194,7 @@ class Vector2dBase : public DataAccess */ void reset() { bin.reset(); } - bool check() { return true; } + bool check() { return bin.initialized(); } }; template <typename T, template <typename T> class Storage, class Bin> @@ -1665,7 +1671,7 @@ class DistBase : public DataAccess bin.reset(); } - bool check() { return true; } + bool check() { return bin.initialized(); } }; template <typename T, template <typename T> class Storage, class Bin> @@ -1718,7 +1724,7 @@ class VectorDistBase : public DataAccess */ void reset() { bin.reset(); } - bool check() { return true; } + bool check() { return bin.initialized(); } void update(VectorDistDataBase *base) { int size = this->size(); @@ -2509,8 +2515,8 @@ class Vector2d : public WrapVec2d<Vector2d<T, Bin>, Vector2dBase<T, StatStor, Bi { public: Vector2d &init(size_t _x, size_t _y) { - x = _x; - y = _y; + statData()->x = x = _x; + statData()->y = y = _y; bin.init(x * y, params); setInit(); @@ -2732,6 +2738,8 @@ class FormulaBase : public DataAccess */ bool binned() const; + bool check() const { return true; } + /** * Formulas don't need to be reset */ diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc index ce6b0c544..3e8877e93 100644 --- a/cpu/exetrace.cc +++ b/cpu/exetrace.cc @@ -120,7 +120,6 @@ Trace::InstRecord::dump(ostream &outs) // End of line... // outs << endl; - outs.flush(); } diff --git a/test/Makefile b/test/Makefile index 29d252df4..ceb3c9a1c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -52,7 +52,7 @@ offtest: offtest.o rangetest: rangetest.o str.o $(CXX) $(LFLAGS) -o $@ $^ -stattest: cprintf.o hostinfo.o misc.o sim_time.o statistics.o stattest.o str.o +stattest: cprintf.o hostinfo.o misc.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 dea5295cc..7c171be80 100644 --- a/test/stattest.cc +++ b/test/stattest.cc @@ -115,7 +115,7 @@ main(int argc, char *argv[]) s13.init(4, 0, 99, 10); s14.init(9); s15.init(10); - s16.init(2, 2); + s16.init(2, 9); s1 .name("Stat01") @@ -271,6 +271,11 @@ main(int argc, char *argv[]) s16[0][0] = 2; s16[1][1] = 9; s16[1][1] += 9; + s16[1][8] += 8; + s16[1][7] += 7; + s16[1][6] += 6; + s16[1][5] += 5; + s16[1][4] += 4; s11 = 1; s3 = 9; |