Beispiel #1
0
int GProcessor::issue(PipeQueue &pipeQ)
{
  int i=0; // Instructions executed counter
  int j=0; // Fake Instructions counter

  I(!pipeQ.instQueue.empty());

  if(!replayQ.empty()) {
    issueFromReplayQ();
    nStall[ReplayStall]->add(RealisticWidth);
    return 0;  // we issued 0 from the instQ;
    // FIXME:check if we can issue from replayQ and 
    // fetchQ during the same cycle
  }

  do{
    IBucket *bucket = pipeQ.instQueue.top();
    do{
      I(!bucket->empty());
      if( i >= IssueWidth ) {
        return i+j;
      }

      I(!bucket->empty());

      DInst *dinst = bucket->top();
#ifdef TASKSCALAR
      if (!dinst->isFake()) {
        if (dinst->getLVID()==0 || dinst->getLVID()->isKilled()) {
          // Task got killed. Just swallow the instruction
          dinst->killSilently();
          bucket->pop();
          j++;
          continue;
        }
      }
#endif

      StallCause c = addInst(dinst);
      if (c != NoStall) {
        if (i < RealisticWidth)
          nStall[c]->add(RealisticWidth - i);
        return i+j;
      }
      i++;
        
      bucket->pop();

    }while(!bucket->empty());
    
    pipeQ.pipeLine.doneItem(bucket);
    pipeQ.instQueue.pop();
  }while(!pipeQ.instQueue.empty());

  return i+j;
}
int32_t GProcessor::issue(PipeQueue &pipeQ)
{
    int32_t i=0; // Instructions executed counter
    int32_t j=0; // Fake Instructions counter

    I(!pipeQ.instQueue.empty());

    if(!replayQ.empty()) {
        issueFromReplayQ();
        nStall[ReplayStall]->add(RealisticWidth);
        return 0;  // we issued 0 from the instQ;
        // FIXME:check if we can issue from replayQ and
        // fetchQ during the same cycle
    }

    do {
        IBucket *bucket = pipeQ.instQueue.top();
        do {
            I(!bucket->empty());
            if( i >= IssueWidth ) {
                return i+j;
            }

            I(!bucket->empty());

            DInst *dinst = bucket->top();

            StallCause c = addInst(dinst);
            if (c != NoStall) {
                if (i < RealisticWidth)
                    nStall[c]->add(RealisticWidth - i);
                return i+j;
            }
            i++;

            bucket->pop();

        } while(!bucket->empty());

        pipeQ.pipeLine.doneItem(bucket);
        pipeQ.instQueue.pop();
    } while(!pipeQ.instQueue.empty());

    return i+j;
}