sim: display final value of curTick in stats
authorAli Saidi <Ali.Saidi@ARM.com>
Wed, 25 Jan 2012 17:18:25 +0000 (17:18 +0000)
committerAli Saidi <Ali.Saidi@ARM.com>
Wed, 25 Jan 2012 17:18:25 +0000 (17:18 +0000)
Different from sim_ticks in that this value is restored from checkpoints and is never reset.
Useful for aligning with framebuffer output ticks

src/sim/stat_control.cc

index 7cf77174f176480c6b968005d2396d2fe4c6fe80..eb5fe13072497089f7b5cf504e3bab62a87b08ab 100644 (file)
@@ -53,6 +53,7 @@ using namespace std;
 
 Stats::Formula simSeconds;
 Stats::Value simTicks;
+Stats::Value finalTick;
 Stats::Value simFreq;
 
 namespace Stats {
@@ -85,6 +86,12 @@ statElapsedTicks()
     return curTick() - startTick;
 }
 
+Tick
+statFinalTick()
+{
+    return curTick();
+}
+
 SimTicksReset simTicksReset;
 
 struct Global
@@ -126,6 +133,13 @@ Global::Global()
         .desc("Number of ticks simulated")
         ;
 
+    finalTick
+        .functor(statFinalTick)
+        .name("final_tick")
+        .desc("Number of ticks from beginning of simulation \
+(restored from checkpoints and never reset)")
+        ;
+
     hostInstRate
         .name("host_inst_rate")
         .desc("Simulator instruction rate (inst/s)")