void SamplerPeriodic::coordinateWithOthersAndNextMode(FlowID fid) { fetchNextMode(); syncTimeAndSamples(fid); if (lastMode == EmuTiming) { progressedTime->sample(getTime()); endSimSiged = (getTime()>=maxnsTime)?1:0; //std::cout<<"mode "<<lastMode<<" fid:"<<sFid<<" sID:"<<nSamples[sFid]<<" totalSamples:"<<totalnSamples<<" time:"<<getTime()<<"\n"; } if (fid == winnerFid) { if (lastMode == EmuTiming) { // timing is going to be over doPWTH(fid); } } }
void SamplerGPUSpacial::queue(uint32_t insn, uint64_t pc, uint64_t addr, FlowID fid, char op, uint64_t icount, void *env) /* main qemu/gpu/tracer/... entry point */ { if(likely(!execute(fid, icount))) return; // QEMU can still send a few additional instructions (emul should stop soon) I(mode!=EmuInit); I(insn); if (mode == EmuRabbit || mode == EmuWarmup){ if (doPower && noActiveCPU()) { if (lastMode == EmuTiming) { #if 1 // For now GPU only, CPU side must be all rabbit! doPWTH(); #endif } } lastMode = mode; return; } if (mode == EmuDetail || mode == EmuTiming) { emul->queueInstruction(insn,pc,addr, (op&0xc0) /* thumb */ ,fid, env, getStatsFlag()); lastMode = mode; return; } // not happening for GPU, the CPU will decide! // We did enough //if (totalnInst >= nInstMax/* || endSimSiged*/) { if (totalnInst >= nInstMax) { markDone(); return; } }