There is alloconfill() function in gem5/src/mem/cache/cache.hh. This determines whether data is allocated in cache upon miss in L1 cache or not.
Ideally, If cache is 'mostly exclusive' then data should not be allocated in cache upon miss in L1 cache.
But this function loads data in 'mostly exclusive' upon miss in L1 cache in some cases( if commands are WriteLineReq, ReadReq and WriteReq).
Can anyone explain, why this function loads data in mostly exclusive cache, if commands are WriteLineReq, ReadReq and WriteReq
| ||* Determine whether we should allocate on a fill or not. If this|
| ||* cache is mostly inclusive with regards to the upstream cache(s)|
| ||* we always allocate (for any non-forwarded and cacheable|
| ||* requests). In the case of a mostly exclusive cache, we allocate|
| ||* on fill if the packet did not come from a cache, thus if we:|
| ||* are dealing with a whole-line write (the latter behaves much|
| ||* like a writeback), the original target packet came from a|
| ||* non-caching source, or if we are performing a prefetch or LLSC.|
| ||* @param cmd Command of the incoming requesting packet|
| ||* @return Whether we should allocate on the fill|
| ||inline bool allocOnFill(MemCmd cmd) const override|
| ||return clusivity == Enums::mostly_incl |||
| ||cmd == MemCmd::WriteLineReq |||
| ||cmd == MemCmd::ReadReq |||
| ||cmd == MemCmd::WriteReq |||
| ||cmd.isPrefetch() |||