From 48333e7e3f5282bd2b5505b400ad5b06d6785371 Mon Sep 17 00:00:00 2001 From: Radhika Jagtap Date: Tue, 16 Aug 2016 14:14:58 +0100 Subject: cpu: Print progress messages in Trace CPU This change adds the ability to print a message at intervals of committed instruction count to indicate progress in the trace replay. Change-Id: I8363502354c42bfc52936d2627986598b63a5797 Reviewed-by: Rekai Gonzalez Alberquilla Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2321 Reviewed-by: Jason Lowe-Power --- src/cpu/trace/trace_cpu.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/cpu/trace/trace_cpu.cc') diff --git a/src/cpu/trace/trace_cpu.cc b/src/cpu/trace/trace_cpu.cc index 44da7df1e..7b59b49e0 100644 --- a/src/cpu/trace/trace_cpu.cc +++ b/src/cpu/trace/trace_cpu.cc @@ -62,13 +62,15 @@ TraceCPU::TraceCPU(TraceCPUParams *params) 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 " @@ -90,6 +92,16 @@ TraceCPUParams::create() 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) { -- cgit v1.2.3