Go to the documentation of this file.
45 warn_once(
"Associativity higher than number of skewing functions. " \
46 "Expect sub-optimal skewing.\n");
52 "for the skewing functions.");
63 const uint8_t lsb = bits<Addr>(
addr, 0);
65 const uint8_t xor_bit = msb ^ lsb;
68 return insertBits<Addr, uint8_t>(
addr >> 1,
msbShift, xor_bit);
79 const uint8_t lsb = msb ^ xor_bit;
83 return insertBits<Addr, uint8_t>(addr_no_msb << 1, 0, lsb);
101 addr1 =
hash(addr1) ^
hash(addr2) ^ addr2;
104 addr1 =
hash(addr1) ^
hash(addr2) ^ addr1;
125 panic(
"A skewing function has not been implemented for this way.");
157 addr1 = addr1 ^
hash(addr2);
165 addr1 = addr1 ^
dehash(addr2);
171 return hash(addr1 ^
hash(addr2) ^ addr2);
173 addr1 = addr1 ^
hash(addr2);
181 addr1 = addr1 ^
dehash(addr2);
187 panic(
"A skewing function has not been implemented for this way.");
212 for (uint32_t way = 0; way <
assoc; ++way) {
221 SkewedAssociativeParams::create()
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
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.
uint32_t getSet() const
Get set number.
Addr hash(const Addr addr) const
The hash function itself.
Addr regenerateAddr(const Addr tag, const ReplaceableEntry *entry) const override
Regenerate an entry's address from its tag and assigned set and way.
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
uint32_t extractSet(const Addr addr, const uint32_t way) const
Apply a skewing function to calculate address' set given a way.
std::vector< std::vector< ReplaceableEntry * > > sets
The cache sets.
Addr deskew(const Addr addr, const uint32_t way) const
Address deskewing function (inverse of the skew function) of the given way.
std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const override
Find all possible entries for insertion and replacement of an address.
SkewedAssociative(const Params *p)
Construct and initialize this policy.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr dehash(const Addr addr) const
Inverse of the hash function.
const int msbShift
The amount to shift a set index to get its MSB.
const int setShift
The amount to shift the address to get the set.
const int tagShift
The amount to shift the address to get the tag.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
BaseIndexingPolicyParams Params
Convenience typedef.
A skewed associative indexing policy.
const unsigned assoc
The associativity.
A common base class for indexing table locations.
Addr skew(const Addr addr, const uint32_t way) const
Address skewing function selection.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
const uint32_t numSets
The number of sets in the cache.
#define panic(...)
This implements a cprintf based panic() function.
uint32_t getWay() const
Get way number.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17