This patch adds the ability for the simulator to query the number of
instructions a CPU has executed so far per hw-thread. This can be used
to enable more flexible periodic events such as taking checkpoints
starting 1s into simulation and X instructions thereafter.
Counter totalInsts();
void scheduleInstStop(ThreadID tid, Counter insts, const char *cause);
void scheduleLoadStop(ThreadID tid, Counter loads, const char *cause);
+ uint64_t getCurrentInstCount(ThreadID tid);
''')
@classmethod
comInstEventQueue[tid]->schedule(event, now + insts);
}
+uint64_t
+BaseCPU::getCurrentInstCount(ThreadID tid)
+{
+ return Tick(comInstEventQueue[tid]->getCurTick());
+}
+
AddressMonitor::AddressMonitor() {
armed = false;
waiting = false;
*/
void scheduleLoadStop(ThreadID tid, Counter loads, const char *cause);
+ /**
+ * Get the number of instructions executed by the specified thread
+ * on this CPU. Used by Python to control simulation.
+ *
+ * @param tid Thread monitor
+ * @return Number of instructions executed
+ */
+ uint64_t getCurrentInstCount(ThreadID tid);
+
public:
/**
* @{