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 {
 
 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)
     registerResetCallback(&simTicksReset);
 }
 
+void
+initSimStats()
+{
+    static Global global;
+}
+
 class _StatEvent : public Event
 {
   private:
 
 #include "base/statistics.hh"
 
 extern Stats::Formula simSeconds;
-extern Stats::Value simTicks;
 
 #endif // __SIM_SIM_STATS_HH__