예제 #1
0
IBucket *Pipeline::nextItem() {
  while(1) {
    if (buffer.empty()) {
#ifdef DEBUG
      // It should not be possible to propagate more buckets
      clearItems();
      I(buffer.empty());
#endif
      return 0;
    }

    if( ((buffer.top())->getClock() + PipeLength) > globalClock )
      return 0;

    IBucket *b = buffer.top();
    buffer.pop();
    I(!b->empty());
    if (!b->cleanItem) {
      I(!b->empty());
      I(b->top() != 0);


      return b;
    }

    I(b->cleanItem);
    I(!b->empty());
    I(b->top() == 0);
    b->pop();
    I(b->empty());
    cleanBucketPool.push_back(b);
  }

  I(0);
}
예제 #2
0
void Processor::purgeInstructionWindow()
{
/*	while(!pipeQ.instQueue.empty());
	{
		IBucket* bucket = pipeQ.instQueue.top();
		while(!bucket->empty())
		{
			bucket->top()->killSilently();
			bucket->pop();
		}
//		pipeQ.pipeLine.doneItem(bucket);
		pipeQ.instQueue.pop();
	}*/
	while(pipeQ.pipeLine.hasOutstandingItems())
	{
		IBucket* bucket = pipeQ.pipeLine.nextItem();
		while(!bucket->empty())
		{
			bucket->top()->killSilently();
			bucket->pop();
		}
		pipeQ.pipeLine.doneItem(bucket);
	}
	pipeQ.pipeLine.clearItems();
}
예제 #3
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;
}
예제 #4
0
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;
}