mem-cache: Privatize extractSet
Only BaseSetAssoc uses extractSet(). Besides, skewed caches need the way information to know which set an address is located at. Change-Id: Id222e907dc550d053018561bb2683cfc415471ec Reviewed-on: https://gem5-review.googlesource.com/9962 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
7704113d94
commit
e404dddca9
3
src/mem/cache/tags/base.hh
vendored
3
src/mem/cache/tags/base.hh
vendored
@@ -288,9 +288,6 @@ class BaseTags : public ClockedObject
|
||||
*/
|
||||
virtual Addr regenerateBlkAddr(const CacheBlk* blk) const = 0;
|
||||
|
||||
virtual int extractSet(Addr addr) const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Visit each block in the tags and apply a visitor
|
||||
*
|
||||
|
||||
22
src/mem/cache/tags/base_set_assoc.hh
vendored
22
src/mem/cache/tags/base_set_assoc.hh
vendored
@@ -278,16 +278,6 @@ class BaseSetAssoc : public BaseTags
|
||||
return (addr >> tagShift);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the set index from the address.
|
||||
* @param addr The address to get the set from.
|
||||
* @return The set index of the address.
|
||||
*/
|
||||
int extractSet(Addr addr) const override
|
||||
{
|
||||
return ((addr >> setShift) & setMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate the block address from the tag and set.
|
||||
*
|
||||
@@ -313,6 +303,18 @@ class BaseSetAssoc : public BaseTags
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Calculate the set index from the address.
|
||||
*
|
||||
* @param addr The address to get the set from.
|
||||
* @return The set index of the address.
|
||||
*/
|
||||
int extractSet(Addr addr) const
|
||||
{
|
||||
return ((addr >> setShift) & setMask);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //__MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
|
||||
|
||||
10
src/mem/cache/tags/fa_lru.hh
vendored
10
src/mem/cache/tags/fa_lru.hh
vendored
@@ -220,16 +220,6 @@ class FALRU : public BaseTags
|
||||
return blkAlign(addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the set of an address. Only one set in a fully associative cache.
|
||||
* @param addr The address to get the set from.
|
||||
* @return 0.
|
||||
*/
|
||||
int extractSet(Addr addr) const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate the block address from the tag.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user