Ejemplo n.º 1
0
/**
 * 
 * @param dynamic_instruction 
 * @return 
**/
UINT_8 BasicBlock::update_instructionList(DInst dynamic_instruction)
{
   InstructionContainer tempInstruction;

   tempInstruction.update_instructionID((ADDRESS_INT)dynamic_instruction.get_instructionAddress());
   tempInstruction.update_opCode(dynamic_instruction.getOpcode());
   tempInstruction.update_opNum(dynamic_instruction.get_opNum());
   tempInstruction.update_src1(dynamic_instruction.get_src1());
   tempInstruction.update_src2(dynamic_instruction.get_src2());
   tempInstruction.update_dest(dynamic_instruction.get_dest());
   tempInstruction.update_immediate(dynamic_instruction.get_immediate());
   tempInstruction.update_virtualAddress(dynamic_instruction.getVaddr());
   tempInstruction.update_subCode(dynamic_instruction.get_subCode());
   tempInstruction.update_uEvent(dynamic_instruction.get_uEvent());
   tempInstruction.update_dataSize(dynamic_instruction.get_dataSize());
   tempInstruction.update_guessTaken(dynamic_instruction.get_guessTaken());
   tempInstruction.update_condLikely(dynamic_instruction.get_condLikely());
   tempInstruction.update_jumpLabel(dynamic_instruction.get_jumpLabel());

   instructionList.push_back(tempInstruction);

   if(dynamic_instruction.get_lockID() != 0)
      this->lockID = dynamic_instruction.get_lockID();

   return 1;
}
Ejemplo n.º 2
0
void LDSTBuffer::getLoadEntry(DInst *dinst) 
{
  I(dinst->getInst()->isLoad());

#ifdef LDSTBUFFER_IGNORE_DEPS
  return;
#endif
    
  // LOAD
  EntryType::iterator sit = stores.find(calcWord(dinst));
  if (sit == stores.end())
    return;

  DInst *pdinst = sit->second;
  I(pdinst->getInst()->isStore());

#if defined(TASKSCALAR) && !defined(TS_CAVA)
  if (dinst->getVersionRef() != pdinst->getVersionRef())
    return;
#else
  if (dinst->getContextId() != pdinst->getContextId()) {
    // FIXME2: In a context switch the same processor may have two different
    // PIDs

    // Different processor or window. Queue the instruction even if executed
    dinst->setDepsAtRetire();
    I(pdinst->getInst()->getAddr() != dinst->getInst()->getAddr());
    pdinst->addFakeSrc(dinst);

    GLOG(DEBUG2, "FORWARD pc=0x%x [addr=0x%x] (%p)-> pc=0x%x [addr=0x%x] (%p)"
	,(int)pdinst->getInst()->getAddr() , (int)pdinst->getVaddr(), pdinst
	,(int)dinst->getInst()->getAddr()  , (int)dinst->getVaddr(), dinst);
    return;
  }
#endif

#ifndef LDSTQ_FWD
  dinst->setLoadForwarded();
#endif
  if (!pdinst->isExecuted()) {
    I(pdinst->getInst()->getAddr() != dinst->getInst()->getAddr());
    pdinst->addFakeSrc(dinst);
  }
}