diff options
author | Faissal Sleiman <Faissal.Sleiman@arm.com> | 2013-10-17 10:20:45 -0500 |
---|---|---|
committer | Faissal Sleiman <Faissal.Sleiman@arm.com> | 2013-10-17 10:20:45 -0500 |
commit | e516531bd0010eec4ab3352ff0b12057782a40ce (patch) | |
tree | 9382f4f7fe4a580b10fbcc1425cd2312797b4864 /src | |
parent | 1e2a455a2382065d6ada6d08e465ce6126ebbdcf (diff) | |
download | gem5-e516531bd0010eec4ab3352ff0b12057782a40ce.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/o3/lsq_unit_impl.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index 077af1dd7..44b8e9041 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -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> |