Go to the documentation of this file.
48 warn_once(
"Associativity higher than number of skewing functions. " \
49 "Expect sub-optimal skewing.\n");
55 "for the skewing functions.");
66 const uint8_t lsb = bits<Addr>(
addr, 0);
68 const uint8_t xor_bit = msb ^ lsb;
71 return insertBits<Addr, uint8_t>(
addr >> 1,
msbShift, xor_bit);
82 const uint8_t lsb = msb ^ xor_bit;
86 return insertBits<Addr, uint8_t>(addr_no_msb << 1, 0, lsb);
104 addr1 =
hash(addr1) ^
hash(addr2) ^ addr2;
107 addr1 =
hash(addr1) ^
hash(addr2) ^ addr1;
128 panic(
"A skewing function has not been implemented for this way.");
160 addr1 = addr1 ^
hash(addr2);
168 addr1 = addr1 ^
dehash(addr2);
174 return hash(addr1 ^
hash(addr2) ^ addr2);
176 addr1 = addr1 ^
hash(addr2);
184 addr1 = addr1 ^
dehash(addr2);
190 panic(
"A skewing function has not been implemented for this way.");
215 for (uint32_t way = 0; way <
assoc; ++way) {
uint32_t getSet() const
Get set number.
Addr hash(const Addr addr) const
The hash function itself.
A common base class for indexing table locations.
uint32_t extractSet(const Addr addr, const uint32_t way) const
Apply a skewing function to calculate address' set given a way.
BaseIndexingPolicyParams Params
Convenience typedef.
const unsigned setMask
Mask out all bits that aren't part of the set index.
const int NUM_SKEWING_FUNCTIONS
The number of skewing functions implemented.
Addr deskew(const Addr addr, const uint32_t way) const
Address deskewing function (inverse of the skew function) of the given way.
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
std::vector< std::vector< ReplaceableEntry * > > sets
The cache sets.
const unsigned assoc
The associativity.
SkewedAssociative(const Params &p)
Construct and initialize this policy.
const int tagShift
The amount to shift the address to get the tag.
const int msbShift
The amount to shift a set index to get its MSB.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr regenerateAddr(const Addr tag, const ReplaceableEntry *entry) const override
Regenerate an entry's address from its tag and assigned set and way.
uint32_t getWay() const
Get way number.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Addr dehash(const Addr addr) const
Inverse of the hash function.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
const uint32_t numSets
The number of sets in the cache.
Addr skew(const Addr addr, const uint32_t way) const
Address skewing function selection.
const int setShift
The amount to shift the address to get the set.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const override
Find all possible entries for insertion and replacement of an address.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17