cpu: Put in assertions to check for maximum supported LQ/SQ size

LSQSenderState represents the LQ/SQ index using uint8_t, which supports up to
 256 entries (including the sentinel entry). Sending packets to memory with a
higher index than 255 truncates the index, such that the response matches the
wrong entry. For instance, this can result in a deadlock if a store completion
does not clear the head entry.
This commit is contained in:
Faissal Sleiman 2013-10-17 10:20:45 -05:00
parent 1e2a455a23
commit e516531bd0

View file

@ -158,6 +158,10 @@ LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
LQEntries = maxLQEntries + 1;
SQEntries = maxSQEntries + 1;
//Due to uint8_t index in LSQSenderState
assert(LQEntries <= 256);
assert(SQEntries <= 256);
loadQueue.resize(LQEntries);
storeQueue.resize(SQEntries);
@ -306,6 +310,7 @@ LSQUnit<Impl>::resizeLQ(unsigned size)
LQEntries = size_plus_sentinel;
}
assert(LQEntries <= 256);
}
template<class Impl>
@ -322,6 +327,8 @@ LSQUnit<Impl>::resizeSQ(unsigned size)
} else {
SQEntries = size_plus_sentinel;
}
assert(SQEntries <= 256);
}
template <class Impl>