134,137c134,141
< renameLSQFullEvents
< .name(name() + ".LSQFullEvents")
< .desc("Number of times rename has blocked due to LSQ full")
< .prereq(renameLSQFullEvents);
---
> renameLQFullEvents
> .name(name() + ".LQFullEvents")
> .desc("Number of times rename has blocked due to LQ full")
> .prereq(renameLQFullEvents);
> renameSQFullEvents
> .name(name() + ".SQFullEvents")
> .desc("Number of times rename has blocked due to SQ full")
> .prereq(renameSQFullEvents);
240c244,245
< freeEntries[tid].lsqEntries = iew_ptr->ldstQueue.numFreeEntries(tid);
---
> freeEntries[tid].lqEntries = iew_ptr->ldstQueue.numFreeLoadEntries(tid);
> freeEntries[tid].sqEntries = iew_ptr->ldstQueue.numFreeStoreEntries(tid);
248a254,255
> loadsInProgress[tid] = 0;
> storesInProgress[tid] = 0;
423c430,433
<
---
> loadsInProgress[tid] -= fromIEW->iewInfo[tid].dispatchedToLQ;
> storesInProgress[tid] -= fromIEW->iewInfo[tid].dispatchedToSQ;
> assert(loadsInProgress[tid] >= 0);
> assert(storesInProgress[tid] >= 0);
512d521
< int free_lsq_entries = calcFreeLSQEntries(tid);
522,526d530
< if (free_lsq_entries < min_free_entries) {
< min_free_entries = free_lsq_entries;
< source = LSQ;
< }
<
529c533
< DPRINTF(Rename, "[tid:%u]: Blocking due to no free ROB/IQ/LSQ "
---
> DPRINTF(Rename, "[tid:%u]: Blocking due to no free ROB/IQ/ "
532,533c536
< "IQ has %i free entries.\n"
< "LSQ has %i free entries.\n",
---
> "IQ has %i free entries.\n",
536,537c539
< free_iq_entries,
< free_lsq_entries);
---
> free_iq_entries);
587a590,611
> //For all kind of instructions, check ROB and IQ first
> //For load instruction, check LQ size and take into account the inflight loads
> //For store instruction, check SQ size and take into account the inflight stores
>
> if (inst->isLoad()) {
> if(calcFreeLQEntries(tid) <= 0) {
> DPRINTF(Rename, "[tid:%u]: Cannot rename due to no free LQ\n");
> source = LQ;
> incrFullStat(source);
> break;
> }
> }
>
> if (inst->isStore()) {
> if(calcFreeSQEntries(tid) <= 0) {
> DPRINTF(Rename, "[tid:%u]: Cannot rename due to no free SQ\n");
> source = SQ;
> incrFullStat(source);
> break;
> }
> }
>
667a692,697
> if (inst->isLoad()) {
> loadsInProgress[tid]++;
> }
> if (inst->isStore()) {
> storesInProgress[tid]++;
> }
1125c1155
< DefaultRename<Impl>::calcFreeLSQEntries(ThreadID tid)
---
> DefaultRename<Impl>::calcFreeLQEntries(ThreadID tid)
1127,1128c1157,1163
< int num_free = freeEntries[tid].lsqEntries -
< (instsInProgress[tid] - fromIEW->iewInfo[tid].dispatchedToLSQ);
---
> int num_free = freeEntries[tid].lqEntries -
> (loadsInProgress[tid] - fromIEW->iewInfo[tid].dispatchedToLQ);
> DPRINTF(Rename, "calcFreeLQEntries: free lqEntries: %d, loadsInProgress: %d, "
> "loads dispatchedToLQ: %d\n", freeEntries[tid].lqEntries,
> loadsInProgress[tid], fromIEW->iewInfo[tid].dispatchedToLQ);
> return num_free;
> }
1130,1132c1165,1174
< //DPRINTF(Rename,"[tid:%i]: %i lsq free\n",tid,num_free);
<
< return num_free;
---
> template <class Impl>
> inline int
> DefaultRename<Impl>::calcFreeSQEntries(ThreadID tid)
> {
> int num_free = freeEntries[tid].sqEntries -
> (storesInProgress[tid] - fromIEW->iewInfo[tid].dispatchedToSQ);
> DPRINTF(Rename, "calcFreeSQEntries: free sqEntries: %d, storesInProgress: %d, "
> "stores dispatchedToSQ: %d\n", freeEntries[tid].sqEntries,
> storesInProgress[tid], fromIEW->iewInfo[tid].dispatchedToSQ);
> return num_free;
1190c1232
< } else if (calcFreeLSQEntries(tid) <= 0) {
---
> } else if (calcFreeLQEntries(tid) <= 0 && calcFreeSQEntries(tid) <= 0) {
1214,1215c1256,1259
< if (fromIEW->iewInfo[tid].usedLSQ)
< freeEntries[tid].lsqEntries = fromIEW->iewInfo[tid].freeLSQEntries;
---
> if (fromIEW->iewInfo[tid].usedLSQ) {
> freeEntries[tid].lqEntries = fromIEW->iewInfo[tid].freeLQEntries;
> freeEntries[tid].sqEntries = fromIEW->iewInfo[tid].freeSQEntries;
> }
1223c1267,1268
< DPRINTF(Rename, "[tid:%i]: Free IQ: %i, Free ROB: %i, Free LSQ: %i\n",
---
> DPRINTF(Rename, "[tid:%i]: Free IQ: %i, Free ROB: %i, "
> "Free LQ: %i, Free SQ: %i\n",
1227c1272,1273
< freeEntries[tid].lsqEntries);
---
> freeEntries[tid].lqEntries,
> freeEntries[tid].sqEntries);
1366,1367c1412,1413
< case LSQ:
< ++renameLSQFullEvents;
---
> case LQ:
> ++renameLQFullEvents;
1368a1415,1417
> case SQ:
> ++renameSQFullEvents;
> break;