Exemple #1
0
void BankedMSHR<Addr_t, Cache_t>::addEntry(Addr_t paddr, CallbackBase *c,
                                           CallbackBase *ovflwc, MemOperation mo)
{
  if(!overflow.empty()) {
    toOverflow(paddr, c, ovflwc, mo);
    return;
  }

  if(mshrBank[calcBankIndex(paddr)]->canAcceptRequest(paddr, mo)) {
    nOutsReqs++;
    mshrBank[calcBankIndex(paddr)]->addEntry(paddr, c, ovflwc, mo);
    I(!mshrBank[calcBankIndex(paddr)]->isOverflowing());
    return;
  }

  toOverflow(paddr, c, ovflwc, mo);
}
Exemple #2
0
void SingleMSHR<Addr_t, Cache_t>::addEntry(Addr_t paddr, CallbackBase *c,
                                           CallbackBase *ovflwc, MemOperation mo)
{
  MSHRit it = ms.find(calcLineAddr(paddr));
  I(ovflwc); // for single MSHR, overflow handler REQUIRED!

  if(!overflow.empty()) {
    toOverflow(paddr, c, ovflwc, mo);
    return;
  }

  if(it == ms.end())  {// we must be overflowing because the issue did not happen
    toOverflow(paddr, c, ovflwc, mo);
    return;
  }

  I(it != ms.end());

  if((*it).second.addRequest(paddr, c, mo)) {
    // ok, the addrequest succeeded, the request was added
    avgQueueSize.sample((*it).second.getPendingReqs() - 1);
    nOutsReqs++;

#ifdef MSHR_BASICOCCSTATS
    if(mo == MemRead)
      occStats->incRdReqs();
#endif

    // there was no overflow, so the callback needs to be destroyed
    ovflwc->destroy();
    // check to see if we have filled up the subentries
    checkSubEntries(paddr, mo);

    //MSG("[%llu] nFullRd=%d nFullWr=%d a:%lu",globalClock,
    //      nFullReadEntries,nFullWriteEntries, calcLineAddr(paddr));
    return;
  } else {
    // too many oustanding requests to the same line already. send to overflow
    toOverflow(paddr, c, ovflwc, mo);
    return;
  }
}