示例#1
0
bool GPUSMProcessor::advance_clock(FlodID fid) {

  if (!active) {
    // time to remove from the running queue
    TaskHandler::removeFromRunning(cpu_id);
    return false;
  }

  fetch(fid);

  if (!busy)
    return false;

  clockTicks.inc();
  setWallClock();

  if (unlikely(throttlingRatio>1)) { 
    throttling_cntr++;

    uint32_t skip = ceil(throttlingRatio/getTurboRatioGPU()); 

    if (throttling_cntr < skip) {
      return true;
    }
    throttling_cntr = 1;
  }

  // ID Stage (insert to instQueue)
  if (spaceInInstQueue >= FetchWidth) {
    //MSG("\nFor CPU %d:",getId());
    IBucket *bucket = pipeQ.pipeLine.nextItem();
    if( bucket ) {
      I(!bucket->empty());
      spaceInInstQueue -= bucket->size();
      pipeQ.instQueue.push(bucket);
    }else{
      noFetch2.inc();
    }
  }else{
    noFetch.inc();
  }

  // RENAME Stage
  if ( !pipeQ.instQueue.empty() ) {
    // FIXME: Clear the per PE counter
    spaceInInstQueue += issue(pipeQ);
  }else if (ROB.empty() && rROB.empty()) {
    //I(0);
    // Still busy if we have some in-flight requests
    busy = pipeQ.pipeLine.hasOutstandingItems();
    return true;
  }

  retire();

  return true;
}
示例#2
0
bool AccProcessor::advance_clock(FlowID fid)
  /* Full execution: fetch|rename|retire {{{1 */
{
  // MSG("@%lld: AccProcessor::advance_clock(fid=%d) cpu_id=%d\n",(long long int)globalClock,fid,cpu_id);
  if( globalClock > 500 && ((globalClock % 10) == (fid)) ) {
    if( reqid & 1 ) {
      //MSG("@%lld: AccProcessor::advance_clock(fid=%d) memRequest write cpu_id=%d myAddr=%016llx\n",(long long int)globalClock,fid,cpu_id,(long long int)myAddr);
      MemRequest::sendReqWrite(memorySystem->getDL1(), true, myAddr+=addrIncr, write_performedCB::create(this,reqid++,globalClock));
    } else {
      //MSG("@%lld: AccProcessor::advance_clock(fid=%d) memRequest read cpu_id=%d myAddr=%016llx\n",(long long int)globalClock,fid,cpu_id,(long long int)myAddr);
      MemRequest::sendReqRead(memorySystem->getDL1(), true, myAddr, read_performedCB::create(this,reqid++,globalClock));
    }
  }

  if (!active) {
    return false;
  }

  clockTicks.inc(true);
  setWallClock(true);

  return true;
}