summaryrefslogtreecommitdiff
path: root/src/sim/simulate.hh
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2015-03-23 06:57:36 -0400
committerCurtis Dunham <Curtis.Dunham@arm.com>2015-03-23 06:57:36 -0400
commit564482c78283c749dc537cb9c1b2d788bf306a82 (patch)
treed9fa838e9313aa7938cb478612bef8a22e5a080e /src/sim/simulate.hh
parent45286d9b64646bb4fe47f3ebf1815324dd6cb62b (diff)
downloadgem5-564482c78283c749dc537cb9c1b2d788bf306a82.tar.xz
sim: Reuse the same limit_event in simulate()
This patch accomplishes two things: 1. Makes simulate()'s GlobalSimLoopExitEvent a singleton reused across calls. This is slightly more efficient than recreating it every time. 2. Gives callers to simulate() (especially other simulators) a foolproof way of knowing that the simulation period ended successfully by hitting the limit event. They can call getLimitEvent() and compare it to the return value of simulate(). This change was motivated by an ongoing effort to integrate gem5 and SST, with SST as the master sim and gem5 as the slave sim.
Diffstat (limited to 'src/sim/simulate.hh')
-rw-r--r--src/sim/simulate.hh1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sim/simulate.hh b/src/sim/simulate.hh
index 5e51c76b6..18be7ea82 100644
--- a/src/sim/simulate.hh
+++ b/src/sim/simulate.hh
@@ -33,3 +33,4 @@
#include "sim/sim_events.hh"
GlobalSimLoopExitEvent *simulate(Tick num_cycles = MaxTick);
+GlobalEvent* getLimitEvent();