void ROB_wakeup(ROB *t, int tag){ int dr_tag=t->ROB_Entries[tag].inst.dr_tag; bool ttt=true; for(int i=t->head_ptr;i!=t->tail_ptr||ttt;i=ptr_next(i)){ ttt=false; if(t->ROB_Entries[i].inst.src1_tag==dr_tag){ t->ROB_Entries[i].inst.src1_ready=true; } if(t->ROB_Entries[i].inst.src2_tag==dr_tag){ t->ROB_Entries[i].inst.src2_ready=true; } } }
///////////////////////////////////////////////////////////// // insert entry at tail, increment tail (do check_space first) ///////////////////////////////////////////////////////////// //return the prf_id assigned for the inst! int ROB_insert(ROB *t, Inst_Info inst){ if(!ROB_check_space(t)){ //printf("rob.cpp: ROB no space!"); return -1; } int tmp=t->tail_ptr; t->ROB_Entries[tmp].valid=true; t->ROB_Entries[tmp].exec =false; t->ROB_Entries[tmp].ready=false; t->ROB_Entries[tmp].inst=inst; t->ROB_Entries[tmp].inst.dr_tag=tmp; // use its index in rob to represent dest tag! t->tail_ptr=ptr_next(t->tail_ptr); // increment tail return tmp; }
Poco::Timespan::TimeDiff JobManager::SleepHint() { Poco::ScopedLock<Poco::Mutex> managerLock (m_mutex); // wait forever if job manager is suspended if (m_suspended) return InternalJob::T_INFINITE; if (!m_JobQueueWaiting.IsEmpty()) return 0; // return the anticipated time that the next sleeping job will wake InternalJob::Pointer ptr_next(nullptr); ptr_next = m_JobQueueSleeping.Peek(); if (ptr_next == 0) return InternalJob::T_INFINITE; Poco::Timestamp tmp_startTime = ptr_next->GetStartTime(); Poco::Timestamp tmp_currentTime; Poco::Timestamp::TimeDiff timeToStart = tmp_startTime - tmp_currentTime; return timeToStart; }
Inst_Info ROB_remove_head(ROB *t){ t->ROB_Entries[t->head_ptr].valid=false; Inst_Info r= t->ROB_Entries[t->head_ptr].inst; t->head_ptr=ptr_next(t->head_ptr); return r; }