# frequency as was used for generating the traces.
freqMultiplier = Param.Float(1.0, "Multiplier scale the Trace CPU "\
"frequency up or down")
+
+ # Enable exiting when any one Trace CPU completes execution which is set to
+ # false by default
+ enableEarlyExit = Param.Bool(False, "Exit when any one Trace CPU "\
+ "completes execution")
dcacheNextEvent(this),
oneTraceComplete(false),
traceOffset(0),
- execCompleteEvent(nullptr)
+ execCompleteEvent(nullptr),
+ enableEarlyExit(params->enableEarlyExit)
{
// Increment static counter for number of Trace CPUs.
++TraceCPU::numTraceCPUs;
// events using a relative tick delta
dcacheGen.adjustInitTraceOffset(traceOffset);
- // The static counter for number of Trace CPUs is correctly set at this
- // point so create an event and pass it.
- execCompleteEvent = new CountedExitEvent("end of all traces reached.",
- numTraceCPUs);
+ // If the Trace CPU simulation is configured to exit on any one trace
+ // completion then we don't need a counted event to count down all Trace
+ // CPUs in the system. If not then instantiate a counted event.
+ if (!enableEarlyExit) {
+ // The static counter for number of Trace CPUs is correctly set at
+ // this point so create an event and pass it.
+ execCompleteEvent = new CountedExitEvent("end of all traces reached.",
+ numTraceCPUs);
+ }
+
}
void
// Schedule event to indicate execution is complete as both
// instruction and data access traces have been played back.
inform("%s: Execution complete.\n", name());
- schedule(*execCompleteEvent, curTick());
+ // If the replay is configured to exit early, that is when any one
+ // execution is complete then exit immediately and return. Otherwise,
+ // schedule the counted exit that counts down completion of each Trace
+ // CPU.
+ if (enableEarlyExit) {
+ exitSimLoop("End of trace reached");
+ } else {
+ schedule(*execCompleteEvent, curTick());
+ }
}
}
*/
CountedExitEvent *execCompleteEvent;
+ /**
+ * Exit when any one Trace CPU completes its execution. If this is
+ * configured true then the execCompleteEvent is not scheduled.
+ */
+ const bool enableEarlyExit;
+
Stats::Scalar numSchedDcacheEvent;
Stats::Scalar numSchedIcacheEvent;