# false by default
enableEarlyExit = Param.Bool(False, "Exit when any one Trace CPU "\
"completes execution")
+
+ # If progress msg interval is set to a non-zero value, it is treated as
+ # the interval of committed instructions at which an info message is
+ # printed.
+ progressMsgInterval = Param.Unsigned(0, "Interval of committed "\
+ "instructions at which to print a"\
+ " progress msg")
oneTraceComplete(false),
traceOffset(0),
execCompleteEvent(nullptr),
- enableEarlyExit(params->enableEarlyExit)
+ enableEarlyExit(params->enableEarlyExit),
+ progressMsgInterval(params->progressMsgInterval),
+ progressMsgThreshold(params->progressMsgInterval)
{
// Increment static counter for number of Trace CPUs.
++TraceCPU::numTraceCPUs;
- // Check that the python parameters for sizes of ROB, store buffer and load
- // buffer do not overflow the corresponding C++ variables.
+ // Check that the python parameters for sizes of ROB, store buffer and
+ // load buffer do not overflow the corresponding C++ variables.
fatal_if(params->sizeROB > UINT16_MAX, "ROB size set to %d exceeds the "
"max. value of %d.\n", params->sizeROB, UINT16_MAX);
fatal_if(params->sizeStoreBuffer > UINT16_MAX, "ROB size set to %d "
return new TraceCPU(this);
}
+void
+TraceCPU::updateNumOps(uint64_t rob_num)
+{
+ numOps = rob_num;
+ if (progressMsgInterval != 0 && numOps.value() >= progressMsgThreshold) {
+ inform("%s: %i insts committed\n", name(), progressMsgThreshold);
+ progressMsgThreshold += progressMsgInterval;
+ }
+}
+
void
TraceCPU::takeOverFrom(BaseCPU *oldCPU)
{
* Set the no. of ops when elastic data generator completes executing a
* node.
*/
- void updateNumOps(uint64_t rob_num) { numOps = rob_num; }
+ void updateNumOps(uint64_t rob_num);
/* Pure virtual function in BaseCPU. Do nothing. */
void wakeup(ThreadID tid = 0)
*/
const bool enableEarlyExit;
+ /**
+ * Interval of committed instructions specified by the user at which a
+ * progress info message is printed
+ */
+ const uint64_t progressMsgInterval;
+
+ /*
+ * The progress msg threshold is kept updated to the next multiple of the
+ * progress msg interval. As soon as the threshold is reached, an info
+ * message is printed.
+ */
+ uint64_t progressMsgThreshold;
+
Stats::Scalar numSchedDcacheEvent;
Stats::Scalar numSchedIcacheEvent;