void initialize(){ if(!pluggedin){ #if 0 BootLoader::plug(arg1,arg2); #else int arg1 = 1; const char *arg2[] = {"cachetest", 0}; setenv("ESESC_tradCORE_DL1","DL1_core DL1",1); SescConf = new SConfig(arg1, arg2); unsetenv("ESESC_tradCore_DL1"); gms_p0 = new MemorySystem(0); gms_p0->buildMemorySystem(); gms_p1 = new MemorySystem(1); gms_p1->buildMemorySystem(); #endif pluggedin=true; } // Create a LD (e5d33000) with PC = 0xfeeffeef and address 1203 rinst.set(0xe5d33000,0xfeeffeef,1203,true); crackInstARM.expand(&rinst); ld = DInst::create(rinst.getInstRef(0), &rinst, rinst.getPC(), 0); // Create a ST (e5832000) with PC = 0x410 and address 0x400 rinst.set(0xe5832000,0x410,0x400,true); crackInstARM.expand(&rinst); st = DInst::create(rinst.getInstRef(0), &rinst, rinst.getPC(), 0); }
void QEMUReader::syscall(uint32_t num, Time_t time, FlowID fid) /* Create an syscall instruction and inject in the pipeline {{{1 */ { RAWDInst *rinst = tsfifo[fid].getTailRef(); rinst->set(0xdeaddead,0,iRALU,LREG_R0,LREG_R0,LREG_InvalidOutput, LREG_InvalidOutput,true); tsfifo[fid].push(); }
void QEMUReader::queueInstruction(AddrType pc, AddrType addr, FlowID fid, int op, int src1, int src2, int dest, int dest2, bool keepStats) /* queue instruction (called by QEMU) {{{1 */ { uint64_t conta=0; I(src1<LREG_MAX); I(src2<LREG_MAX); I(dest<LREG_MAX); I(dest2<LREG_MAX); while (tsfifo[fid].full()) { pthread_mutex_lock(&mutex_ctrl); // BEGIN #if 0 if (tsfifo_rcv_mutex_blocked) { tsfifo_rcv_mutex_blocked = 0; pthread_mutex_unlock(&tsfifo_rcv_mutex); //MSG("1.alarmto rcv%d",fid); } #endif bool doblock = false; if (tsfifo_snd_mutex_blocked[fid] == 0) { tsfifo_snd_mutex_blocked[fid] = 1; doblock = true; } pthread_mutex_unlock(&mutex_ctrl); // END //MSG("2.sleep snd%d",fid); if (doblock) pthread_mutex_lock(&tsfifo_snd_mutex[fid]); else MSG("INTERESTING"); //MSG("2.wakeup snd%d",fid); } RAWDInst *rinst = tsfifo[fid].getTailRef(); I(rinst); rinst->set(pc,addr,static_cast<InstOpcode>(op), static_cast<RegType>(src1),static_cast<RegType>(src2),static_cast<RegType>(dest), static_cast<RegType>(dest2), keepStats); tsfifo[fid].push(); }