#include "base/hostinfo.hh"
#include "base/statistics.hh"
#include "base/time.hh"
-
#include "config/the_isa.hh"
#if THE_ISA == NO_ISA
#include "arch/noisa/cpu_dummy.hh"
#endif
#include "sim/eventq.hh"
+#include "sim/stat_control.hh"
using namespace std;
{
void process()
{
- statTime.set();
- startTick = curTick;
+ statTime.setTimer();
+ startTick = curTick();
}
};
double
statElapsedTime()
{
- Time now(true);
+ Time now;
+ now.setTimer();
+
Time elapsed = now - statTime;
- return elapsed();
+ return elapsed;
}
Tick
statElapsedTicks()
{
- return curTick - startTick;
+ return curTick() - startTick;
}
SimTicksReset simTicksReset;
static Global global;
}
-class _StatEvent : public Event
+class StatEvent : public Event
{
private:
bool dump;
Tick repeat;
public:
- _StatEvent(bool _dump, bool _reset, Tick _repeat)
+ StatEvent(bool _dump, bool _reset, Tick _repeat)
: Event(Stat_Event_Pri), dump(_dump), reset(_reset), repeat(_repeat)
{
setFlags(AutoDelete);
Stats::reset();
if (repeat) {
- Event *event = new _StatEvent(dump, reset, repeat);
- mainEventQueue.schedule(event, curTick + repeat);
+ Stats::schedStatEvent(dump, reset, curTick() + repeat, repeat);
}
}
};
void
-StatEvent(bool dump, bool reset, Tick when, Tick repeat)
+schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
{
- Event *event = new _StatEvent(dump, reset, repeat);
+ Event *event = new StatEvent(dump, reset, repeat);
mainEventQueue.schedule(event, when);
}