Merge zizzer.eecs.umich.edu:/bk/m5

into ziff.eecs.umich.edu:/z/binkertn/research/m5/latest

--HG--
extra : convert_revision : 2a258d16ba51ce34f5748825a94b456abfb577cc
This commit is contained in:
Nathan Binkert 2004-02-25 16:13:00 -05:00
commit 087a2ed6a1
2 changed files with 16 additions and 13 deletions

View file

@ -57,7 +57,7 @@ __nan()
} }
#endif #endif
#ifdef STAT_DEBUG #ifdef DEBUG
static int total_stats = 0; static int total_stats = 0;
#endif #endif
@ -409,6 +409,14 @@ DataAccess::setPrint()
Database::StatDB().regPrint(this); Database::StatDB().regPrint(this);
} }
StatData::StatData()
: flags(none), precision(-1), prereq(0)
{
#ifdef DEBUG
number = total_stats++;
#endif
}
StatData::~StatData() StatData::~StatData()
{ {
} }
@ -443,8 +451,8 @@ bool
StatData::baseCheck() const StatData::baseCheck() const
{ {
if (!(flags & init)) { if (!(flags & init)) {
#ifdef STAT_DEBUG #ifdef DEBUG
cprintf("this is stat number %d\n",(*i)->number); cprintf("this is stat number %d\n", number);
#endif #endif
panic("Not all stats have been initialized"); panic("Not all stats have been initialized");
return false; return false;

View file

@ -60,12 +60,6 @@
#include "base/str.hh" #include "base/str.hh"
#include "sim/host.hh" #include "sim/host.hh"
//
// Un-comment this to enable weirdo-stat debugging
//
// #define STAT_DEBUG
#ifndef NAN #ifndef NAN
float __nan(); float __nan();
/** Define Not a number. */ /** Define Not a number. */
@ -146,10 +140,7 @@ struct StatData
/** A pointer to a prerequisite Stat. */ /** A pointer to a prerequisite Stat. */
const StatData *prereq; const StatData *prereq;
StatData() StatData();
: flags(none), precision(-1), prereq(0)
{}
virtual ~StatData(); virtual ~StatData();
/** /**
@ -193,6 +184,10 @@ struct StatData
* @return stat1's name is alphabetically before stat2's * @return stat1's name is alphabetically before stat2's
*/ */
static bool less(StatData *stat1, StatData *stat2); static bool less(StatData *stat1, StatData *stat2);
#ifdef DEBUG
int number;
#endif
}; };
struct ScalarDataBase : public StatData struct ScalarDataBase : public StatData