stats: cleanup static stats to make startup work.
This is mainly to allow the unit test to run without requiring the standard M5 stats from being initialized (e.g. sim_seconds, sim_ticks, host_seconds)
This commit is contained in:
@@ -44,14 +44,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
Stats::Formula hostInstRate;
|
||||
Stats::Formula hostTickRate;
|
||||
Stats::Value hostMemory;
|
||||
Stats::Value hostSeconds;
|
||||
|
||||
Stats::Value simTicks;
|
||||
Stats::Value simInsts;
|
||||
Stats::Value simFreq;
|
||||
Stats::Formula simSeconds;
|
||||
|
||||
namespace Stats {
|
||||
@@ -84,8 +76,21 @@ statElapsedTicks()
|
||||
|
||||
SimTicksReset simTicksReset;
|
||||
|
||||
void
|
||||
initSimStats()
|
||||
struct Global
|
||||
{
|
||||
Stats::Formula hostInstRate;
|
||||
Stats::Formula hostTickRate;
|
||||
Stats::Value hostMemory;
|
||||
Stats::Value hostSeconds;
|
||||
|
||||
Stats::Value simTicks;
|
||||
Stats::Value simInsts;
|
||||
Stats::Value simFreq;
|
||||
|
||||
Global();
|
||||
};
|
||||
|
||||
Global::Global()
|
||||
{
|
||||
simInsts
|
||||
.functor(BaseCPU::numSimulatedInstructions)
|
||||
@@ -146,6 +151,12 @@ initSimStats()
|
||||
registerResetCallback(&simTicksReset);
|
||||
}
|
||||
|
||||
void
|
||||
initSimStats()
|
||||
{
|
||||
static Global global;
|
||||
}
|
||||
|
||||
class _StatEvent : public Event
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -34,6 +34,5 @@
|
||||
#include "base/statistics.hh"
|
||||
|
||||
extern Stats::Formula simSeconds;
|
||||
extern Stats::Value simTicks;
|
||||
|
||||
#endif // __SIM_SIM_STATS_HH__
|
||||
|
||||
Reference in New Issue
Block a user